1)自研车牌模型支持engine

This commit is contained in:
th 2025-08-23 17:08:47 +08:00
parent e9098d26d2
commit bea36e2601
2 changed files with 4 additions and 4 deletions

View File

@ -889,16 +889,18 @@ class ModelType(Enum):
'rainbows': COLOR,
'models': [
{
'weight': '../weights/pth/AIlib2/carplate/plate_yolov5s_v3.jit',
#'weight': '../weights/pth/AIlib2/carplate/plate_yolov5s_v3.jit',
'weight': '../weights/trt/AIlib2/carplate/yolov5_%s_fp16.engine' % (gpuName),
'name': 'yolov5',
'model': yolov5Model,
'par': {
'trtFlag_det': False,
'trtFlag_det': True,
'device': 'cuda:0',
'half': True,
'conf_thres': 0.4,
'iou_thres': 0.45,
'nc': 1,
'plate':8,
'plate_dilate': (0.5, 0.1)
},
},

View File

@ -390,8 +390,6 @@ class CARPLATEModel:
detpar = par['models'][0]['par']
# new_device = torch.device(par['device'])
# modelList=[ modelPar['model'](weights=modelPar['weight'],par=modelPar['par']) for modelPar in par['models'] ]
logger.info("########################加载 plate_yolov5s_v3.jit 成功 ########################, requestId:{}",
requestId)
self.model_conf = (modeType, device, modelList, detpar, par['rainbows'])
except Exception:
logger.error("模型加载异常:{}, requestId:{}", format_exc(), requestId)