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 option to use BBox tracking with SORT algorithm: #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ManuelPalermo
Copy link

@ManuelPalermo ManuelPalermo commented Apr 2, 2021

Hi, tried improving detection consistency across frames using BBox tracking with the SORT algorithm (https://arxiv.org/pdf/1602.00763.pdf). The implementation was completely ported from the original author (https://github.com/abewley/sort)

@mdraw
Copy link
Member

mdraw commented Apr 6, 2021

Thanks for your work @ManuelPalermo, that sounds like a great feature! I'm not sure if everything works as it should with the given default configuration though.
I've tested your implementation on some rather challenging video clips and found that with the default settings (--track-config '{}') there were actually more missing face detections. For example using --track-config '{"max_age": 100, "min_hits": 0, "iou_threshold": 0.01}' instead, the results were similar to not using the tracking feature at all. Can you recommend a good default setting with which the results are improved?
In addition, can you share a video clip where you see an improvement by using the new tracking feature so I can test it?

for frame in read_iter:
# Perform network inference, get bb dets but discard landmark predictions
dets, _ = centerface(frame, threshold=threshold)

if tracking_kwargs is not None:
dets = tracker.update(dets)
Copy link
Member

Choose a reason for hiding this comment

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

If you just replace dets with the tracker.update() result, the 5th entry of each detection array, which originally contains the detection score, is replaced with the (integer) object ID (https://github.com/ORB-HD/deface/pull/11/files#diff-3842ed04dbf395f7ad3f223e01881b86518e46e46fa6bd80e60467d970bdf5a4R205). The score should be kept so it can be visualized later with --draw-scores.

--track-config SORT arguments for bounding-box detection tracking, or
None if tracking should not be used.
This argument is expected in JSON notation. For a list
of possible options, refer to the original SORT repository.
Copy link
Member

Choose a reason for hiding this comment

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

SORT is quite hard to discover through Google, so I'd rather link directly to its options or describe them, maybe based on the help texts provided here: https://github.com/abewley/sort/blob/master/sort.py#L261-L267

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.

2 participants