|
@@ -176,12 +176,6 @@ class AiView(View):
|
|
|
|
|
|
# 将识别结果存到S3以及DynamoDB
|
|
|
AiView.store_image_results_to_dynamo_and_s3(file_path_list, uid, channel, n_time, labels, rekognition_res)
|
|
|
- if len(labels['label_list']) == 0:
|
|
|
- # 需要删除图片
|
|
|
- self.del_path(dir_path)
|
|
|
- self.del_path(dir_path + '.jpg')
|
|
|
- TIME_LOGGER.info('*****uid={},删除图片成功,路径为:{}'.format(uid, dir_path))
|
|
|
- return response.json(10055)
|
|
|
eventType = labels['eventType']
|
|
|
label_str = ','.join(labels['label_list'])
|
|
|
new_bounding_box_dict = labels['new_bounding_box_dict']
|
|
@@ -264,17 +258,6 @@ class AiView(View):
|
|
|
|
|
|
AiView.save_cloud_ai_tag(uid, int(n_time), eventType, 0)
|
|
|
return response.json(0)
|
|
|
-
|
|
|
- except UnidentifiedImageError as e:
|
|
|
- if dir_path:
|
|
|
- self.del_path(dir_path)
|
|
|
- self.del_path(dir_path + '.jpg')
|
|
|
- data = {
|
|
|
- 'errLine': e.__traceback__.tb_lineno,
|
|
|
- 'errMsg': repr(e)
|
|
|
- }
|
|
|
- TIME_LOGGER.info(f'rekognition识别异常删除图片 uid:{uid},errMsg={data}')
|
|
|
- return response.json(48, data)
|
|
|
except Exception as e:
|
|
|
print(e)
|
|
|
data = {
|
|
@@ -411,11 +394,6 @@ class AiView(View):
|
|
|
upload_data = open(file_path, "rb")
|
|
|
# upload_key = "test"
|
|
|
s3.Bucket(bucket).put_object(Key=upload_path, Body=upload_data)
|
|
|
- # 需要删除图片
|
|
|
- logger = logging.getLogger('info')
|
|
|
- self.del_path(dir_path)
|
|
|
- self.del_path(dir_path + '.jpg')
|
|
|
- logger.info('删除图片成功,路径为:{}'.format(dir_path))
|
|
|
return True
|
|
|
except Exception as e:
|
|
|
print(repr(e))
|