修改app.py
This commit is contained in:
10
app.py
10
app.py
@ -47,8 +47,10 @@ def item_analysis(stream_dict):
|
|||||||
if stream_dict['goodsPic'] is not 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, initModel.qwen_model, initModel.processor)
|
description_dict = get_product_description(std_img,
|
||||||
print(description_dict)
|
track_imgs,
|
||||||
|
initModel.qwen_model,
|
||||||
|
initModel.processor)
|
||||||
return description_dict
|
return description_dict
|
||||||
|
|
||||||
|
|
||||||
@ -77,10 +79,10 @@ def aiReview(): # put application's code here
|
|||||||
data[key] = None
|
data[key] = None
|
||||||
logging.error(f'{key} is null')
|
logging.error(f'{key} is null')
|
||||||
# stream_pipeline(data)
|
# stream_pipeline(data)
|
||||||
item_analysis(data)
|
description_dict = item_analysis(data)
|
||||||
end = time.time()
|
end = time.time()
|
||||||
logging.info(f'aiReview cost {end - start}s')
|
logging.info(f'aiReview cost {end - start}s')
|
||||||
return 0
|
return description_dict
|
||||||
|
|
||||||
|
|
||||||
# def main():
|
# def main():
|
||||||
|
@ -16,7 +16,7 @@ def aiReviewClient():
|
|||||||
}
|
}
|
||||||
url = "http://192.168.1.28:8060/ai_review"
|
url = "http://192.168.1.28:8060/ai_review"
|
||||||
r = requests.post(url=url, data=json.dumps(data))
|
r = requests.post(url=url, data=json.dumps(data))
|
||||||
print(r.text)
|
print(r.json())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Reference in New Issue
Block a user