Explorar o código

识别失败返回结果删除本地图片

zhangdongming %!s(int64=2) %!d(string=hai) anos
pai
achega
6689ab0961
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      Controller/AiController.py

+ 2 - 0
Controller/AiController.py

@@ -106,9 +106,11 @@ class AiView(View):
             ai_view = AiView()
             ai_results = ai_view.image_aI_recognition(file_path_list, 0.45, 0.45, 1)
             if not ai_results:
+                CommonService.del_path(dir_path)
                 return response.json(0)
             event_type = ai_view.get_cloud_recognition_tag(ai_results)
             if event_type == 0:
+                CommonService.del_path(dir_path)
                 return response.json(0)
             new_bounding_box_dict = ''
             # 上传缩略图到s3