Browse Source

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

develop
YAO 1 year ago
parent
commit
ca4eb67fc7
3 changed files with 10 additions and 8 deletions
  1. +8
    -6
      concurrency/PushVideoStreamProcess.py
  2. +1
    -1
      enums/ModelTypeEnum.py
  3. +1
    -1
      enums/ModelTypeEnum2.py

+ 8
- 6
concurrency/PushVideoStreamProcess.py View File

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

+ 1
- 1
enums/ModelTypeEnum.py View File

'dmprimg_size': 640, 'dmprimg_size': 640,
'mixFunction': { 'mixFunction': {
'function': dmpr_yolo, 'function': dmpr_yolo,
'pars': {'carCls': 0, 'illCls': 3, 'scaleRatio': 0.5}
'pars': {'carCls': 0, 'illCls': 3, 'scaleRatio': 0.5, 'border':80}
} }
}, },
'postFile': { 'postFile': {

+ 1
- 1
enums/ModelTypeEnum2.py View File

'dmprimg_size': 640, 'dmprimg_size': 640,
'mixFunction': { 'mixFunction': {
'function': dmpr_yolo, '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, 'Segweights': '../AIlib2/weights/cityMangement2/dmpr_%s.engine' % gpuName,

Loading…
Cancel
Save