Skip to content

Added Confidence Argument to keypoint detection model #354

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

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

Conversation

Greenstan
Copy link

@Greenstan Greenstan commented Jan 20, 2025

Description

A new "Confidence" argument has been added to the keypoint detection model (based on the confidence argument found in the object detection model)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

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

A Dedicated keypoint detection model test file has been made with multiple test cases including one where the confidence is changed

Any specific deployment considerations

Docs

@CLAassistant
Copy link

CLAassistant commented Feb 4, 2025

CLA assistant check
All committers have signed the CLA.

@Greenstan Greenstan requested a review from SolomonLake June 5, 2025 18:17
@Greenstan Greenstan requested a review from SolomonLake July 4, 2025 17:12
Copy link
Contributor

@SolomonLake SolomonLake left a comment

Choose a reason for hiding this comment

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

can you make sure you are running the tests locally using python3 -m unittest (or python) from the root of repo?

You can see test failures here: https://github.com/roboflow/roboflow-python/actions/runs/16078304796/job/45497459911?pr=354

I left suggested fixes which are all going to be necessary.

load_dotenv(Path("../../.env"))


with open(Path("../annotations/keypoint-detection-annotations/MM2A_46_R_T_predictions.json")) as f:
Copy link
Contributor

Choose a reason for hiding this comment

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

tests get run from root -- can you update:

Suggested change
with open(Path("../annotations/keypoint-detection-annotations/MM2A_46_R_T_predictions.json")) as f:
with open(Path("tests/annotations/keypoint-detection-annotations/MM2A_46_R_T_predictions.json")) as f:



class TestKeypointDetection(unittest.TestCase):
api_key = os.getenv("ROBOFLOW_API_KEY")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
api_key = os.getenv("ROBOFLOW_API_KEY")
api_key = os.getenv("ROBOFLOW_API_KEY", "test-api-key")


responses.add(responses.POST, self.api_url, json=MOCK_RESPONSE, status=200)

result = instance.predict("/roboflow-python/tests/images/MM2A_46_R_T.png")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
result = instance.predict("/roboflow-python/tests/images/MM2A_46_R_T.png")
result = instance.predict("tests/images/MM2A_46_R_T.png")

and change the other .png references too


responses.add(responses.POST, self.api_url, json={"error": "Invalid API key"}, status=401)

with self.assertRaises(HTTPError):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
with self.assertRaises(HTTPError):
with self.assertRaises(Exception):

do this to avoid failing test

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