From dd79a13b84c884332266d34feec35e6cff7eacd4 Mon Sep 17 00:00:00 2001 From: th Date: Thu, 26 Jun 2025 13:50:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E7=89=8C=E5=8F=8A=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E7=A0=81=E6=9D=83=E9=87=8D=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- enums/ModelTypeEnum.py | 10 +++++----- util/ModelUtils.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/enums/ModelTypeEnum.py b/enums/ModelTypeEnum.py index 8e1ea36..8168344 100644 --- a/enums/ModelTypeEnum.py +++ b/enums/ModelTypeEnum.py @@ -125,7 +125,7 @@ class ModelType(Enum): TRAFFIC_FARM_MODEL = ("3", "003", "交通模型", 'highWay2', lambda device, gpuName: { 'device': str(device), 'labelnames': ["行人", "车辆", "纵向裂缝", "横向裂缝", "修补", "网状裂纹", "坑槽", "块状裂纹", "积水", "影子", - "事故","抛撒物", "危化品车辆", "虚标线","其他标线","其他标线"], + "事故","抛撒物", "危化品车辆", "虚标线","其他标线","其他","桥梁外观","设施破损缺失","龙门架","防抛网","标识牌损坏","护栏损坏","钢筋裸露"], 'trtFlag_seg': True, 'trtFlag_det': True, 'seg_nclass': 3, @@ -166,7 +166,7 @@ class ModelType(Enum): "classes": 10, "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, 'Segweights': '../weights/trt/AIlib2/highWay2/stdc_360X640_%s_fp16.engine' % gpuName }) @@ -699,7 +699,7 @@ class ModelType(Enum): 'roadVehicleAngle': 15, 'speedRoadVehicleAngleMax': 75, 'roundness': 1.0, - 'cls': 9, + 'cls': 10, 'vehicleFactor': 0.1, 'confThres': 0.25, 'roadIou': 0.6, @@ -716,8 +716,8 @@ class ModelType(Enum): "classes": 10, "rainbows": COLOR }, - 'Detweights': "../weights/trt/AIlib2/highWay2/yolov5_%s_fp16.engine" % gpuName, - 'Segweights': '../weights/trt/AIlib2/highWay2/stdc_360X640_%s_fp16.engine' % gpuName + 'Detweights': "../weights/trt/AIlib2/highWay2T/yolov5_%s_fp16.engine" % gpuName, + 'Segweights': '../weights/trt/AIlib2/highWay2T/stdc_360X640_%s_fp16.engine' % gpuName }) SMARTSITE_MODEL = ("28", "028", "智慧工地模型", 'smartSite', lambda device, gpuName: { diff --git a/util/ModelUtils.py b/util/ModelUtils.py index dc71742..49478f1 100644 --- a/util/ModelUtils.py +++ b/util/ModelUtils.py @@ -319,8 +319,8 @@ class IMModel: if ModelType.PLATE_MODEL == modeType: img_type = 'plate' par = { - '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}, + '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}, 'conf_thres': 0.4, 'iou_thres': 0.45, 'device': 'cuda:%s' % device, @@ -329,7 +329,7 @@ class IMModel: new_device = torch.device(par['device']) model = torch.jit.load(par[img_type]['weights']) - logger.info("########################加载 ../AIlib2/weights/conf/jkm/plate_yolov5s_v3.jit 成功 ########################, requestId:{}", + logger.info("########################加载 jit 模型成功 成功 ########################, requestId:{}", requestId) self.model_conf = (modeType, allowedList, new_device, model, par, img_type) except Exception: