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

Finalize keypoint detection #174

Merged
merged 6 commits into from
Dec 11, 2023
Merged

Finalize keypoint detection #174

merged 6 commits into from
Dec 11, 2023

Conversation

SolomonLake
Copy link
Contributor

@SolomonLake SolomonLake commented Dec 6, 2023

Description

Updates keypoint detection to match with what is being sent from dataset/weights routes. Also adds validation for num_classes.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

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

Tested running local inference server for one keypoints detection model and one OD model.

Any specific deployment considerations

None.

Docs

  • Docs updated? What were the changes:

@@ -35,6 +35,7 @@
"object-detection": "yolov5v2s",
"instance-segmentation": "yolact",
"classification": "vit",
"keypoint-detection": "yolov8n",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

most changes are keypoints-detection -> keypoint-detection, but this was a necessary addition to make sure model manager accepts type.

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@SolomonLake SolomonLake marked this pull request as ready for review December 7, 2023 16:28
num_classes = get_num_classes_from_model_prediction_shape(
len_prediction=output_shape[2], keypoints_shape=keypoints_shape
)
try:
Copy link
Collaborator

Choose a reason for hiding this comment

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

if num_classes != self.num_classes:
    raise ValueError()

assert keypoints_count == 17


def test_superset_keypoints_count_with_two_classes():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggestion:
Return type: -> None:

given-when-then

# given
keypoints_metadata = ...

# when
keypoints_count = superset_keypoints_count(keypoints_metadata)

# then
assert keypoints_count == 13, "Keypoints of object 1 form a superset of all classes"

Would be also good to cover the behaviour when classes do not overlap

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added, going to merge after build succeeds as changes were straightforward.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, maybe I need another review? merging is blocked

Copy link
Collaborator

@PawelPeczek-Roboflow PawelPeczek-Roboflow left a comment

Choose a reason for hiding this comment

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

:+1

@SolomonLake SolomonLake merged commit 37d885d into main Dec 11, 2023
5 checks passed
@SolomonLake SolomonLake deleted the finalize-keypoint-detection branch December 11, 2023 18:50
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.

2 participants