添加标准图像为None时候的判断
This commit is contained in:
@ -112,7 +112,10 @@ def get_product_description(std_img, track_imgs):
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
best_img = get_best_image(track_imgs)
|
best_img = get_best_image(track_imgs)
|
||||||
|
if std_img is not None:
|
||||||
img_list = [std_img, best_img]
|
img_list = [std_img, best_img]
|
||||||
|
else:
|
||||||
|
img_list = [best_img, best_img]
|
||||||
|
|
||||||
output_text = qwen_prompt(img_list, messages)
|
output_text = qwen_prompt(img_list, messages)
|
||||||
contrast_pair = ast.literal_eval(output_text.strip('```python\n'))
|
contrast_pair = ast.literal_eval(output_text.strip('```python\n'))
|
||||||
@ -135,6 +138,8 @@ def main():
|
|||||||
}
|
}
|
||||||
|
|
||||||
track_imgs = stream_pipeline(stream_dict)
|
track_imgs = stream_pipeline(stream_dict)
|
||||||
|
std_img = None
|
||||||
|
if stream_dict['goodsPic'] is not None:
|
||||||
response = requests.get(stream_dict['goodsPic'])
|
response = requests.get(stream_dict['goodsPic'])
|
||||||
std_img = Image.open(BytesIO(response.content))
|
std_img = Image.open(BytesIO(response.content))
|
||||||
description_dict = get_product_description(std_img, track_imgs)
|
description_dict = get_product_description(std_img, track_imgs)
|
||||||
|
Reference in New Issue
Block a user