Bläddra i källkod

城管模型增加边界过滤参数

develop
YAO 1 år sedan
förälder
incheckning
ca4eb67fc7
3 ändrade filer med 10 tillägg och 8 borttagningar
  1. +8
    -6
      concurrency/PushVideoStreamProcess.py
  2. +1
    -1
      enums/ModelTypeEnum.py
  3. +1
    -1
      enums/ModelTypeEnum2.py

+ 8
- 6
concurrency/PushVideoStreamProcess.py Visa fil

@@ -114,6 +114,7 @@ class OnPushStreamProcess(PushStreamProcess):
if push_r[0] == 1:
frame_list, frame_index_list, all_frames, draw_config, push_objs = push_r[1]
for i, frame in enumerate(frame_list):
pix_dis = int((frame.shape[0]//10)*1.2)
# 复制帧用来画图
copy_frame = frame.copy()
det_xywh, thread_p = {}, []
@@ -184,12 +185,12 @@ class OnPushStreamProcess(PushStreamProcess):
qs_np_tmp = np.delete(qs_np_tmp, np.where((qs_np_tmp[:, 11] >= 75))[0], axis=0)
has = False
for j in qs_reurn:
if j[11] == 0:
if j[11] == 1:
has = True
break
if has:
for q in qs_reurn:
if q[11] == 0:
if q[11] >= 1:
cls = int(q[9])
code = str(int(q[10])).zfill(3)
if det_xywh2.get(code) is None:
@@ -201,7 +202,7 @@ class OnPushStreamProcess(PushStreamProcess):
box = [(int(q[0]), int(q[1])), (int(q[2]), int(q[3])),
(int(q[4]), int(q[5])), (int(q[6]), int(q[7]))]
is_new = False
if q[11] == 0:
if q[11] == 1:
is_new = True
if cd is None:
det_xywh2[code][cls] = [[cls, box, score, label_array, color, is_new]]
@@ -300,6 +301,7 @@ class OffPushStreamProcess(PushStreamProcess):
frame_list, frame_index_list, all_frames, draw_config, push_objs = push_r[1]
# 处理每一帧图片
for i, frame in enumerate(frame_list):
pix_dis = int((frame.shape[0]//10)*1.2)
if frame_index_list[i] % 300 == 0 and frame_index_list[i] <= all_frames:
task_process = "%.2f" % (float(frame_index_list[i]) / float(all_frames))
put_queue(hb_queue, {"hb_value": task_process}, timeout=2)
@@ -372,12 +374,12 @@ class OffPushStreamProcess(PushStreamProcess):
qs_np_tmp = np.delete(qs_np_tmp, np.where((qs_np_tmp[:, 11] >= 75))[0], axis=0)
has = False
for j in qs_reurn:
if j[11] == 0:
if j[11] == 1:
has = True
break
if has:
for q in qs_reurn:
if q[11] == 0:
if q[11] >= 1:
cls = int(q[9])
code = str(int(q[10])).zfill(3)
if det_xywh2.get(code) is None:
@@ -389,7 +391,7 @@ class OffPushStreamProcess(PushStreamProcess):
box = [(int(q[0]), int(q[1])), (int(q[2]), int(q[3])),
(int(q[4]), int(q[5])), (int(q[6]), int(q[7]))]
is_new = False
if q[11] == 0:
if q[11] == 1:
is_new = True
if cd is None:
det_xywh2[code][cls] = [[cls, box, score, label_array, color, is_new]]

+ 1
- 1
enums/ModelTypeEnum.py Visa fil

@@ -337,7 +337,7 @@ class ModelType(Enum):
'dmprimg_size': 640,
'mixFunction': {
'function': dmpr_yolo,
'pars': {'carCls': 0, 'illCls': 3, 'scaleRatio': 0.5}
'pars': {'carCls': 0, 'illCls': 3, 'scaleRatio': 0.5, 'border':80}
}
},
'postFile': {

+ 1
- 1
enums/ModelTypeEnum2.py Visa fil

@@ -520,7 +520,7 @@ class ModelType2(Enum):
'dmprimg_size': 640,
'mixFunction': {
'function': dmpr_yolo,
'pars': {'carCls': 0, 'illCls': 3, 'scaleRatio': 0.5}
'pars': {'carCls': 0, 'illCls': 3, 'scaleRatio': 0.5, 'border':80}
}
},
'Segweights': '../AIlib2/weights/cityMangement2/dmpr_%s.engine' % gpuName,

Laddar…
Avbryt
Spara