-
Notifications
You must be signed in to change notification settings - Fork 247
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 Getting started guide #208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great @javiber! Thanks for adding the Getting Started section, it is an excellent addition to Norfair's documentation.
I left a bunch of comments, mostly formatting issues, but apart from that, I think it's ready to merge. I assumed the formatting was expected to work as in Markdown, I didn't try it in the actual documentation, so feel free to dismiss the comments if you checked that the formatting was correct.
!!! Note | ||
Norfair is a Detection-Based-Tracker (DBT) and as such, its performance is highly dependent on the performance of the model of choice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what was the expected formatting for this note, but I believe it isn't working correctly in Markdown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The !!! Note
is not standard markdown and I don't think Github renders it correctly but it's part of our mkdocs theme
!!! Note | ||
Norfair is a Detection-Based-Tracker (DBT) and as such, its performance is highly dependent on the performance of the model of choice. | ||
|
||
The detections from the model will need to be wrapped in an instance of [Detection][norfair.tracker.Detection] before passing them to Norfair. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check this link and its format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how to define links to other sections in mkdocstring
docs/getting_started.md
Outdated
|
||
## Install | ||
|
||
Installing Norfair is extremely easy, simply run `pip install norfair` to install the latest version from [pypi](https://pypi.org/project/norfair/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change pypi
for PyPI
?
Norfair offers optional functionality to process videos (mp4 and mov formats are supported) or capture a live feed from a camera. | ||
To use this functionality you need to install Norfair with the `video` extra using this command: `pip install norfair[video]`. | ||
|
||
Check the [Video class][norfair.video.Video] for more info on how to use it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check this link and its format.
|
||
Most common problem is that the tracking has errors or is not precise enough. In this case, the first thing to check is whether this is a detection error or a tracking error. As mentioned above if the detector fails the tracking will suffer. | ||
|
||
To debug this use [`draw_points`][norfair.drawing.draw_points] or [`draw_boxes`][norfair.drawing.draw_boxes] to inspect the detections and analyze if they are precise enough. If you are filtering the detections based on scores, this is a good time to tweak the threshold. If you decide that the detections are not good enough you can try a different architecture, a bigger version of the model, or consider fine-tuning the model on your domain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before.
docs/getting_started.md
Outdated
- **Incorrect matches** between Detections and TrackedObjects, a couple of scenarios can cause this: | ||
- `distance_threshold` is too big so the Tracker matches Detections to TrackedObjects that are simply too far. Lower the threshold until you fix the error, the correct value will depend on the distance function that you're using. | ||
- Mismatches when objects overlap. In this case, tracking becomes more challenging, usually, the quality of the detection degrades causing one of the objects to be missed or creating a single big detection that includes both objects. On top of the detection issues, the tracker needs to decide which detection should be matched to which TrackedObject which can be error-prone if only considering spatial information. The solution is not easy but incorporating the notion of the appearance similarity based on some kind of embedding to your distance_finction can help. | ||
- Can't **recover** an object **after oclussions**. Use ReID distance, see [this demo](TODO) for an example but for real-world use you will need a good ReID model that can provide good embeddings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oclussions -> occlusions
docs/getting_started.md
Outdated
- Objects take **too long to start**, this can have multiple causes: | ||
- `initialization_delay` is too big on the Tracker. Makes the TrackedObject stay on initializing for too long, `3` is usually a good value to start with. | ||
- `distance_threshold` is too big on the Tracker. Prevents the Detections to be matched with the correct TrackedObject. The best value depends on the distance used. | ||
- Incorrect `distance_function` on the Tracker. Some distances might not be valid in some cases, for instance, if using IoU but the objects in your video move so quickly that there is never an overlap between the detections of consecutive frames. Try different distances, `frobenious` or `create_normalized_mean_euclidean_distance` are good starting points. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frobenious -> frobenius
docs/getting_started.md
Outdated
- **Incorrect matches** between Detections and TrackedObjects, a couple of scenarios can cause this: | ||
- `distance_threshold` is too big so the Tracker matches Detections to TrackedObjects that are simply too far. Lower the threshold until you fix the error, the correct value will depend on the distance function that you're using. | ||
- Mismatches when objects overlap. In this case, tracking becomes more challenging, usually, the quality of the detection degrades causing one of the objects to be missed or creating a single big detection that includes both objects. On top of the detection issues, the tracker needs to decide which detection should be matched to which TrackedObject which can be error-prone if only considering spatial information. The solution is not easy but incorporating the notion of the appearance similarity based on some kind of embedding to your distance_finction can help. | ||
- Can't **recover** an object **after oclussions**. Use ReID distance, see [this demo](TODO) for an example but for real-world use you will need a good ReID model that can provide good embeddings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check ReID demo link.
docs/getting_started.md
Outdated
|
||
- Objects take **too long to start**, this can have multiple causes: | ||
- `initialization_delay` is too big on the Tracker. Makes the TrackedObject stay on initializing for too long, `3` is usually a good value to start with. | ||
- `distance_threshold` is too big on the Tracker. Prevents the Detections to be matched with the correct TrackedObject. The best value depends on the distance used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't get the idea behind this recommendation. Shouldn't it be that the distance_threshold
is too small?
Based on Facundo's feedback
/reference
page which was not navigatable before to contain the docstring from norfair. Open to suggestions for better alternatives though.