mikel-brostrom / boxmot

BoxMOT: pluggable SOTA tracking modules for segmentation, object detection and pose estimation models
GNU Affero General Public License v3.0
6.54k stars 1.69k forks source link

Why reid is not working at all in my case? #1569

Closed RajS999 closed 2 weeks ago

RajS999 commented 1 month ago

I am trying out boxmot library and testing reid with botsort on small video clip in which a person walking on the road gets occluded behind a bill board and emerges out from other side of bill board. The whole clip is of mere 275 frames (~ 10 seconds). I tried several combinations of models / parameters, but the person always gets assigned with a new ID when he emerged our of bill board ! (I also tried botsort's official repo with yolov7 and yolox and reid, with no luck.)

I tried combination of:

Specifically, I tried following commands:

/workspace/boxmot# python tracking/track.py  --yolo-model yolov8n.pt --reid-model osnet_x0_25_msmt17.pt --source <my-video-path> --save --conf 0.2
/workspace/boxmot# python tracking/track.py --yolo-model yolov8n --tracking-method botsort --reid-model clip_market1501.pt --source <my-video-path> --save --conf 0.2

Following with track_buffer = 500

/workspace/boxmot# python tracking/track.py --yolo-model yolov8x --tracking-method botsort --reid-model clip_market1501.pt --source <my-video-path> --save --conf 0.2

I believe I miss basic / essential understanding behind these algorithms? What am missing here? Why reid is not working at all and person always gets assigned with new id when he emerges out from other side of the bill board?

PS: fairmot (from official github repository) seem to work on this video clip out of the box when track_buffer size is increased.

mikel-brostrom commented 1 month ago

Once a track is marked as "lost" due to an unsuccessful association (i.e., when no detections match the track), the Kalman Filter (KF) associated with that track stops updating its state. This happens after a single unsuccessfull association.

mikel-brostrom commented 1 month ago

Try increasing max_age as well

RajS999 commented 1 month ago

Am trying to make reid work with botsort. Thats why I tried botsort's official repo and thats why I specified --tracking-method botsort in second and third command. But mistakenly I did not specify it in first command, so the first command is basically invalid in the sense that it uses the default deepocsort. Sorry I did not explicitly specify this earlier ! Now I guess, botsort does not have max_age parameter, right? In that case, what might be the reason for reid to not work with it? I also tried with proximity_thresh: 0, track_buffer: 500 in botsort.yaml.

Here is my config:

appearance_thresh: 0.7636154550757781
cmc_method: sparseOptFlow
conf: 0.4828271520496597
frame_rate: 30
lambda_: 0.9764964093204093
match_thresh: 0.22182609980772128
new_track_thresh: 0.25855770885476126
proximity_thresh: 0 # 0.37262205760353817
track_buffer: 500
track_high_thresh: 0.5
track_low_thresh: 0.1

and here is my command:

python tracking/track.py --yolo-model yolov8x --tracking-method botsort --reid-model clip_market1501.pt --source <my-vid-path> --conf 0.2 --save
RajS999 commented 1 month ago

I re-read through BoT-SORT paper and Fast-ReID paper. These are the excerpts from these papers:

Now I have two doubts:

Q1. Does above mean we cannot simply use out of the box Re-ID models for successfully doing cross-domain person reidentification? We need to fine-tune them on our dataset before using?

Q2. What are SOTA or community preferred methods for battery powered on-device object tracking with re-identification?

github-actions[bot] commented 3 weeks ago

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs. Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!