Added napari plugin for reviewing and correcting bounding box annotations#144
Open
GauravSRC wants to merge 5 commits into
Open
Conversation
…ns (issue neuroinformatics-unit#9) - ethology/napari/_reader.py – napari reader: COCO/VIA file → Shapes layer - ethology/napari/_writer.py – napari writer: Shapes layer → COCO file - ethology/napari/widgets.py – magicgui widget (load + save panel) - ethology/napari/napari.yaml – plugin manifest (reader, writer, widget) - pyproject.toml – napari entry-point, optional deps, package-data - tests/test_unit/test_napari/test_reader.py - tests/test_unit/test_napari/test_writer.py (incl. round-trip tests) - tests/test_unit/test_datasets/test_split.py (placeholder)
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #144 +/- ##
===========================================
- Coverage 99.45% 78.85% -20.60%
===========================================
Files 8 11 +3
Lines 554 719 +165
===========================================
+ Hits 551 567 +16
- Misses 3 152 +149 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #9.
Adds a napari plugin to ethology so that automatically generated bounding
box annotations can be loaded into napari, manually reviewed and corrected,
and then exported back to a COCO JSON file.
Changes
New package –
ethology/napari/_reader.pyxr.Datasetto a napari Shapes layer (one rectangle per bounding box, coloured bycategory_id)._writer.pysave_bboxes.to_COCO_file. Onlyrectangleshapes are exported; non-rectangle shapes are silently skipped.widgets.pymake_correction_widget– amagicgui-based container with two panels: Load annotations (file picker + format selector) and Save corrected annotations (output file picker).napari.yamlpyproject.toml[project.entry-points."napari.manifest"]for plugin discovery.naparioptional-dependency group (napari>=0.4.19,magicgui,qtpy).[tool.setuptools.package-data]sonapari.yamlis included in the sdist.Tests
tests/test_unit/test_napari/test_reader.py– unit tests for formatdetection,
napari_get_reader,_reader_function, and shape geometrycorrectness.
tests/test_unit/test_napari/test_writer.py– unit tests for_shapes_to_dataset,write_shapes, and two full round-trip tests(annotation count + coordinate fidelity).
tests/test_unit/test_datasets/test_split.py– placeholder for futuredataset-splitting tests.
How to test manually
Notes
those will be added in a follow-up using
pytest-qt.test_split.pyis a placeholder; the split implementation is trackedseparately.