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

Fix the schema for keypoint detection in workflows #946

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

shantanubala
Copy link
Contributor

@shantanubala shantanubala commented Jan 14, 2025

Description

This PR fixes what appears to be a bug in keypoint detection models used in Workflows using keypoint detection models due to the naming conventions in inference - here is a screen recording of the bug:

workflow-keyp.mp4

It appears that we use class_name and class_id naming conventions in most cases, but the base KeypointsDetectionBaseOnnxRoboflowInferenceModel uses class and class_id instead.

Error message:

{
  "error": "Failed to assemble `model_predictions`. Could not successfully use any deserializer for declared kinds. Details: \nKind: `keypoint_detection_prediction` - Error: 'class_name'",
  "inner_error": "None"
}

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How has this change been tested, please provide a testcase or example of how you tested the change?

I need some help here - I'm not 100% sure what might be depending on the old schema, or whether this change to the object will break downstream code.

Any specific deployment considerations

Will this break anything depending on this old schema?

Docs

N/A

@shantanubala shantanubala deleted the sb/fix-keypoints-workflow branch January 14, 2025 20:21
@shantanubala shantanubala restored the sb/fix-keypoints-workflow branch January 14, 2025 20:21
@shantanubala shantanubala reopened this Jan 14, 2025
@@ -227,7 +227,7 @@ class Keypoint(Point):
description="Model confidence regarding keypoint visibility."
)
class_id: int = Field(description="Identifier of keypoint.")
class_name: str = Field(field="class", description="Type of keypoint.")
class_name: str = Field(alias="class", description="Type of keypoint.")
Copy link
Contributor Author

@shantanubala shantanubala Jan 14, 2025

Choose a reason for hiding this comment

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

@PawelPeczek-Roboflow You likely know more about what is happening here much better than I do - I couldn't figure out why this was field= instead of alias=, but this adjustment seems to more closely match the data we are actually passing around.

Do you foresee any unintended consequences of making this change? I might also be completely wrong in my approach to fixing this bug, would appreciate your input 🙏

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.

1 participant