quantumjot / btrack

Bayesian multi-object tracking
https://btrack.readthedocs.io
MIT License
310 stars 50 forks source link

Show progress bar in plugin when running tracking #358

Closed p-j-smith closed 1 year ago

p-j-smith commented 1 year ago

Fixes #271

https://github.com/quantumjot/btrack/assets/29753790/574ff4af-5adb-4062-b383-6f2ab5391094

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 33.33% and project coverage change: -0.45% :warning:

Comparison is base (392fbb8) 86.11% compared to head (6ea7da8) 85.67%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #358 +/- ## ========================================== - Coverage 86.11% 85.67% -0.45% ========================================== Files 30 30 Lines 2125 2143 +18 Branches 394 394 ========================================== + Hits 1830 1836 +6 - Misses 214 226 +12 Partials 81 81 ``` | [Files Changed](https://app.codecov.io/gh/quantumjot/btrack/pull/358?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alan+R+Lowe) | Coverage Δ | | |---|---|---| | [btrack/napari/main.py](https://app.codecov.io/gh/quantumjot/btrack/pull/358?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alan+R+Lowe#diff-YnRyYWNrL25hcGFyaS9tYWluLnB5) | `66.15% <29.41%> (-4.29%)` | :arrow_down: | | [btrack/io/\_localization.py](https://app.codecov.io/gh/quantumjot/btrack/pull/358?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alan+R+Lowe#diff-YnRyYWNrL2lvL19sb2NhbGl6YXRpb24ucHk=) | `90.43% <50.00%> (-1.53%)` | :arrow_down: |

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

deprecated-napari-hub-preview-bot[bot] commented 1 year ago

Preview page for your plugin is ready here: https://preview.napari-hub.org/quantumjot/btrack/358 Updated: 2023-08-03T14:04:25.337908

quantumjot commented 1 year ago

This is so simple and so awesome!

p-j-smith commented 1 year ago

This is so simple and so awesome!

Yeah it's surprisingly straightforward!

Do you want to see nested progress bars when running segmentation_to_objects:

https://github.com/quantumjot/btrack/assets/29753790/c465e529-5977-41d1-a300-547cf968ec06

As far as I can tell, you're not using tqdm for the tracking BayesianTracker.track? But if you were we could show more fine-grained progress for that step too

quantumjot commented 1 year ago

Do you want to see nested progress bars

Yes - I think any feedback to the user that something is happening is very useful.

As far as I can tell, you're not using tqdm for the tracking

This would be a pretty simple change and probably be quite beneficial.

p-j-smith commented 1 year ago

Yes - I think any feedback to the user that something is happening is very useful.

Okay cool, I've added that now.

This would be a pretty simple change and probably be quite beneficial.

To get the progess bar to show in napari, all you would need to do is change the tqdm import to be like this:

https://github.com/quantumjot/btrack/blob/a60435083d01078d17fdf2f0876ede45ee99c3cb/btrack/io/_localization.py#L13-L16

napari.utils.progress inherits from tqdm.tqdm and it will display the progress bar in the activity dock if napari is open or in the terminal if not