Spaces:
Sleeping
Sleeping
update commit
Browse files
app.py
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
import cv2
|
3 |
import numpy as np
|
4 |
-
|
|
|
5 |
# Function to extract the last frame from a video
|
6 |
def extract_last_frame(video_file):
|
7 |
cap = cv2.VideoCapture(video_file)
|
@@ -27,6 +28,7 @@ demo = gr.Interface(
|
|
27 |
outputs="image",
|
28 |
title="Video to Last Frame",
|
29 |
description="Extract the last frame from a video",
|
|
|
30 |
)
|
31 |
|
32 |
if __name__ == "__main__":
|
|
|
1 |
import gradio as gr
|
2 |
import cv2
|
3 |
import numpy as np
|
4 |
+
HF_TOKEN = os.getenv("HF_TOKEN", default ="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")
|
5 |
+
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "video-data")
|
6 |
# Function to extract the last frame from a video
|
7 |
def extract_last_frame(video_file):
|
8 |
cap = cv2.VideoCapture(video_file)
|
|
|
28 |
outputs="image",
|
29 |
title="Video to Last Frame",
|
30 |
description="Extract the last frame from a video",
|
31 |
+
allow_flagging="auto",flagging_callback=hf_writer
|
32 |
)
|
33 |
|
34 |
if __name__ == "__main__":
|