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

Support all detector modes #95

Merged
merged 16 commits into from
Oct 4, 2024
Merged

Support all detector modes #95

merged 16 commits into from
Oct 4, 2024

Conversation

CoreyEWood
Copy link
Contributor

@CoreyEWood CoreyEWood commented Oct 4, 2024

Add support to the edge endpoint for all detector modes. Adds some basic tests to ensure responses are being parsed correctly.

@CoreyEWood CoreyEWood marked this pull request as ready for review October 4, 2024 21:35
Copy link
Member

@robotrapta robotrapta left a comment

Choose a reason for hiding this comment

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

Looks about right to me.

for i, roi in enumerate(rois):
geometry = rois[i]["geometry"]
# TODO add validation to calculate x and y automatically
x = 0.5 * (geometry["left"] + geometry["right"])
Copy link
Member

Choose a reason for hiding this comment

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

Why are we calculating the centers here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ImageQuery model from the SDK requires x and y to be specified. Tyler thinks there's a way to get pydantic to do this automatically, but for now this seems easiest.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah apparently Avi asked for the sdk to return the centers of the bboxes as well as left, top, right, bottom coordinates. Tim likes this too.


if multi_predictions is not None and predictions is not None:
raise ValueError("Got result with both multi_predictions and predictions.")
if multi_predictions is not None:
Copy link
Member

Choose a reason for hiding this comment

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

What's a "multi_prediction"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the field where multiclass/counting results are returned through.

@CoreyEWood CoreyEWood merged commit f432a0c into main Oct 4, 2024
6 checks passed
@CoreyEWood CoreyEWood deleted the corey/support-new-modes branch October 4, 2024 23:22
Copy link
Collaborator

@brandon-groundlight brandon-groundlight left a comment

Choose a reason for hiding this comment

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

I'm late to the party, this is great support for secondary predictions, but we'll eventually need to return to this to fully support the detector mode architecture

image_query = create_iqe(
detector_id=detector_id,
result_type=result_type,
label=results["label"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is going to change soon, you'll need to populate this field according to the mode type

@@ -25,15 +28,15 @@ def create_iqe(
created_at=datetime.utcnow(),
query=query,
detector_id=detector_id,
result_type=ResultTypeEnum.binary_classification,
result_type=result_type,
result=BinaryClassificationResult(
Copy link
Collaborator

Choose a reason for hiding this comment

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

We'll need to use a different type here for counting modes

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.

4 participants