Commit
·
cb97970
1
Parent(s):
6e87f28
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import cv2
|
|
4 |
|
5 |
def video_to_descriptions(video):
|
6 |
# Charger le modèle via pipeline
|
7 |
-
model = pipeline('
|
8 |
|
9 |
# Ouvrir la vidéo
|
10 |
cap = cv2.VideoCapture(video.name)
|
@@ -39,10 +39,12 @@ def video_to_descriptions(video):
|
|
39 |
|
40 |
iface = gr.Interface(
|
41 |
fn=video_to_descriptions,
|
42 |
-
inputs=gr.
|
43 |
outputs="text",
|
44 |
-
live=False
|
|
|
|
|
45 |
)
|
46 |
|
47 |
-
if __name__ == "
|
48 |
-
iface.launch()
|
|
|
4 |
|
5 |
def video_to_descriptions(video):
|
6 |
# Charger le modèle via pipeline
|
7 |
+
model = pipeline('text2text-generation', model='nlpconnect/vit-gpt2-image-captioning')
|
8 |
|
9 |
# Ouvrir la vidéo
|
10 |
cap = cv2.VideoCapture(video.name)
|
|
|
39 |
|
40 |
iface = gr.Interface(
|
41 |
fn=video_to_descriptions,
|
42 |
+
inputs=gr.Video(type="file", label="Importez une vidéo"),
|
43 |
outputs="text",
|
44 |
+
live=False,
|
45 |
+
server_name="0.0.0.0",
|
46 |
+
server_port=7860
|
47 |
)
|
48 |
|
49 |
+
if __name__ == "__main__":
|
50 |
+
iface.launch()
|