auto-save 2026-05-17 20:20 (~4)
This commit is contained in:
14
api/main.py
14
api/main.py
@@ -4569,15 +4569,13 @@ def analyze_product_view(ref_path: Path, index: int) -> dict:
|
||||
return fallback_product_view(index)
|
||||
img_b64 = base64.b64encode(ref_path.read_bytes()).decode("ascii")
|
||||
prompt = (
|
||||
"You are inspecting one reference image from a same-product image pool for a SKG neck-and-shoulder wearable massage device. Do not classify product identity or compare different products; all uploaded references belong to the same product. The background may be white, black, or simple studio color. "
|
||||
"Classify the camera/view angle into exactly one enum: front, left_45, right_45, side_thickness, inner_contacts, back_bottom. "
|
||||
"Classify background into exactly one enum: white, black, simple, complex, unknown. Do not request or perform background conversion. "
|
||||
"Add use_tags from this enum only: hero_packshot, wearing_scale, inner_contact, side_thickness, asymmetry, button_detail, back_bottom, material_texture. "
|
||||
"Also write a concise Chinese note for video generation, focused on visible structure, asymmetry, thickness, inner massage contacts, buttons, opening width, shoulder-neck wearing scale, and what this image is best used for in video generation. "
|
||||
"Write risk in Chinese only if this reference may mislead video generation, such as cropped product, hand blocking, low detail, strong reflection, or background confusion; otherwise use empty string. "
|
||||
"If uncertain, choose the closest useful view; do not ask the user. "
|
||||
"你在识别同一款 SKG 挂脖肩颈按摩仪的一张产品参考图。它是套在脖子上的 U 形/围脖式按摩仪,不是耳机、头戴设备或护颈枕;所有上传图都属于同一产品,不要判断不同产品身份。 "
|
||||
"必须使用产品坐标系:product_left=戴在真人脖子上时佩戴者左肩一侧,product_right=佩戴者右肩一侧,top=靠近下巴/脸/颈部上沿,bottom=靠近锁骨/肩部下沿,inner_side=贴颈皮肤/按摩触点,outer_side=外壳/按键/Logo。不要把图片左侧直接当产品左侧;在 orientation 里写清楚产品左/右/上/下对应图中哪边,不确定就说明不确定并写 risk。 "
|
||||
"view 从 enum 选一个:front, left_45, right_45, side_thickness, inner_contacts, back_bottom。left_45/right_45 指佩戴者身体左右,不是画面左右。 "
|
||||
"background 从 enum 选:white, black, simple, complex, unknown。use_tags 只能从 enum 选:hero_packshot, wearing_scale, inner_contact, side_thickness, asymmetry, button_detail, back_bottom, material_texture。 "
|
||||
"landmarks 用中文短词列出可见结构,例如佩戴者左侧臂、佩戴者右侧臂、U形开口、贴颈内侧、按摩触点、侧边厚度、按键、充电口、底部、外壳材质、局部细节。note 用中文写给生视频模型,重点说明左/右/上/下、内/外侧、触点或局部细节。risk 只在可能误导生视频时写中文,否则为空。 "
|
||||
"Output one-line strict JSON only. Do not use markdown or line breaks. "
|
||||
"{\"view\":\"front|left_45|right_45|side_thickness|inner_contacts|back_bottom\", \"background\":\"white|black|simple|complex|unknown\", \"use_tags\":[\"hero_packshot\"], \"note\":\"中文备注\", \"risk\":\"\", \"confidence\":0.0}."
|
||||
"{\"view\":\"front|left_45|right_45|side_thickness|inner_contacts|back_bottom\",\"background\":\"white|black|simple|complex|unknown\",\"use_tags\":[\"hero_packshot\"],\"orientation\":{\"product_left\":\"图中哪一侧/不可见/不确定\",\"product_right\":\"图中哪一侧/不可见/不确定\",\"top\":\"图中哪一侧/不可见/不确定\",\"bottom\":\"图中哪一侧/不可见/不确定\",\"inner_side\":\"图中哪一侧/是否可见\",\"outer_side\":\"图中哪一侧/是否可见\",\"opening_direction\":\"U形开口朝图中哪一侧/不可见/不确定\"},\"landmarks\":[\"U形开口\"],\"note\":\"中文备注\",\"risk\":\"\",\"confidence\":0.0}."
|
||||
)
|
||||
try:
|
||||
resp = llm().chat.completions.create(
|
||||
|
||||
Reference in New Issue
Block a user