Browse Source

add: standing points

amanda 3 years ago
parent
commit
fcacc9d8d6

+ 1 - 1
backend_refactor/service/photo_analyzer.py

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

+ 1 - 1
frontend_refactor/src/containers/TaskList.js

@@ -88,7 +88,7 @@ function renderResult(x, data) {
         advice = result.advice
 
         if (data.type === "PHOTO_STANDING") {
-            advice_element = advice['front'].filter(x => typeof x === 'string').concat(advice['right'].filter(x => typeof x === 'string')).map(x => <>{x}<br/></>)
+            advice_element = advice['front'].filter(x => typeof x === 'string').concat(advice['right'].filter(x => typeof x === 'string')).concat(advice['points']).map(x => <>{x}<br/></>)
         } else {
             advice_element = <p>{advice}</p>
         }