Skip to content

Commit

Permalink
Merge pull request #99 from tryolabs/demo-keypoints-bboxes
Browse files Browse the repository at this point in the history
Add demo tracking keypoints and bounding boxes using OpenPose and YOLOv5
  • Loading branch information
joaqo committed Apr 8, 2022
2 parents dfd4f0d + af44da4 commit 932ca61
Show file tree
Hide file tree
Showing 5 changed files with 7,742 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ We provide several examples of how Norfair can be used to add tracking capabilit
3. [Faster tracking of cars](demos/yolov4) using [YOLOv4](https://github.com/Tianxiaomo/pytorch-YOLOv4/tree/master).
4. Inserting Norfair into an existing project: [Simple tracking of pedestrians](demos/alphapose) using [AlphaPose](https://github.com/MVIG-SJTU/AlphaPose).
5. [Speed up pose estimation by extrapolating detections](demos/openpose) using [OpenPose](https://github.com/CMU-Perceptual-Computing-Lab/openpose).
6. [Tracking objects from different classes using keypoints and bounding boxes](demos/keypoints_bounding_boxes) using [YOLOv5](https://github.com/fcakyon/yolov5-pip) and [OpenPose](https://github.com/CMU-Perceptual-Computing-Lab/openpose/releases/tag/v1.7.0)

![Norfair OpenPose Demo](docs/openpose_skip_3_frames.gif)

Expand Down
21 changes: 21 additions & 0 deletions demos/keypoints_bounding_boxes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Track multiple classes

An example of how to use Norfair to track objects from multiple classes using both keypoints and bounding boxes. This example is based on [OpenPose](https://github.com/CMU-Perceptual-Computing-Lab/openpose) version 1.7 and [YOLOv5-pip](https://github.com/fcakyon/yolov5-pip).

## Instructions

1. Install YOLOv5 with `pip install yolov5`.
2. Install Norfair with `pip install norfair[video]`.
3. Install [OpenPose version 1.7](https://github.com/CMU-Perceptual-Computing-Lab/openpose/releases/tag/v1.7.0). You can follow [this](./install_openpose.ipynb) instructions to install and compile OpenPose.
4. Download the [example video](https://user-images.githubusercontent.com/92468171/162247647-d4c13cdd-a127-455e-967f-531e24cf20cb.mp4) with `wget "https://user-images.githubusercontent.com/92468171/162247647-d4c13cdd-a127-455e-967f-531e24cf20cb.mp4" -O production_ID_4791196_10s.mp4`
5. Run `python keypoints_bounding_boxes_demo.py production_ID_4791196_10s.mp4 --classes 1 2 3 5 --track_points bbox --conf_thres 0.4`.

Alternatively the example can be executed entirely within `keypoints_bounding_boxes_demo.ipynb`.

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/tryolabs/norfair/blob/demo-keypoints-bboxes/demos/keypoints_bounding_boxes/keypoints_bounding_boxes_demo.ipynb)

## Explanation

This example aims at showing 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.

![keypoints_bounding_boxes_demo](../../docs/keypoints_bounding_boxes_demo.gif)

0 comments on commit 932ca61

Please sign in to comment.