修改跟踪算法cpu gpu切换错误
This commit is contained in:
@ -122,6 +122,16 @@ def get_product_description(std_img, track_imgs):
|
||||
|
||||
return contrast_pair
|
||||
|
||||
def item_analysis(stream_dict):
|
||||
track_imgs = stream_pipeline(stream_dict)
|
||||
std_img = None
|
||||
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)
|
||||
|
||||
return description_dict
|
||||
|
||||
def main():
|
||||
# sample input dict
|
||||
stream_dict = {
|
||||
@ -137,13 +147,8 @@ def main():
|
||||
"goodsSpec" : "405g"
|
||||
}
|
||||
|
||||
track_imgs = stream_pipeline(stream_dict)
|
||||
std_img = None
|
||||
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)
|
||||
print(description_dict)
|
||||
result = item_analysis(stream_dict)
|
||||
print(result)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Reference in New Issue
Block a user