Skip to content
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

Add skeleton support for native functions #9122

Merged
merged 2 commits into from
Mar 4, 2025

Conversation

SpecLad
Copy link
Contributor

@SpecLad SpecLad commented Feb 19, 2025

Motivation and context

All of the support code in the auto-annotation SDK layer is already there, we just need to send sublabel information when creating a native function, and validate it when running an agent.

In addition, force keypoint sublabel types to be "points", since this is how the UI creates them for tasks/projects.

How has this been tested?

Tests will be added in the private repository.

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • [ ] I have linked related issues (see GitHub docs)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

All of the support code in the auto-annotation SDK layer is already there,
we just need to send sublabel information when creating a native function,
and validate it when running an agent.

In addition, force keypoint sublabel types to be "points", since this is how
the UI creates them for tasks/projects.
@SpecLad SpecLad marked this pull request as ready for review February 28, 2025 14:22
@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 73.30%. Comparing base (cb7306b) to head (9515ee4).
Report is 20 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9122      +/-   ##
===========================================
- Coverage    73.83%   73.30%   -0.53%     
===========================================
  Files          431      448      +17     
  Lines        44804    45870    +1066     
  Branches      3892     3915      +23     
===========================================
+ Hits         33081    33626     +545     
- Misses       11723    12244     +521     
Components Coverage Δ
cvat-ui 77.05% <ø> (-0.48%) ⬇️
cvat-server 70.30% <0.00%> (-0.49%) ⬇️

raise CriticalError(
incompatible_msg + f"{attr_desc} has values {remote_attr['values']!r},"
f" but the function object declares values {attr.values!r}."
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way for the users to get notified that their function definition uses some unknown labels or attributes? If some annotations are silently ignored, it doesn't look really convenient to me. Maybe it's better to show some warning for ignored labels and attributes on agent startup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean the case where the local function has a label/sublabel/attribute that the remote function doesn't? At the moment I don't have any notifications for this case. My thinking was that since the end user only sees the remote function's labels, from their perspective everything will work as expected, even if the behind-the-scenes function object supports some extra labels.

That said, I'm not opposed to adding the warnings you propose; but I think it goes beyond the scope of this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this case. I think it should be added to avoid unexpectedly missing annotations in the case a label is renamed in the function implementation. Agree that it can be done in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FWIW, if a label is renamed, that implies that there is a remote label with no corresponding local label, in which case the agent will abort.

Copy link

sonarqubecloud bot commented Mar 4, 2025

@SpecLad SpecLad merged commit a5dda6c into cvat-ai:develop Mar 4, 2025
34 checks passed
@SpecLad SpecLad deleted the agent-skeletons branch March 4, 2025 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants