tryolabs / norfair

Lightweight Python library for adding real-time multi-object tracking to any detector.
https://tryolabs.github.io/norfair/
BSD 3-Clause "New" or "Revised" License
2.41k stars 247 forks source link

replace any print() + exit() combos with raise #259

Closed quantumdot closed 10 months ago

quantumdot commented 1 year ago

Addressing #256, replace any instances of the print() + exit() pattern with an appropriate raise of an error.

DiegoFernandezC commented 1 year ago

Hey @quantumdot, thanks for your contribution.

I think that your changes make sense, but we need to make sure that these changes work well in all cases.

I add a list that includes the cases that I tested. I will edit it to include the future test cases that I will do.

  1. Generate a new distance function that returns a None value. I passed it to the Tracker and check this ValueError.
  2. Sent a list that did not contain a Detection instance to the update method to test this ValueError.
  3. Pass a list of points with the following dimension (2,2,2) to check this ValueError.
  4. OpenCV import fail
  5. _fail function