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

Add demo tracking keypoints and bounding boxes using OpenPose and YOLOv5 #99

Merged
merged 1 commit into from Apr 8, 2022

Conversation

facundo-lezama
Copy link
Collaborator

This PR builds a demo to show the possibilities that Norfair offers to track objects from multiple classes using a single Tracker instance. Also the example shows Norfair's ability to draw keypoints and bounding boxes for different types of objects.

Copy link
Collaborator

@joaqo joaqo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

I left a few comments of things that may need changing. Also, we need to add a reference in the main README to this demo.

Finally, was wondering why the production_ID_4791196_10s.mp4 file was versioned?


## Explanation

This example aims to show the possibilities that Norfair offers to track objects from multiple classes using a single `Tracker` instance. Also the example shows Norfair's ability to draw keypoints and bounding boxes for different types of objects.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example aims to show the possibilities -> This example aims at showing the possibilities

Comment on lines 153 to 159
distances = np.linalg.norm(detected_pose.points - tracked_pose.estimate, axis=1)
match_num = np.count_nonzero(
(distances < KEYPOINT_DIST_THRESHOLD)
* (detected_pose.scores > DETECTION_THRESHOLD)
* (tracked_pose.last_detection.scores > DETECTION_THRESHOLD)
)
return 1 / (1 + match_num)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be slightly more readable under an else statement, as we are choosing between 2 distinct options.

)
KEYPOINT_DIST_THRESHOLD = video.input_height / 40

for i, frame in enumerate(video):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd personally not support skipping frames in this demo. There are a lot of things going on, and we want to make each demo show off a small, easy to grasp, subset of Norfair's features. So anything that makes the demo shorter and simpler is better (except not tracking 2 classes 😂).

@joaqo
Copy link
Collaborator

joaqo commented Apr 5, 2022

Just saw that that video is the input video for the demo. We should probably not version it, and store it somewhere so that users can download it manually. Maybe add a wget command to the demo or something like that.

Storing it in github would probably be ideal. Same goes for the gif. We can chat about this on slack later.

@facundo-lezama
Copy link
Collaborator Author

Made the requested changes. Regarding the input video I uploaded it by editing the README file from the web UI.

@joaqo joaqo merged commit 932ca61 into master Apr 8, 2022
@joaqo joaqo deleted the demo-keypoints-bboxes branch April 8, 2022 17:51
javiber pushed a commit that referenced this pull request Sep 13, 2022
Add demo tracking keypoints and bounding boxes using OpenPose and YOLOv5
javiber pushed a commit that referenced this pull request Sep 13, 2022
Add demo tracking keypoints and bounding boxes using OpenPose and YOLOv5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants