Skip to content

Feat: Annotate Directory of Images #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 3, 2025
Merged

Feat: Annotate Directory of Images #243

merged 9 commits into from
Jul 3, 2025

Conversation

JSabadin
Copy link
Contributor

@JSabadin JSabadin commented May 30, 2025

Purpose

This feature annotates a directory of images by performing predictions with a model and creating a dataset in LDF from those predictions.

A new command annotate is added to the CLI, and you can also use it via model.annotate(...).

The annotate functionality uses the config YAML file where the model is defined, and performs inference on the given image directory. For example, if a user defines a detection head like this:

nodes:
  ...
  - name: EfficientBBoxHead
    params:
      download_weights: False
      initialize_weights: True
      conf_thres: 0.03
      iou_thres: 0.65
    inputs:
      - RepPANNeck
  ...

The annotate process will use the conf_thres value of 0.03 and iou_thres of 0.65 when performing Non-Maximum Suppression (NMS) for that head.

By default, annotate supports all built-in luxonis-train tasks. If the head operates in a way that's aligned with these default tasks, it will work out of the box since the base head is designed for compatibility.

However, if custom post-processing of labels is needed, the user must implement their own annotate function for the head. In such a case, the user can apply any custom filtering logic to the model outputs.

Specification

None / not applicable

Dependencies & Potential Impact

None / not applicable

Deployment Plan

None / not applicable

Testing & Validation

None / not applicable

@JSabadin JSabadin requested a review from a team as a code owner May 30, 2025 10:21
@JSabadin JSabadin requested review from kozlov721, klemen1999, tersekmatija and conorsim and removed request for a team May 30, 2025 10:21
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request CLI Changes affecting the CLI labels May 30, 2025
Copy link
Collaborator

@tersekmatija tersekmatija left a comment

Choose a reason for hiding this comment

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

Do we have some example usage?

Is it possible to configure also "post-processing" parameters like confidence, IoU threshold, ...? I assume that's defined through the architecture itself?

@JSabadin
Copy link
Contributor Author

JSabadin commented Jun 3, 2025

Do we have some example usage?

Is it possible to configure also "post-processing" parameters like confidence, IoU threshold, ...? I assume that's defined through the architecture itself?

@tersekmatija Model outputs can be grouped into common task types. That’s why there is a single annotate() function for the base head, which works with luxonis-train task types. For custom tasks, users can implement their own annotate() function for the head.

Regarding the parameters you mentioned: they are configured in the YAML config. However, for some custom parameters, users can modify their annotate() function to perform additional processing.

@kozlov721 kozlov721 merged commit 140e918 into main Jul 3, 2025
8 checks passed
@kozlov721 kozlov721 deleted the feat/annotate branch July 3, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Changes affecting the CLI documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants