-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix: process one image at a time with Gemini #648
Conversation
2042727
to
a74e9e8
Compare
a74e9e8
to
697cc8a
Compare
res = extract_from_price_tags(sample_files) | ||
return Response(res, status=status.HTTP_200_OK) | ||
labels = [extract_from_price_tag(sample_file) for sample_file in sample_files] | ||
return Response({"labels": labels}, status=status.HTTP_200_OK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the response changes ? so that we change the frontend integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The response is exactly the same, no? The Labels
TypedDict doesn't exist anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind, no changes :)
) | ||
return json.loads(response.text) | ||
|
||
|
||
def extract_from_price_tags(images: Image.Image) -> Labels: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I re-added the previous function + added a warning: d813e0d
Gemini sometimes skips some images when prediction price tag labels, leading to mismatch between price tag and predictions.
We process here one price tag at a time, preventing this from happening.