diff --git a/app.py b/app.py index fd0b968..5ce6bab 100644 --- a/app.py +++ b/app.py @@ -47,8 +47,10 @@ def item_analysis(stream_dict): if stream_dict['goodsPic'] is not None: response = requests.get(stream_dict['goodsPic']) std_img = Image.open(BytesIO(response.content)) - description_dict = get_product_description(std_img, track_imgs, initModel.qwen_model, initModel.processor) - print(description_dict) + description_dict = get_product_description(std_img, + track_imgs, + initModel.qwen_model, + initModel.processor) return description_dict @@ -77,10 +79,10 @@ def aiReview(): # put application's code here data[key] = None logging.error(f'{key} is null') # stream_pipeline(data) - item_analysis(data) + description_dict = item_analysis(data) end = time.time() logging.info(f'aiReview cost {end - start}s') - return 0 + return description_dict # def main(): diff --git a/client.py b/client.py index 8dbb4f4..385ff51 100644 --- a/client.py +++ b/client.py @@ -16,7 +16,7 @@ def aiReviewClient(): } url = "http://192.168.1.28:8060/ai_review" r = requests.post(url=url, data=json.dumps(data)) - print(r.text) + print(r.json()) if __name__ == '__main__':