Ankan Ghosh
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,13 +5,13 @@ import os
|
|
| 5 |
import matplotlib.pyplot as plt
|
| 6 |
import gradio as gr
|
| 7 |
|
| 8 |
-
try:
|
| 9 |
-
|
| 10 |
|
| 11 |
-
|
| 12 |
-
except ModuleNotFoundError:
|
| 13 |
-
|
| 14 |
-
|
| 15 |
|
| 16 |
# ------------------------------------------------------------------------------
|
| 17 |
# 1. Initializations.
|
|
@@ -112,11 +112,11 @@ def calculate_distance(A, B):
|
|
| 112 |
return distance
|
| 113 |
|
| 114 |
|
| 115 |
-
def play(file):
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
|
| 121 |
|
| 122 |
# ------------------------------------------------------------------------------
|
|
@@ -206,8 +206,8 @@ def process_video(input_video):
|
|
| 206 |
|
| 207 |
if state_prev == "closed" and state_curr == "open":
|
| 208 |
BLINK += 1
|
| 209 |
-
if mixer_init:
|
| 210 |
-
|
| 211 |
|
| 212 |
state_prev = state_curr
|
| 213 |
|
|
|
|
| 5 |
import matplotlib.pyplot as plt
|
| 6 |
import gradio as gr
|
| 7 |
|
| 8 |
+
# try:
|
| 9 |
+
# from pygame import mixer
|
| 10 |
|
| 11 |
+
# mixer_init = True
|
| 12 |
+
# except ModuleNotFoundError:
|
| 13 |
+
# mixer = None
|
| 14 |
+
# mixer_init = False
|
| 15 |
|
| 16 |
# ------------------------------------------------------------------------------
|
| 17 |
# 1. Initializations.
|
|
|
|
| 112 |
return distance
|
| 113 |
|
| 114 |
|
| 115 |
+
# def play(file):
|
| 116 |
+
# if mixer_init:
|
| 117 |
+
# mixer.init()
|
| 118 |
+
# sound = mixer.Sound(file)
|
| 119 |
+
# sound.play()
|
| 120 |
|
| 121 |
|
| 122 |
# ------------------------------------------------------------------------------
|
|
|
|
| 206 |
|
| 207 |
if state_prev == "closed" and state_curr == "open":
|
| 208 |
BLINK += 1
|
| 209 |
+
# if mixer_init:
|
| 210 |
+
# play("./click.wav")
|
| 211 |
|
| 212 |
state_prev = state_curr
|
| 213 |
|