From b46182d68e1add59819732067edc2bc44c161a7e Mon Sep 17 00:00:00 2001 From: th Date: Sat, 26 Jul 2025 10:05:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=BA=E7=BE=A4=E8=AE=A1?= =?UTF-8?q?=E6=95=B0=E4=BA=BA=E6=95=B0=E6=98=BE=E7=A4=BA=E5=8F=8A=E8=BE=B9?= =?UTF-8?q?=E7=95=8C=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- enums/ModelTypeEnum.py | 8 ++++++-- util/PlotsUtils.py | 12 +++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/enums/ModelTypeEnum.py b/enums/ModelTypeEnum.py index afc82ee..d2adeba 100644 --- a/enums/ModelTypeEnum.py +++ b/enums/ModelTypeEnum.py @@ -979,7 +979,9 @@ class ModelType(Enum): 'eos_coef': '0.5', 'set_cost_class': 1, 'set_cost_point': 0.05, - 'backbone': 'vgg16_bn' + 'backbone': 'vgg16_bn', + 'expend': 10, + 'psize': 2, }, }], }) @@ -1033,7 +1035,9 @@ class ModelType(Enum): 'eos_coef': '0.5', 'set_cost_class': 1, 'set_cost_point': 0.05, - 'backbone': 'vgg16_bn' + 'backbone': 'vgg16_bn', + 'expend': 10, + 'psize': 5 }, }], }) diff --git a/util/PlotsUtils.py b/util/PlotsUtils.py index 3152b29..943305d 100644 --- a/util/PlotsUtils.py +++ b/util/PlotsUtils.py @@ -317,20 +317,22 @@ def plot_one_box_auto(box, img, color=None, line_thickness=2, label_array=None): return img, box -def draw_name_crowd(dets, img, color, line_thickness=2, outfontsize=20): +def draw_name_crowd(dets, img, color, outfontsize=20): font = ImageFont.truetype(FONT_PATH, outfontsize, encoding='utf-8') - if len(dets) == 1: + if len(dets) == 2: label = '当前人数:%d'%len(dets[0]) detP = dets[0] + line = dets[1] for p in detP: - img = cv2.circle(img, (int(p[0]), int(p[1])), line_thickness, color, -1) + img = cv2.circle(img, (int(p[0]), int(p[1])), line, color, -1) label_arr = get_label_array(color, label, font, outfontsize) lh, lw = label_arr.shape[0:2] img[0:lh, 0:lw, :] = label_arr - elif len(dets) == 2: + elif len(dets) == 3: detP = dets[1] + line = dets[2] for p in detP: - img = cv2.circle(img, (int(p[0]), int(p[1])), line_thickness, color, -1) + img = cv2.circle(img, (int(p[0]), int(p[1])), line, color, -1) detM = dets[0] h, w = img.shape[:2]