Update app.py
Browse files
app.py
CHANGED
@@ -1,32 +1,20 @@
|
|
1 |
-
import gradio
|
2 |
import cv2
|
3 |
-
import numpy as np
|
4 |
-
import librosa
|
5 |
|
6 |
-
def process_video(video_file):
|
7 |
-
# Read the video file
|
8 |
-
cap = cv2.VideoCapture(video_file)
|
9 |
-
frames = []
|
10 |
-
while True:
|
11 |
-
ret, frame = cap.read()
|
12 |
-
if not ret:
|
13 |
-
break
|
14 |
-
frames.append(frame)
|
15 |
-
cap.release()
|
16 |
|
17 |
-
|
18 |
-
|
|
|
19 |
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
iface = gr.Interface(
|
26 |
-
fn=process_video,
|
27 |
-
inputs="file",
|
28 |
-
outputs="text",
|
29 |
-
title="Video to Audio Generator",
|
30 |
-
description="Upload a video, analyze it, and generate audio"
|
31 |
-
)
|
32 |
-
iface.launch()
|
|
|
1 |
+
import gradio
|
2 |
import cv2
|
|
|
|
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
+
def inference(img):
|
6 |
+
blur = cv2.blur(img,(5,5))
|
7 |
+
return blur
|
8 |
|
9 |
+
# For information on Interfaces, head to https://gradio.app/docs/
|
10 |
+
# For user guides, head to https://gradio.app/guides/
|
11 |
+
# For Spaces usage, head to https://huggingface.co/docs/hub/spaces
|
12 |
+
iface = gradio.Interface(
|
13 |
+
fn=inference,
|
14 |
+
inputs='image',
|
15 |
+
outputs='image',
|
16 |
+
title='Hello World',
|
17 |
+
description='The simplest interface!',
|
18 |
+
examples=["llama.jpg"])
|
19 |
|
20 |
+
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|