Repository navigation
Encode object detection class filters in inference URLs - #568
Draft
Kayvan-Zahiri wants to merge 1 commit into
Draft
Kayvan-Zahiri wants to merge 1 commit into
Kayvan-Zahiri wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
URL-encode the object detection
classesquery value before concatenating it into the inference URL. A filter such asfish&chipspreviously became multiple parameters,c++became spaces,part#1became a URL fragment (also losing the hosted image parameter), andclass%2Bnamewas decoded before reaching the server. Encoding once preserves the caller's literal value, including the existing comma-separated filter syntax.Related Issue(s): No matching existing issue found.
Type of Change
Testing
Test details: A public
ObjectDetectionModel.predict()regression makes intercepted HTTP requests using six class filters, supplied either at construction or per call (12 subcases). Eight special-character subcases fail before the fix; the ordinary and comma-separated controls pass. All pass afterward, and the complete parsed request parameters are checked to catch truncation or unintended parameters.python -m unittest: 1,269 tests run, OK, one skipped.make style: 79 source files already formatted; Ruff passes.make check_code_quality: format/lint pass; mypy reports no issues in 79 source files.git diff --check: pass.Python 3.12.12 on macOS, prescribed editable
[dev]dependencies and repository-pinned Ruff 0.15.10. Initial sandbox run could not bind local test servers and one existing test needed network access; rerunning the full unchanged suite with the necessary access passes. New regression HTTP calls are intercepted byresponses. No real API key, hosted model deployment or credentialed inference was used. The Python/OS matrix and optional model/HEIC extras were not exercised. Existing suite emits resource warnings.Checklist
Additional Context
Developed with Codex assistance and reproduced locally.