Skip to content

genmedia-for-commerce: classifier matches look items by details; attached pins stay; look-crop shoes carry their upload - #2874

Merged
giuliosalierno merged 1 commit into
mainfrom
genmedia-for-commerce-classifier-items
Nov 6, 2026
Merged

giuliosalierno merged 1 commit into
mainfrom
genmedia-for-commerce-classifier-items

Conversation

@lspataroG

Copy link
Copy Markdown
Collaborator

Summary

  • Classifier: a look item counts as the same product as an upload only when its colour, material and details match; for a photo of its product alone it lists no other items.
  • Pins, charms and badges attached to a product are part of it and stay on it in the try-on.
  • Shoes whose main image is a crop of the look photo also get their uploaded product photo on the card.

…tails; attached pins stay; look-crop shoes carry their upload

@giuliosalierno giuliosalierno left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@giuliosalierno
giuliosalierno merged commit 64f61c6 into main Nov 6, 2026
36 checks passed
@giuliosalierno
giuliosalierno deleted the genmedia-for-commerce-classifier-items branch November 6, 2026 11:43

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Hygiene review — 1 finding(s).


Round 1 · 0 of this PR's 25 automated comments used · this round is capped at 20 across all reviewers.

tiers = [hero.pick(p, None, c, PHOTOS[:3])[0] for p in (coat, bag)]
assert tiers == ["fallback", "fallback"]
tiers = [hero.pick(p, None, c, PHOTOS[:4])[0] for p in (coat, bag)]
assert tiers == ["fallback", "flat"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MINOR] The test name says a flat photo that does not list its product is no hero, but line 1059 now asserts a flat hero for the bag. Can we update the test name to match what is being tested?

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Maintainability review — 3 finding(s).


Round 1 · 0 of this PR's 25 automated comments used · this round is capped at 20 across all reviewers.

ITEMS = (
'ITEMS: for every photo, "items" lists every product shown whole inside '
"the frame, one entry per product: garments, shoes, bags, hats, glasses, "
'ITEMS: "items" is [] for a photo of its product alone, nothing else '

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MINOR] Can we extract ITEMS as a constant in classify_prompt.py and import it here? It duplicates the prompt definition verbatim.

if not front:
return []
image = front[0].image
return [Detail("photo", "", "front", "", image, name="product photo")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MINOR] use closeups.PHOTO here instead

return long >= MIN_HERO_SIDE and short >= MIN_HERO_SHORT_SIDE


def product_photo(p: Product) -> list[Detail]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MINOR] Perhaps this should be shoe_product_photo? It returns an empty list for any category other than "footwear".

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.

2 participants