-
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
Simplify API #106
Simplify API #106
Conversation
- removing point_transience argument - removing hit_inertia_min (set to 0) - create a pointwise_hit_counter_max argument - rename hit_inertia_max to hit_counter_max Also, change '_' to '-' in motmetics4norfair arguments
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 great, its amazing to see how the code is cleaner and also the api easier to use!
@@ -20,25 +22,29 @@ | |||
help="Path to the MOT Challenge train dataset folder (test dataset doesn't provide labels)", | |||
) | |||
parser.add_argument( | |||
"--make_video", | |||
"--make-video", | |||
dest="make_video", |
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 don't think its necessary to add dest="make_video"
, this library automatically converts -
to _
in the argument string.
action="store_true", | ||
help="Generate an output video, using the frames provided by the MOTChallenge dataset.", | ||
) | ||
parser.add_argument( | ||
"--save_pred", | ||
"--save-pred", | ||
dest="save_pred", |
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.
^
action="store_true", | ||
help="Generate an output video, using the frames provided by the MOTChallenge dataset.", | ||
) | ||
parser.add_argument( | ||
"--save_pred", | ||
"--save-pred", | ||
dest="save_pred", |
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.
^
action="store_true", | ||
help="Generate a text file with your predictions", | ||
) | ||
parser.add_argument( | ||
"--save_metrics", | ||
"--save-metrics", | ||
dest="save_metrics", |
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.
^
action="store_true", | ||
help="Generate a text file with your predictions", | ||
) | ||
parser.add_argument( | ||
"--save_metrics", | ||
"--save-metrics", | ||
dest="save_metrics", |
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.
^
hit_inertia_min=10, | ||
hit_inertia_max=12, | ||
point_transience=4, | ||
detection_threshold = detection_threshold, |
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.
Unnecessary space around =
.
- `initialization_delay (optional)`: Each tracked object waits till its internal hit intertia counter goes over `hit_inertia_min` to be considered as a potential object to be returned to the user by the Tracker. The argument `initialization_delay` determines by how much the object's hit inertia counter must exceed `hit_inertia_min` to be considered as initialized, and get returned to the user as a real object. If set to 0, objects will get returned to the user as soon as they exceed their `hit_inertia_min`, which can be problematic as this is also the threshold for object destruction, and can result in objects appearing and immediately dissapearing. Defaults to `(hit_inertia_max - hit_inertia_min) / 2`. | ||
- `hit_counter_max (optional)`: Each tracked objects keeps an internal hit counter which tracks how often it's getting matched to a detection, each time it gets a match this counter goes up, and each time it doesn't it goes down. If it goes below 0 the object gets destroyed. This argument (`hit_counter_max`) defines how large this inertia can grow, and therefore defines how long an object can live without getting matched to any detections, before it is destroyed. Defaults to `15`. | ||
- `initialization_delay (optional)`: The argument `initialization_delay` determines by how large the object's hit counter must be in order to be considered as initialized, and get returned to the user as a real object. If set to 0, objects will get returned to the user as soon as they are detected for the first time, which can be problematic as this can result in objects appearing and immediately dissapearing. Defaults to `hit_counter_max / 2`. | ||
- `pointwise_hit_counter_max (optional)`: Each tracked object keeps track of how often the points it's tracking have been getting matched. Points that are getting matched (`pointwise_hit_counter > 0`) are said to be live, and points which aren't (`pointwise_hit_counter = 0`) are said to not be live. This is used to determine things like which individual points in a tracked object get drawn by [`draw_tracked_objects`](#draw_tracked_objects) and which don't. This argument (`pointwise_hit_counter_max`) defines how large the inertia for each point of a tracker can grow. Defaults to `5`. |
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.
Mention that it must be smaller than hit_counter_max
as a point can't live longer than the object it belongs to. I think this will make how hit_counter_max
and pointwise_hit_counter_max
relate clearer.
- `initialization_delay (optional)`: Each tracked object waits till its internal hit intertia counter goes over `hit_inertia_min` to be considered as a potential object to be returned to the user by the Tracker. The argument `initialization_delay` determines by how much the object's hit inertia counter must exceed `hit_inertia_min` to be considered as initialized, and get returned to the user as a real object. If set to 0, objects will get returned to the user as soon as they exceed their `hit_inertia_min`, which can be problematic as this is also the threshold for object destruction, and can result in objects appearing and immediately dissapearing. Defaults to `(hit_inertia_max - hit_inertia_min) / 2`. | ||
- `hit_counter_max (optional)`: Each tracked objects keeps an internal hit counter which tracks how often it's getting matched to a detection, each time it gets a match this counter goes up, and each time it doesn't it goes down. If it goes below 0 the object gets destroyed. This argument (`hit_counter_max`) defines how large this inertia can grow, and therefore defines how long an object can live without getting matched to any detections, before it is destroyed. Defaults to `15`. | ||
- `initialization_delay (optional)`: The argument `initialization_delay` determines by how large the object's hit counter must be in order to be considered as initialized, and get returned to the user as a real object. If set to 0, objects will get returned to the user as soon as they are detected for the first time, which can be problematic as this can result in objects appearing and immediately dissapearing. Defaults to `hit_counter_max / 2`. | ||
- `pointwise_hit_counter_max (optional)`: Each tracked object keeps track of how often the points it's tracking have been getting matched. Points that are getting matched (`pointwise_hit_counter > 0`) are said to be live, and points which aren't (`pointwise_hit_counter = 0`) are said to not be live. This is used to determine things like which individual points in a tracked object get drawn by [`draw_tracked_objects`](#draw_tracked_objects) and which don't. This argument (`pointwise_hit_counter_max`) defines how large the inertia for each point of a tracker can grow. Defaults to `5`. |
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.
Mention that it must be smaller than hit_counter_max
as a point can't live longer than the object it belongs to.
norfair/tracker.py
Outdated
initialization_delay: Optional[int] = None, | ||
pointwise_hit_counter_max: int = 5, |
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.
According to my math this should be actually 4 instead of 5, to be the closest to 15/4? Or is this not the correct calculation?
norfair/tracker.py
Outdated
initialization_delay: Optional[int] = None, | ||
pointwise_hit_counter_max: int = 5, |
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.
According to my math this should be actually 4 instead of 5, to be the closest as it was when we used point_transience
?
hit_inertia_min
-> Removedhit_inertia_max
->hit_counter_max
point_transience
->pointwise_hit_counter_max