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

feat(ProofMl): extract product_name and suggest ean-13 barcodes #646

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion open_prices/proofs/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class Label(typing.TypedDict):
unit: Unit
organic: bool
barcode: str
product_name: str


class Labels(typing.TypedDict):
Expand Down Expand Up @@ -182,7 +183,7 @@ def extract_from_price_tags(images: Image.Image) -> Labels:
f"Here are {len(resized_images)} pictures containing a label. "
"For each picture of a label, please extract all the following attributes: "
"the product category matching product name, the origin category matching country of origin, the price, "
"is the product organic, the unit (per KILOGRAM or per UNIT) and the barcode. "
"is the product organic, the unit (per KILOGRAM or per UNIT) and the barcode (valid EAN-13 usually). "
f"I expect a list of {len(resized_images)} labels in your reply, no more, no less. "
"If you cannot decode an attribute, set it to an empty string"
)
Expand Down
Loading