pepeline_extract_subimg.py: extract subimg

This commit is contained in:
王庆刚
2024-10-07 17:27:00 +08:00
parent 390c5d2d94
commit dfb2272a15
6 changed files with 241 additions and 39 deletions

View File

@ -264,12 +264,11 @@ def yolo_resnet_tracker(
im0 = annotator.result()
save_path_img, ext = os.path.splitext(save_path)
if save_img:
if dataset.mode == 'image':
imgpath = save_path_img + f"_{dataset}.png"
else:
imgpath = save_path_img + f"_{dataset.frame}.png"
cv2.imwrite(Path(imgpath), im0)
# if dataset.mode == 'image':
# imgpath = save_path_img + f"_{dataset}.png"
# else:
# imgpath = save_path_img + f"_{dataset.frame}.png"
# cv2.imwrite(Path(imgpath), im0)
if vid_path[i] != save_path: # new video
vid_path[i] = save_path