duelmas commited on
Commit
940537f
·
1 Parent(s): 7b535cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -27
app.py CHANGED
@@ -1,32 +1,20 @@
1
- import gradio as gr
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
- # Process the video frames and generate audio
18
- # Your video processing and audio generation logic here
 
19
 
20
- # Save the new audio file
21
- # Example: librosa.output.write_wav('output_audio.wav', new_audio, sr)
 
 
 
 
 
 
 
 
22
 
23
- return "Audio generated successfully"
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()