Skip to content

Use response dimensions for hosted image predictions - #592

Open
gezerui888 wants to merge 1 commit into
roboflow:mainfrom
gezerui888:fix/hosted-prediction-image-dimensions
Open

gezerui888 wants to merge 1 commit into
roboflow:mainfrom
gezerui888:fix/hosted-prediction-image-dimensions

Conversation

@gezerui888

Copy link
Copy Markdown

What does this PR do?

For image URLs, InferenceModel.predict returned "Undefined" for both dimensions even when the server supplied them. I now use the dimensions in the response. This covers instance segmentation, semantic segmentation, and trained models that call the shared predict method. Local files supply their own dimensions. A missing dimension still returns "Undefined".

Related Issue(s): Fixes #144.

Type of Change

  • Bug fix

Testing

  • I have tested this change locally
  • I have added/updated tests for this change

I checked a hosted response with dimensions, a response without image metadata, and a local file with dimensions different from the response. The full unittest suite ran 1,295 tests with one skip. All 50 slim-install tests passed on Python 3.10.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have updated the documentation accordingly (if applicable)

Additional Context

Ruff and mypy passed on all 79 source files.

cc @tonylampada

This branch has not been deployed

No deployments
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.

predict() for URLs sets image_dims to "Undefined"

1 participant