Spaces:
Running
Running
Restore face confidence levels
Browse files- face_detector.py +2 -2
face_detector.py
CHANGED
|
@@ -225,7 +225,7 @@ class FaceEmotionDetector:
|
|
| 225 |
|
| 226 |
# Build result
|
| 227 |
emotion_scores = [
|
| 228 |
-
EmotionScore(label=label, score=scores[label], confidence=scores[label] * 0.
|
| 229 |
for label in EMOTION_LABELS
|
| 230 |
]
|
| 231 |
dominant = max(scores, key=scores.get) # type: ignore
|
|
@@ -235,7 +235,7 @@ class FaceEmotionDetector:
|
|
| 235 |
dominant_score=scores[dominant],
|
| 236 |
scores=emotion_scores,
|
| 237 |
modality="face",
|
| 238 |
-
confidence=scores[dominant] * 0.
|
| 239 |
processing_time_ms=(time.time() - start) * 1000,
|
| 240 |
cultural_region=cultural_region,
|
| 241 |
)
|
|
|
|
| 225 |
|
| 226 |
# Build result
|
| 227 |
emotion_scores = [
|
| 228 |
+
EmotionScore(label=label, score=scores[label], confidence=scores[label] * 0.85)
|
| 229 |
for label in EMOTION_LABELS
|
| 230 |
]
|
| 231 |
dominant = max(scores, key=scores.get) # type: ignore
|
|
|
|
| 235 |
dominant_score=scores[dominant],
|
| 236 |
scores=emotion_scores,
|
| 237 |
modality="face",
|
| 238 |
+
confidence=scores[dominant] * 0.80,
|
| 239 |
processing_time_ms=(time.time() - start) * 1000,
|
| 240 |
cultural_region=cultural_region,
|
| 241 |
)
|