Skip to content

fix(api): correct slide_match call in FastAPI server#308

Open
felixtsu wants to merge 1 commit intosml2h3:masterfrom
felixtsu:fix/api-slide-match-kwargs
Open

fix(api): correct slide_match call in FastAPI server#308
felixtsu wants to merge 1 commit intosml2h3:masterfrom
felixtsu:fix/api-slide-match-kwargs

Conversation

@felixtsu
Copy link
Copy Markdown

Summary

The /slide_match endpoint in ddddocr/api/app.py called DdddOcr.slide_match with keyword arguments target_bytes and background_bytes, which do not exist on slide_match (the API uses target_img / background_img as the first two positional parameters). This caused a TypeError at runtime when hitting the endpoint.

Also removed the flag= argument, which is not accepted by slide_match anywhere in the stack.

Change

Align the call with routes.py / mcp.py: pass decoded image bytes positionally and only forward simple_target.

The flag field remains on SlideMatchRequest for request-schema compatibility; it is simply not passed through until the library defines behavior for it.

Made with Cursor

DdddOcr.slide_match expects positional target_img/background_img (or
compatible positional bytes). Using target_bytes/background_bytes caused
TypeError at runtime; flag is not supported by slide_match and was removed
from the call.

Made-with: Cursor
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.

1 participant