Update app.py
Browse files
app.py
CHANGED
|
@@ -39,7 +39,7 @@ def emotionAnalysis(message, face):
|
|
| 39 |
- numpy.ndarray: Direct webcam capture (RGB or BGR format)
|
| 40 |
- str: File path to uploaded image
|
| 41 |
Returns:
|
| 42 |
-
tuple: (str, plt) Contains the emotion results text and the updated plot
|
| 43 |
"""
|
| 44 |
if (message.lower() == "finish"):
|
| 45 |
graph = displayResults()
|
|
@@ -124,20 +124,11 @@ def displayResults():
|
|
| 124 |
def process_webcam(img):
|
| 125 |
"""
|
| 126 |
Process webcam frame and draw emotion detection results
|
| 127 |
-
Args:
|
| 128 |
-
img: Input image from webcam
|
| 129 |
-
Returns:
|
| 130 |
-
numpy.ndarray: Image with emotion detection results drawn on it
|
| 131 |
"""
|
| 132 |
if img is None:
|
| 133 |
return None
|
| 134 |
|
| 135 |
try:
|
| 136 |
-
# Convert to RGB for emotion detection
|
| 137 |
-
#img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
| 138 |
-
|
| 139 |
-
# Detect faces and emotions
|
| 140 |
-
#result = face_emotion_detector.detect_emotions(img_rgb)
|
| 141 |
|
| 142 |
return img
|
| 143 |
except Exception as e:
|
|
|
|
| 39 |
- numpy.ndarray: Direct webcam capture (RGB or BGR format)
|
| 40 |
- str: File path to uploaded image
|
| 41 |
Returns:
|
| 42 |
+
tuple: (str, plt, Gradio Download Button Object) Contains the emotion results text and the updated plot
|
| 43 |
"""
|
| 44 |
if (message.lower() == "finish"):
|
| 45 |
graph = displayResults()
|
|
|
|
| 124 |
def process_webcam(img):
|
| 125 |
"""
|
| 126 |
Process webcam frame and draw emotion detection results
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
"""
|
| 128 |
if img is None:
|
| 129 |
return None
|
| 130 |
|
| 131 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
return img
|
| 134 |
except Exception as e:
|