Test Gradio
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import torchvision.transforms as transforms
|
|
3 |
import cv2
|
4 |
from PIL import Image
|
5 |
import pafy
|
6 |
-
import gradio as
|
7 |
from transformers import BlipProcessor, BlipForConditionalGeneration
|
8 |
import subprocess
|
9 |
|
@@ -44,10 +44,13 @@ def caption_youtube(url):
|
|
44 |
# Release the video file
|
45 |
|
46 |
cap.release()
|
|
|
|
|
|
|
47 |
|
48 |
video_url = 'https://www.youtube.com/watch?v=orbkg5JH9C8'
|
49 |
subprocess.call(['youtube-dl', '-f', 'best', '-o', 'video.mp4', video_url]
|
50 |
-
iface =
|
51 |
iface.launch()
|
52 |
|
53 |
|
|
|
3 |
import cv2
|
4 |
from PIL import Image
|
5 |
import pafy
|
6 |
+
import gradio as gra
|
7 |
from transformers import BlipProcessor, BlipForConditionalGeneration
|
8 |
import subprocess
|
9 |
|
|
|
44 |
# Release the video file
|
45 |
|
46 |
cap.release()
|
47 |
+
|
48 |
+
def user_greeting(name):
|
49 |
+
return "Hi! " + name + " Welcome to your first Gradio application!😎"
|
50 |
|
51 |
video_url = 'https://www.youtube.com/watch?v=orbkg5JH9C8'
|
52 |
subprocess.call(['youtube-dl', '-f', 'best', '-o', 'video.mp4', video_url]
|
53 |
+
iface = gra.Interface(fn=user_greeting, inputs='text', outputs="text")
|
54 |
iface.launch()
|
55 |
|
56 |
|