|
|
@@ -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]] |