Skip to content

New tool: Edit Coco Annotation#1889

Open
TuturBaba wants to merge 20 commits into
bgruening:masterfrom
TuturBaba:edit_coco
Open

New tool: Edit Coco Annotation#1889
TuturBaba wants to merge 20 commits into
bgruening:masterfrom
TuturBaba:edit_coco

Conversation

@TuturBaba

Copy link
Copy Markdown
Contributor

Features

  • Filters and renames tracks in a COCO JSON annotation file produced by SAM3 or any COCO-format
    • Mode Keep: only the listed track IDs are kept; all others are removed (+ optional: rename | frame_min | frame_max)
    • Mode Remove: only the listed track IDs are deleted; everything else is kept (+ optional: frame_min | frame_max)
    • Mode Rename: all tracks are kept, but listed IDs receive a new category name

Tests

Test 1: keep mode — keep track IDs 2, 4–6 and track ID 1 renamed to "Algae"
Test 2: remove mode — remove track ID 1 from frame 130 onwards
Test 3: rename mode — rename track ID 1 to "Algae" and track IDs 2–6 to "Crangon crangon"

@TuturBaba TuturBaba changed the title Add files via upload New tool: Edit Coco Annotation Jun 9, 2026
TuturBaba added 5 commits June 9, 2026 15:24
… tools/image_processing/yolo/test-data/Annotation_COCO_visualizer.json
…n to tools/image_processing/yolo/test-data/Edited_COCO_annotations_remove.json
…n to tools/image_processing/yolo/test-data/Edited_COCO_annotations_rename.json
@TuturBaba

Copy link
Copy Markdown
Contributor Author

Hi if you can add skip-version-check pls

@SaimMomin12

Copy link
Copy Markdown
Collaborator

@TuturBaba

+Linting tool /home/runner/work/galaxytools/galaxytools/tools/image_processing/yolo/edit_coco_annotation.xml
Failed linting
.. CHECK (TestsNoValid): 3 test(s) found.
.. INFO (OutputsNumber): 1 outputs found.
.. INFO (InputsNum): Found 11 input parameters.
.. CHECK (HelpPresent): Tool contains help section.
.. CHECK (HelpValidRST): Help contains valid reStructuredText.
.. CHECK (ToolIDValid): Tool defines an id [edit_coco_annotation].
.. CHECK (ToolNameValid): Tool defines a name [Edit COCO Annotation].
.. CHECK (ToolProfileValid): Tool specifies profile version [25.1].
.. CHECK (ToolVersionValid): Tool defines a version [1.0.0].
.. INFO (CommandInfo): Tool contains a command.
.. WARNING (CitationsMissing): No citations found, consider adding citations to your tool.

@TuturBaba

Copy link
Copy Markdown
Contributor Author

For me It's fine

@@ -0,0 +1,208 @@
<tool id="edit_coco_annotation" name="Edit COCO Annotation" version="1.0.0" profile="25.1">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<tool id="edit_coco_annotation" name="Edit COCO Annotation" version="1.0.0" profile="25.1">
<tool id="edit_coco_annotation" name="Edit COCO Annotation" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">

Please use the above tokens

@TuturBaba TuturBaba Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but why?
If I use this method, I need to add the following block ?

<macros>
    <token name="@TOOL_VERSION@">1.0.0</token>
    <token name="@VERSION_SUFFIX@">0</token>
    <token name="@PROFILE@">25.1</token>
</macros>

Doesn't that come down to the same thing in the end?

@TuturBaba TuturBaba Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @SaimMomin12,
Should I also apply these changes to my new tool that was merged yesterday (so not yet available on Galaxy)?
#1892

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TuturBaba maybe we did a mistake here. Are those coco tool in anyway related to YOLO?

We group Galaxy tools together into so called tool-suites. Those tools share functionality/parameters/requirements and are located in one folder.

That is why we usually have the same version number, same profile etc.

Comment thread tools/image_processing/yolo/edit_coco_annotation.xml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants