Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -156,7 +156,7 @@ def get_matte(video_in, subject_to_remove):
|
|
156 |
print("Trying to call video matting")
|
157 |
result = matte_client.predict(
|
158 |
f"{video_in}", # str (filepath on your computer (or URL) of file) in 'parameter_4' Video component
|
159 |
-
|
160 |
f"{subject_to_remove}", # str in 'Text prompt' Textbox component
|
161 |
"", # str in 'Background prompt' Textbox component
|
162 |
api_name="/go_matte"
|
@@ -172,9 +172,9 @@ def infer_auto(project_name, video_in, subject_to_remove):
|
|
172 |
matte_video = get_matte(video_in, subject_to_remove)
|
173 |
|
174 |
# Cut the video to the first 3 seconds
|
175 |
-
video_cut = f"video_cut.mp4"
|
176 |
-
ffmpeg_extract_subclip(video_in, t1=0, t2=3, targetname=video_cut)
|
177 |
-
video_frames = get_frames(
|
178 |
print(video_frames[0])
|
179 |
|
180 |
masks_frames = get_frames(matte_video, "mask")
|
|
|
156 |
print("Trying to call video matting")
|
157 |
result = matte_client.predict(
|
158 |
f"{video_in}", # str (filepath on your computer (or URL) of file) in 'parameter_4' Video component
|
159 |
+
25, # int | float (numeric value between 0 and 10) in 'Cut video at (s)' Slider component
|
160 |
f"{subject_to_remove}", # str in 'Text prompt' Textbox component
|
161 |
"", # str in 'Background prompt' Textbox component
|
162 |
api_name="/go_matte"
|
|
|
172 |
matte_video = get_matte(video_in, subject_to_remove)
|
173 |
|
174 |
# Cut the video to the first 3 seconds
|
175 |
+
#video_cut = f"video_cut.mp4"
|
176 |
+
#ffmpeg_extract_subclip(video_in, t1=0, t2=3, targetname=video_cut)
|
177 |
+
video_frames = get_frames(video_in, "source")
|
178 |
print(video_frames[0])
|
179 |
|
180 |
masks_frames = get_frames(matte_video, "mask")
|