Spaces:
Sleeping
Sleeping
hoda.fakhar commited on
Commit ·
cdfeda4
1
Parent(s): ff31e2d
fix: remove retinaface from live view, clean unused import
Browse files
app/routes/analysis_routes.py
CHANGED
|
@@ -5,7 +5,7 @@ import base64
|
|
| 5 |
from io import BytesIO
|
| 6 |
from PIL import Image
|
| 7 |
from werkzeug.utils import secure_filename
|
| 8 |
-
from ..utils.ml_engine import analyzer
|
| 9 |
|
| 10 |
bp = Blueprint('analysis', __name__, url_prefix='/analysis')
|
| 11 |
|
|
@@ -89,14 +89,8 @@ def live_frame():
|
|
| 89 |
img.save(temp_path, "JPEG", quality=95)
|
| 90 |
|
| 91 |
# Set accuracy backend
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
# Temporary hi-res analyzer for this specific frame
|
| 95 |
-
hi_res_analyzer = FaceAnalyzer(detector_backend='retinaface')
|
| 96 |
-
result = hi_res_analyzer.analyze(temp_path)
|
| 97 |
-
else:
|
| 98 |
-
# Use global high-speed analyzer
|
| 99 |
-
result = analyzer.analyze(temp_path)
|
| 100 |
|
| 101 |
# Cleanup
|
| 102 |
if os.path.exists(temp_path):
|
|
|
|
| 5 |
from io import BytesIO
|
| 6 |
from PIL import Image
|
| 7 |
from werkzeug.utils import secure_filename
|
| 8 |
+
from ..utils.ml_engine import analyzer
|
| 9 |
|
| 10 |
bp = Blueprint('analysis', __name__, url_prefix='/analysis')
|
| 11 |
|
|
|
|
| 89 |
img.save(temp_path, "JPEG", quality=95)
|
| 90 |
|
| 91 |
# Set accuracy backend
|
| 92 |
+
# Always use the shared opencv-based analyzer (no retinaface weights needed)
|
| 93 |
+
result = analyzer.analyze(temp_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
# Cleanup
|
| 96 |
if os.path.exists(temp_path):
|