SainsburyWellcomeCentre / crabs-exploration

A toolkit for detecting and tracking crabs in the field.
BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

Refactor tracking #193

Closed nikk-nikaznan closed 5 months ago

nikk-nikaznan commented 5 months ago

After #141 Another attempt of #106 Probably first attempt towards #190

codecov-commenter commented 5 months ago

Codecov Report

Attention: Patch coverage is 26.26932% with 334 lines in your changes missing coverage. Please review.

Project coverage is 39.60%. Comparing base (e247e89) to head (380da85).

Files Patch % Lines
crabs/tracker/track_video.py 0.00% 99 Missing :warning:
crabs/tracker/sort.py 0.00% 77 Missing :warning:
crabs/tracker/utils/sort.py 0.00% 65 Missing :warning:
crabs/tracker/utils/io.py 0.00% 38 Missing :warning:
crabs/tracker/utils/tracking.py 61.53% 15 Missing :warning:
crabs/tracker/evaluate_tracker.py 86.36% 12 Missing :warning:
crabs/detector/utils/detection.py 23.07% 10 Missing :warning:
crabs/detector/utils/train.py 40.00% 9 Missing :warning:
crabs/detector/evaluate_model.py 0.00% 7 Missing :warning:
crabs/detector/utils/evaluate.py 50.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #193 +/- ## ========================================== + Coverage 37.91% 39.60% +1.68% ========================================== Files 20 24 +4 Lines 1440 1414 -26 ========================================== + Hits 546 560 +14 + Misses 894 854 -40 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sfmig commented 5 months ago

Hi @nikk-nikaznan,

I liked this organisation, feels clearer!

I had a go at changing a few things - below an attempt at explaining my thinking. Let me know thoughts.

general

This is to avoid repetition between higher and lower level modules.

detector module

Initially I wasn't sure if it would be too much nesting (mainly wanted to try). But I think it leaves the crabs.detector level a bit more clear at a glance. It may help writing unit tests too.

tracker module

In the tracker module I did some more substantial changes. I tried to follow the structure of crabs.detector.

other

I think having a separate config is a good idea!

I also changed the entry points name for the tracker to something a bit more explicit (albeit longer): detect-and-track-video.

I did my best but I am les familiar with the tracking bits, so there may be fixes required in the tracking 🙈

nikk-nikaznan commented 5 months ago

Thank you Sofia! Looking good. I just fixed some tracking bits that throw error. I am happy with the new name convention, I just tried to follow the module name as in the issue, but have no strong opinion on either. The only thing, can we not rename optuna_util as optuna? We can either do _optuna or hyperparameter_optimizer or hpo?