Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draw bounding box #227

Closed
Pranav-India opened this issue Dec 19, 2022 · 3 comments
Closed

draw bounding box #227

Pranav-India opened this issue Dec 19, 2022 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@Pranav-India
Copy link

Describe the situation you are working on
I would like to thank you for this amazing git ..I am using yolov5 model detection with the norfair tracker..

Describe what is it that you need help with
In the part where we want to draw the bounding boxes ..I initially used the function draw_tracked_boxes but got the message that this function deprecated..now to use the draw_box function I am not sure how input should be given should I pass the detections of yolov5 or should I pass tracked_objects
Additional context

I saw the part where an argument drawables is used it is said that this should be union of detections and tracked_objects but the detection object is this <tracker.Detection object at 0x7f7f7580c2e8> and tracked_object is Object_7(age: 7, hit_counter: 8, last_distance: 0.62, init_id: 1)

Not sure what can be done..

@Pranav-India Pranav-India added the help wanted Extra attention is needed label Dec 19, 2022
@javiber
Copy link
Collaborator

javiber commented Dec 19, 2022

Hi @Pranav-India,
The new draw_box was made to handle both Detections and TrackedObjects. You can pass the same list that you were passing to the deprecated draw_tracked_boxes.

The idea is that you can pass the list of detections or the list of tracked objects and this function can handle both.

Now that I double check I think the TypeHint of this one Sequence[Union[Detection, TrackedObject]] should be Union[Sequence[Detection], Sequence[TrackedObject]]. A slight difference but that might be what was confusing you.

@Pranav-India
Copy link
Author

Hi @javiber

Thank you for your help ...I sent the tracked objects to the draw_box it is working fine.
I need some help with tracking also it is not doing the the re-identification properly I am loosing the track of bbox(human)..can you suggest something ?
In the video I have some fast moving individuals when there is occlusion among them sometimes it looses the track..

@javiber
Copy link
Collaborator

javiber commented Jan 9, 2023

Hi @Pranav-India, sorry for the late response

Occlusions are a common tracking problem and can't be hard to fix. Norfair by default only uses spatial features so I'd first try to mitigate the problems with that:

  1. Make a video drawing just the detections. Having an idea of how bad the detections are, gives you a better idea of what the tracking is receiving.
  2. Tune the parameters hit_counter_max and initialization_delay if needed. They control how long the objects live after the detection is lost and how long it takes for objects to start after you recover them.
  3. Consider using euclidean-like distances instead of IoU as they tend to be more forgiving. You will also need to change the distance_threshold

If you encounter any problems with those points feel free to reach out we can also give you some suggestions if you share the original video with us.

The steps above just mitigate the issues, in order to properly fix the problem you need to add visual features to the mix, we are working on a better demo and a more detailed guide to ReID, in the meantime we only have this simple demo. You will need a model that can give you proper embedding of your objects.

I'm going to close this issue as the original problem is solved, feel free to open a new one to keep discussing reid after occlusions

@javiber javiber closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants