- Add Honda client with static_general and video_general profiles - Add video QC capability using Gemini native video analysis (4 checks: visual_quality, brand_consistency, text_legibility, pacing_flow) - Add video_general profile assigned to all 8 clients - Extend session lifetime with MSAL silent token refresh (proactive every 45min + reactive on expiry), switch cache to localStorage - Re-enable OCR layout measurements for Amazon checks - Add scope boundary notes to all 6 Amazon checks to prevent cross- check penalization (locale errors isolated to logo_country only) - Relax margins left-alignment tolerance from 1% to 4% to account for logo lockup internal padding - Update brand guidelines DB with Amazon localization matrix and processed Dove PDF summary Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
138 lines
9 KiB
Python
138 lines
9 KiB
Python
import os
|
|
import sys
|
|
|
|
# Add parent directory to path to import shared modules
|
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
|
|
|
from visual_qc_apps.flask_app_template import FlaskAppTemplate
|
|
|
|
class AmazonElementPlacementApp(FlaskAppTemplate):
|
|
"""
|
|
Amazon ASD 2025 - Element Placement & Cropping Check
|
|
Verifies element positioning (box, bag, logo) and cropping rules.
|
|
"""
|
|
|
|
def __init__(self):
|
|
prompt = """You are performing a visual quality-control check on an Amazon marketing asset. Your task is to verify that the Amazon branded box (or bag) is correctly positioned and that cropping rules are followed.
|
|
|
|
IMPORTANT — SCOPE BOUNDARY: This check evaluates ONLY element positioning and cropping. Do NOT penalise for locale/country errors (wrong URL, wrong language) — those are evaluated by the separate amazon_logo_country check. If the logo on the box shows the wrong country URL, that is NOT a placement/cropping issue. Score based on physical positioning and cropping rules only.
|
|
|
|
AMAZON BOX DESCRIPTION:
|
|
The "box" is Amazon's primary branded graphic element — a cardboard delivery box shown at a 3D angle with the Amazon smile logo on its front face.
|
|
|
|
WHAT IS THE "TAPE":
|
|
The tape refers to the branded coloured strips/flaps that seal the box. These are NOT plain packing tape — they are branded elements that are a different colour from the cardboard (typically blue, teal, or another campaign colour). They appear as coloured strips visible on the edges/corners of the box where the flaps fold over. The tape often has small text or branding on it (like "prime" text).
|
|
|
|
HOW TO IDENTIFY THE TAPE:
|
|
- Look for coloured (non-cardboard-coloured) strips on the TOP and RIGHT edges of the box
|
|
- They contrast with the brown/tan cardboard — they are a distinctly different colour
|
|
- They appear where the box flaps fold over the sides
|
|
- In many campaign assets, you can see these coloured strips on 2-3 visible edges of the box
|
|
|
|
IMPORTANT: If you can see coloured branded strips on the box edges (even if small or at an angle due to perspective), the tape IS visible. Only flag tape as "not visible" if:
|
|
1. The box is cropped by the asset edge and the tape area is cut off, OR
|
|
2. The box graphic genuinely has no coloured strips/flaps at all (plain cardboard box with no branded tape elements)
|
|
|
|
In some digital display formats, a Paper BAG may be used instead of the box.
|
|
|
|
BOX POSITIONING RULES:
|
|
|
|
1. PLACEMENT:
|
|
- For LANDSCAPE and SQUARE formats: The box should be positioned on the RIGHT SIDE of the layout.
|
|
- For TALL/PORTRAIT formats (where height is significantly greater than width): The box may sit in the CENTRE or CENTRE-RIGHT of the layout. This is acceptable because tall formats stack elements vertically, and the box naturally sits in the lower portion of the composition. Do NOT penalise a centred box in tall/portrait formats.
|
|
- The key principle is that the box should be balanced within the composition with comfortable spacing between margins and text elements.
|
|
|
|
2. SPACING: There should be appropriate space between the headline, box, and other text elements. The box should sit comfortably within the composition.
|
|
|
|
3. HEADLINE INTERACTION: Small amounts of interaction/layering between the box and the headline are acceptable — the box can cover small parts of the headline. However:
|
|
- The overlap must NOT create awkward tangents or tiny slivers
|
|
- The legibility of the headline is ALWAYS the priority
|
|
- The box should NOT cover any elements OTHER than the headline (never cover subhead, date, legal line)
|
|
|
|
BOX CROPPING RULES:
|
|
|
|
ALLOWED:
|
|
- A crop of the right side of the box body is acceptable — for example, the right edge of the cardboard box extending beyond the asset boundary. This is common and expected in landscape/wide formats.
|
|
- The box sitting close to or touching the right edge of the asset is normal positioning, not a cropping issue.
|
|
|
|
NOT ALLOWED (these are genuine failures):
|
|
- The bottom of the box must not be cropped by the asset boundary.
|
|
- The left side of the box (the main face with the smile logo) must not be cropped.
|
|
- An extremely aggressive crop that removes the ENTIRE top of the box, making the box unrecognisable as a box shape, is not acceptable.
|
|
|
|
TAPE/FLAP VISIBILITY — EVALUATE CAREFULLY:
|
|
The tape/flaps are coloured strips that appear on the edges of the box. They are branded design elements that must be handled correctly.
|
|
|
|
CRITICAL RULE — TAPE CROPPED BY ASSET EDGE IS A FAIL:
|
|
If ANY tape/coloured strip is being CUT OFF by the asset boundary (i.e. the tape starts but is truncated where it meets the edge of the image), this is a FAIL. The tape is a branded element and must not be cropped by the asset edge.
|
|
|
|
How to distinguish cropped tape from hidden tape:
|
|
- CROPPED (FAIL): You can see a coloured strip/tape that runs toward the edge of the asset and is TRUNCATED — it clearly continues beyond the image boundary. The tape is cut off mid-way.
|
|
- HIDDEN BY PERSPECTIVE (OK): Due to the 3D angle, tape on a far edge is foreshortened, small, or not visible because of the box's orientation. This is geometry, not cropping.
|
|
|
|
How to evaluate:
|
|
1. Look at EACH visible edge of the box. For each edge where tape/coloured strips are visible, check: does the tape extend to the asset boundary and get cut off? If YES on any edge → tape is cropped → FAIL.
|
|
2. If the box sits near the right edge of a landscape format, check specifically whether the right-side tape is being cut off by the asset boundary. A box body extending past the edge is acceptable, but tape being cut off is not.
|
|
3. If tape is fully visible on all visible edges (no truncation at asset boundaries), this is a PASS.
|
|
4. Due to 3D perspective, tape on some edges may appear foreshortened or not visible because of the viewing angle — this is NORMAL and not a cropping issue.
|
|
5. Only flag tape as "not visible" if the box genuinely has no coloured strips/flaps at all.
|
|
|
|
COMMON FALSE POSITIVE TO AVOID: Do NOT fail a box just because it sits close to the right edge of a landscape asset. The box BODY extending beyond the asset edge is acceptable. Only fail if the TAPE specifically is being cut off by the edge.
|
|
|
|
SMALL FORMAT RULES:
|
|
- If one side of the banner is smaller than 49 pixels: Use the Amazon logo (white) without the box.
|
|
- Do NOT place the logo outside the margins.
|
|
|
|
BAG RULES (Digital Display Only):
|
|
- The bag should NEVER be cropped under any circumstance.
|
|
- The bag should NOT cover any headline text.
|
|
|
|
STEPS TO EVALUATE:
|
|
1. Identify the box (or bag) element in the layout
|
|
2. Determine the format type: is this a landscape, square, or tall/portrait format?
|
|
3. Check positioning based on format type (right side for landscape/square, centre or centre-right acceptable for tall/portrait)
|
|
4. Check cropping:
|
|
a. Is the box shape recognisable as a box? (smile logo visible, box form clear)
|
|
b. For EACH visible edge of the box, check: is tape/coloured strip being CUT OFF by the asset boundary? If any tape is truncated at the asset edge → FAIL
|
|
c. Is the bottom of the box cropped by the asset edge? If yes → FAIL
|
|
d. Is the left side/front face of the box cropped? If yes → FAIL
|
|
e. Right-side crop of the box BODY (cardboard) is acceptable, but the TAPE on the right side must not be cut off by the asset edge
|
|
5. Check headline interaction: If the box overlaps the headline, is it a small tasteful overlap?
|
|
6. Check that the box does not cover the subhead, date, or legal line
|
|
|
|
DECISION CRITERIA:
|
|
- PASS: Box is positioned appropriately for the format type, no tape is being cut off by the asset edge, box bottom is not cropped, headline remains legible, and box does not cover non-headline elements
|
|
- FAIL: Any tape/coloured strip is being CUT OFF by the asset boundary (truncated at the edge), OR box bottom is cropped by asset edge, OR left side/front face is cropped, OR box is on the wrong side for the format, OR box covers non-headline elements, OR headline legibility is compromised
|
|
|
|
YOUR OUTPUT:
|
|
Format your response as JSON:
|
|
{
|
|
"box_placement_check": "Pass" or "Fail",
|
|
"box_type": "box" or "bag" or "logo only" or "no box found",
|
|
"format_type": "landscape" or "square" or "portrait/tall",
|
|
"box_position": "right" or "center-right" or "center" or "left" or "other",
|
|
"positioned_correctly": true or false,
|
|
"tape_visible": true or false or "N/A",
|
|
"cropping_assessment": {
|
|
"is_cropped": true or false,
|
|
"right_side_crop": true or false,
|
|
"tape_cropped_by_asset_edge": true or false,
|
|
"bottom_cropped_by_asset_edge": true or false,
|
|
"left_cropped_by_asset_edge": true or false
|
|
},
|
|
"headline_interaction": {
|
|
"overlaps_headline": true or false,
|
|
"overlap_acceptable": true or false or "N/A",
|
|
"headline_legible": true or false
|
|
},
|
|
"covers_non_headline_elements": true or false,
|
|
"explanation": "Detailed reasoning for the assessment",
|
|
"recommendations": ["List specific recommendations if applicable, else an empty array"]
|
|
}"""
|
|
|
|
super().__init__(__name__, prompt)
|
|
|
|
# Run the app if executed directly
|
|
if __name__ == "__main__":
|
|
app_instance = AmazonElementPlacementApp()
|
|
app_instance.run()
|