-1

Well I'm facing some issues about cropping from videos, when cropping is set to True, it does its job, but it exports detected objects from every frame of video (well, it's logical, in every frame it sees new object detections), but I need to export 1 cropped image for every new object that's why I'm using tracker from StrongSORT repo. For example if the first 3 second of video there is 1 object with ID: 1, I need 1 croped image for that ID object, if there will appear another object with another ID, I need second 1 crop. Is there any suggestions how to make it workable

I'm using Deepsort yolov5

1 Answers1

0

DISCLAIMER, I am the creator and maintainer of https://github.com/mikel-brostrom/Yolov5_StrongSORT_OSNet.

You would need to keep track of which detected objects you have stored crops of, so that you don't store them again. This:

https://github.com/mikel-brostrom/Yolov5_StrongSORT_OSNet/blob/8efea8b44eb9b148cbe50d4b9c7458ba112fef73/track.py#L238

Could be updated by:

if save_crop and id is not in id_list_of_already_stored_crops:
...
Mike B
  • 2,136
  • 2
  • 12
  • 31