Closed wingvortex closed 2 years ago
ok but why are the embeddings longer?
When the length of cls_bboxes is 1 (detect only 1 class), but the length of extractors is always 2, the feature extractor would append more embeddings than detections. I did not go into depth about why the extractor length varies when this happens.
I have pushed some fixes on the branch multi-class-fix. I currently don't have an environment to test this. Can you run again on that branch and let me know if any issue persists?
Hi Alexis, after merging your new pushes, it seems this bug is fixed:
Just to remind you that due to your modifications, numba should also be imported in mot.py, and the 'find_split_indices' in detector.py need to fix as well if you remove this function. Thanks for your excellent work!
Thanks, they should be fixed.
Current Behavior
In my case, I have 2 classes to track. The feature_extractor_cfgs in the json is set as you mentioned: "feature_extractor_cfgs": [ { "model": "OSNet025", "batch_size": 16 }, { "model": "OSNet025", "batch_size": 16 } ] The codes run OK without any warning. However, sometimes the length of embeddings is longer than that of detections. This problem can be reproduced by printing the variable shape:![Snipaste_2022-01-20_15-28-43](https://user-images.githubusercontent.com/45763667/150293022-7a7a7308-6fc5-48e5-916c-b0d5e02deedf.png)
print(self.frame_count, len(cls_bboxes), detections.shape, embeddings.shape)
The reason is as following: there are 2 extractors but the number of cls_bboxes can be 0, 1, 2:
cls_bboxes= np.split(detections.tlbr, find_split_indices(detections.label))
So, these two for loops will not extract the feature for the corresponding bbox:for extractor, bboxes in zip(self.extractors, cls_bboxes):
...for extractor in self.extractors:
Your Environment
Ubuntu 18.04 Not used docker image