Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -176,7 +176,10 @@ def analyze_sentiment(text):
|
|
| 176 |
|
| 177 |
|
| 178 |
def video_to_audio(input_video):
|
| 179 |
-
|
|
|
|
|
|
|
|
|
|
| 180 |
video_emotion_totals, frames_sentiments, body_language, distraction_rate = extract_frames(input_video)
|
| 181 |
print("Total Video Emotions ... Done")
|
| 182 |
print("Video Frame Sentiment ... Done")
|
|
@@ -303,6 +306,7 @@ def video_to_audio(input_video):
|
|
| 303 |
|
| 304 |
payload = {
|
| 305 |
'from': 'gradio',
|
|
|
|
| 306 |
'total_video_emotions': video_emotion_totals,
|
| 307 |
'emotions_final': emotion_finals,
|
| 308 |
'body_language': body_language,
|
|
@@ -313,11 +317,12 @@ def video_to_audio(input_video):
|
|
| 313 |
|
| 314 |
print(payload)
|
| 315 |
|
| 316 |
-
response = requests.post('
|
| 317 |
|
| 318 |
|
| 319 |
-
with gr.Blocks(theme=theme, css=".gradio-container { background: rgba(255, 255, 255, 0.2) !important; box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.37 ) !important; backdrop-filter: blur( 10px ) !important; -webkit-backdrop-filter: blur( 10px ) !important; border-radius: 10px !important; border: 1px solid rgba( 0, 0, 0, 0.
|
| 320 |
input_video = gr.Video(sources=["webcam", "upload"], format='mp4')
|
| 321 |
input_video.stop_recording(fn=video_to_audio, inputs=input_video)
|
|
|
|
| 322 |
|
| 323 |
Video.launch()
|
|
|
|
| 176 |
|
| 177 |
|
| 178 |
def video_to_audio(input_video):
|
| 179 |
+
temp = requests.get('https://parthcodes-flask-tester.hf.space/useridping')
|
| 180 |
+
user_id = temp.json()
|
| 181 |
+
print(user_id)
|
| 182 |
+
|
| 183 |
video_emotion_totals, frames_sentiments, body_language, distraction_rate = extract_frames(input_video)
|
| 184 |
print("Total Video Emotions ... Done")
|
| 185 |
print("Video Frame Sentiment ... Done")
|
|
|
|
| 306 |
|
| 307 |
payload = {
|
| 308 |
'from': 'gradio',
|
| 309 |
+
'user_id': user_id,
|
| 310 |
'total_video_emotions': video_emotion_totals,
|
| 311 |
'emotions_final': emotion_finals,
|
| 312 |
'body_language': body_language,
|
|
|
|
| 317 |
|
| 318 |
print(payload)
|
| 319 |
|
| 320 |
+
response = requests.post('https://parthcodes-flask-tester.hf.space/interview', json=payload)
|
| 321 |
|
| 322 |
|
| 323 |
+
with gr.Blocks(theme=theme, css=".gradio-container { background: rgba(255, 255, 255, 0.2) !important; box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.37 ) !important; backdrop-filter: blur( 10px ) !important; -webkit-backdrop-filter: blur( 10px ) !important; border-radius: 10px !important; border: 1px solid rgba( 0, 0, 0, 0.5 ) !important;}") as Video:
|
| 324 |
input_video = gr.Video(sources=["webcam", "upload"], format='mp4')
|
| 325 |
input_video.stop_recording(fn=video_to_audio, inputs=input_video)
|
| 326 |
+
input_video.upload(fn=video_to_audio, inputs=input_video)
|
| 327 |
|
| 328 |
Video.launch()
|