车牌及健康码权重文件路径优化

This commit is contained in:
th 2025-06-26 13:50:04 +08:00
parent c579f2f421
commit dd79a13b84
2 changed files with 8 additions and 8 deletions

View File

@ -125,7 +125,7 @@ class ModelType(Enum):
TRAFFIC_FARM_MODEL = ("3", "003", "交通模型", 'highWay2', lambda device, gpuName: { TRAFFIC_FARM_MODEL = ("3", "003", "交通模型", 'highWay2', lambda device, gpuName: {
'device': str(device), 'device': str(device),
'labelnames': ["行人", "车辆", "纵向裂缝", "横向裂缝", "修补", "网状裂纹", "坑槽", "块状裂纹", "积水", "影子", 'labelnames': ["行人", "车辆", "纵向裂缝", "横向裂缝", "修补", "网状裂纹", "坑槽", "块状裂纹", "积水", "影子",
"事故","抛撒物", "危化品车辆", "虚标线","其他标线","其他标线"], "事故","抛撒物", "危化品车辆", "虚标线","其他标线","其他","桥梁外观","设施破损缺失","龙门架","防抛网","标识牌损坏","护栏损坏","钢筋裸露"],
'trtFlag_seg': True, 'trtFlag_seg': True,
'trtFlag_det': True, 'trtFlag_det': True,
'seg_nclass': 3, 'seg_nclass': 3,
@ -166,7 +166,7 @@ class ModelType(Enum):
"classes": 10, "classes": 10,
"rainbows": COLOR "rainbows": COLOR
}, },
'allowedList':[0,1,2,3,4,5,6,7,8,9,10,11,12], 'allowedList':[0,1,2,3,4,5,6,7,8,9,10,11,12,16,17,18,19,20,21,22],
'Detweights': "../weights/trt/AIlib2/highWay2/yolov5_%s_fp16.engine" % gpuName, 'Detweights': "../weights/trt/AIlib2/highWay2/yolov5_%s_fp16.engine" % gpuName,
'Segweights': '../weights/trt/AIlib2/highWay2/stdc_360X640_%s_fp16.engine' % gpuName 'Segweights': '../weights/trt/AIlib2/highWay2/stdc_360X640_%s_fp16.engine' % gpuName
}) })
@ -699,7 +699,7 @@ class ModelType(Enum):
'roadVehicleAngle': 15, 'roadVehicleAngle': 15,
'speedRoadVehicleAngleMax': 75, 'speedRoadVehicleAngleMax': 75,
'roundness': 1.0, 'roundness': 1.0,
'cls': 9, 'cls': 10,
'vehicleFactor': 0.1, 'vehicleFactor': 0.1,
'confThres': 0.25, 'confThres': 0.25,
'roadIou': 0.6, 'roadIou': 0.6,
@ -716,8 +716,8 @@ class ModelType(Enum):
"classes": 10, "classes": 10,
"rainbows": COLOR "rainbows": COLOR
}, },
'Detweights': "../weights/trt/AIlib2/highWay2/yolov5_%s_fp16.engine" % gpuName, 'Detweights': "../weights/trt/AIlib2/highWay2T/yolov5_%s_fp16.engine" % gpuName,
'Segweights': '../weights/trt/AIlib2/highWay2/stdc_360X640_%s_fp16.engine' % gpuName 'Segweights': '../weights/trt/AIlib2/highWay2T/stdc_360X640_%s_fp16.engine' % gpuName
}) })
SMARTSITE_MODEL = ("28", "028", "智慧工地模型", 'smartSite', lambda device, gpuName: { SMARTSITE_MODEL = ("28", "028", "智慧工地模型", 'smartSite', lambda device, gpuName: {

View File

@ -319,8 +319,8 @@ class IMModel:
if ModelType.PLATE_MODEL == modeType: if ModelType.PLATE_MODEL == modeType:
img_type = 'plate' img_type = 'plate'
par = { par = {
'code': {'weights': 'weights/pth/AIlib2/jkm/health_yolov5s_v3.jit', 'img_type': 'code', 'nc': 10}, 'code': {'weights': '../weights/pth/AIlib2/jkm/health_yolov5s_v3.jit', 'img_type': 'code', 'nc': 10},
'plate': {'weights': 'weights/pth/AIlib2/jkm/plate_yolov5s_v3.jit', 'img_type': 'plate', 'nc': 1}, 'plate': {'weights': '../weights/pth/AIlib2/jkm/plate_yolov5s_v3.jit', 'img_type': 'plate', 'nc': 1},
'conf_thres': 0.4, 'conf_thres': 0.4,
'iou_thres': 0.45, 'iou_thres': 0.45,
'device': 'cuda:%s' % device, 'device': 'cuda:%s' % device,
@ -329,7 +329,7 @@ class IMModel:
new_device = torch.device(par['device']) new_device = torch.device(par['device'])
model = torch.jit.load(par[img_type]['weights']) model = torch.jit.load(par[img_type]['weights'])
logger.info("########################加载 ../AIlib2/weights/conf/jkm/plate_yolov5s_v3.jit 成功 ########################, requestId:{}", logger.info("########################加载 jit 模型成功 成功 ########################, requestId:{}",
requestId) requestId)
self.model_conf = (modeType, allowedList, new_device, model, par, img_type) self.model_conf = (modeType, allowedList, new_device, model, par, img_type)
except Exception: except Exception: