LeoDu vor 4 Jahren
Ursprung
Commit
a2c3fb11a3
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 3 3
      backend_refactor/route/analyze.py
  2. 1 1
      backend_refactor/service/video_analyzer.py

+ 3 - 3
backend_refactor/route/analyze.py

@@ -1,6 +1,6 @@
 import uuid, json
-from backend_refactor.db import task
-from service.video_analyzer import BaseVideoAnalyzer, CrunchVideoAnalyzer, HighKneesVideoAnalyzer, PlankVideoAnalyzer, SquatVideoAnalyzer
+
+from service.video_analyzer import BaseVideoAnalyzer, CrunchVideoAnalyzer, HighKneesVideoAnalyzer, PlankVideoAnalyzer, SquatVideoAnalyzer, StandingLongJumpVideoAnalyzer
 # from service.video.Video3DAnalyzer import Video3DAnalyzer
 
 from db import db
@@ -46,7 +46,7 @@ def analysis():
         "PHOTO_STANDING": StandingPhotoAnalyzer,
         "VIDEO_HIGHKNEES": HighKneesVideoAnalyzer,
         "VIDEO_CRUNCH": CrunchVideoAnalyzer,
-        "VIDEO_STANDINGLONGJUMP": StandingPhotoAnalyzer,
+        "VIDEO_STANDINGLONGJUMP": StandingLongJumpVideoAnalyzer,
         "VIDEO_PLANK": PlankVideoAnalyzer,
         "VIDEO_SQUAT": SquatVideoAnalyzer
     }

+ 1 - 1
backend_refactor/service/video_analyzer.py

@@ -43,7 +43,7 @@ def gather_video(video_uuid):
     # Just to get a fps
     cap = cv2.VideoCapture(video_path)
     fps = cap.get(5)
-    cap.close()
+    cap.release()
 
     frames = [name for name in os.listdir(frames_dir) if
               name.endswith(".jpg") and "npy" not in name and "result" not in name]