|
|
@@ -182,24 +182,33 @@ class OnPushStreamProcess(PushStreamProcess): |
|
|
|
qs_np_tmp = np.append(qs_np_tmp,qs_np_id,axis=0) |
|
|
|
qs_np_tmp[:, 11] += 1 |
|
|
|
qs_np_tmp = np.delete(qs_np_tmp, np.where((qs_np_tmp[:, 11] >= 75))[0], axis=0) |
|
|
|
for q in qs_reurn: |
|
|
|
if q[11] == 0: |
|
|
|
cls = int(q[9]) |
|
|
|
code = str(int(q[10])).zfill(3) |
|
|
|
if det_xywh2.get(code) is None: |
|
|
|
det_xywh2[code] = {} |
|
|
|
cd = det_xywh2[code].get(cls) |
|
|
|
score = q[8] |
|
|
|
rainbows, label_arrays = draw_config[code]["rainbows"], draw_config[code]["label_arrays"] |
|
|
|
label_array, color = label_arrays[cls], rainbows[cls] |
|
|
|
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]))] |
|
|
|
if cd is None: |
|
|
|
det_xywh2[code][cls] = [[cls, box, score, label_array, color]] |
|
|
|
else: |
|
|
|
det_xywh2[code][cls].append([cls, box, score, label_array, color]) |
|
|
|
if len(det_xywh2) > 0: |
|
|
|
put_queue(image_queue, (1, [det_xywh2, frame, frame_index_list[i], all_frames, draw_config["font_config"]])) |
|
|
|
has = False |
|
|
|
for j in qs_reurn: |
|
|
|
if j[11] == 0: |
|
|
|
has = True |
|
|
|
break |
|
|
|
if has: |
|
|
|
for q in qs_reurn: |
|
|
|
if q[11] == 0: |
|
|
|
cls = int(q[9]) |
|
|
|
code = str(int(q[10])).zfill(3) |
|
|
|
if det_xywh2.get(code) is None: |
|
|
|
det_xywh2[code] = {} |
|
|
|
cd = det_xywh2[code].get(cls) |
|
|
|
score = q[8] |
|
|
|
rainbows, label_arrays = draw_config[code]["rainbows"], draw_config[code]["label_arrays"] |
|
|
|
label_array, color = label_arrays[cls], rainbows[cls] |
|
|
|
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: |
|
|
|
is_new = True |
|
|
|
if cd is None: |
|
|
|
det_xywh2[code][cls] = [[cls, box, score, label_array, color, is_new]] |
|
|
|
else: |
|
|
|
det_xywh2[code][cls].append([cls, box, score, label_array, color, is_new]) |
|
|
|
if len(det_xywh2) > 0: |
|
|
|
put_queue(image_queue, (1, [det_xywh2, frame, frame_index_list[i], all_frames, draw_config["font_config"]])) |
|
|
|
|
|
|
|
push_p = push_stream_result.result(timeout=60) |
|
|
|
ai_video_file = write_ai_video_result.result(timeout=60) |
|
|
@@ -361,24 +370,33 @@ class OffPushStreamProcess(PushStreamProcess): |
|
|
|
qs_np_tmp = np.append(qs_np_tmp,qs_np_id,axis=0) |
|
|
|
qs_np_tmp[:, 11] += 1 |
|
|
|
qs_np_tmp = np.delete(qs_np_tmp, np.where((qs_np_tmp[:, 11] >= 75))[0], axis=0) |
|
|
|
for q in qs_reurn: |
|
|
|
if q[11] == 0: |
|
|
|
cls = int(q[9]) |
|
|
|
code = str(int(q[10])).zfill(3) |
|
|
|
if det_xywh2.get(code) is None: |
|
|
|
det_xywh2[code] = {} |
|
|
|
cd = det_xywh2[code].get(cls) |
|
|
|
score = q[8] |
|
|
|
rainbows, label_arrays = draw_config[code]["rainbows"], draw_config[code]["label_arrays"] |
|
|
|
label_array, color = label_arrays[cls], rainbows[cls] |
|
|
|
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]))] |
|
|
|
if cd is None: |
|
|
|
det_xywh2[code][cls] = [[cls, box, score, label_array, color]] |
|
|
|
else: |
|
|
|
det_xywh2[code][cls].append([cls, box, score, label_array, color]) |
|
|
|
if len(det_xywh2) > 0: |
|
|
|
put_queue(image_queue, (1, [det_xywh2, frame, frame_index_list[i], all_frames, draw_config["font_config"]])) |
|
|
|
has = False |
|
|
|
for j in qs_reurn: |
|
|
|
if j[11] == 0: |
|
|
|
has = True |
|
|
|
break |
|
|
|
if has: |
|
|
|
for q in qs_reurn: |
|
|
|
if q[11] == 0: |
|
|
|
cls = int(q[9]) |
|
|
|
code = str(int(q[10])).zfill(3) |
|
|
|
if det_xywh2.get(code) is None: |
|
|
|
det_xywh2[code] = {} |
|
|
|
cd = det_xywh2[code].get(cls) |
|
|
|
score = q[8] |
|
|
|
rainbows, label_arrays = draw_config[code]["rainbows"], draw_config[code]["label_arrays"] |
|
|
|
label_array, color = label_arrays[cls], rainbows[cls] |
|
|
|
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: |
|
|
|
is_new = True |
|
|
|
if cd is None: |
|
|
|
det_xywh2[code][cls] = [[cls, box, score, label_array, color, is_new]] |
|
|
|
else: |
|
|
|
det_xywh2[code][cls].append([cls, box, score, label_array, color, is_new]) |
|
|
|
if len(det_xywh2) > 0: |
|
|
|
put_queue(image_queue, (1, [det_xywh2, frame, frame_index_list[i], all_frames, draw_config["font_config"]])) |
|
|
|
push_p = push_stream_result.result(timeout=60) |
|
|
|
ai_video_file = write_ai_video_result.result(timeout=60) |
|
|
|
# 接收停止指令 |