Ver código fonte

add: points data

amanda 3 anos atrás
pai
commit
77aeb2e77a

+ 2 - 1
backend_refactor/service/photo_analyzer.py

@@ -48,8 +48,9 @@ class StandingPhotoAnalyzer(BasePhotoAnalyzer):
                 cv2.imwrite(UPLOAD_DIR + 'result/{}.result.jpg'.format(i), canvas)
                 photos.append(FILE_URL + '{}.result.jpg'.format(i))
 
+            print(poses)
             callback("FINISHED", result={"data": {"front": {"file": photos[0]}, "right": {"file": photos[1]}},
-                                         "advice": {"front": npys[0], "right": npys[1]}},)
+                                         "advice": {"front": npys[0], "right": npys[1], "points": poses}}, )
         except Exception as e:
             callback("ERROR", error=e)
             raise e

+ 2 - 0
backend_refactor/service/video_analyzer.py

@@ -105,9 +105,11 @@ class BaseVideoAnalyzer:
             try:
                 for i in result['data']:
                     result['data'][i]['file'] = FILE_URL + self.video_uuid + "." + result['data'][i]['index'] + ".jpg"
+                result['data']['points'] = self.results
             except Exception as e:
                 logging.warning("file index in data not found, %s" % e)
 
+            print(result)
             callback("FINISHED", result=result)
         except Exception as e:
             callback("ERROR", error=e)