Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -29,65 +29,33 @@ for root, dirs, files in os.walk("./ckpt"):
|
|
29 |
subindent = " " * 4 * (level + 1)
|
30 |
for f in files:
|
31 |
print(f"{subindent}{f}")
|
32 |
-
# # --------- SETUP CODE: Download models if not found ---------
|
33 |
-
# FVSM_PATH = "./ckpt/FVSM/FloVD_FVSM_Controlnet.pt"
|
34 |
-
# OMSM_PATH = "./ckpt/OMSM"
|
35 |
-
# POSE_DIR = "./assets/manual_poses"
|
36 |
-
# EXAMPLE_POSE = os.path.join(POSE_DIR, "example.txt")
|
37 |
|
38 |
-
#
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
#
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
# download_if_missing()
|
68 |
-
# image_path = "./temp_input.png"
|
69 |
-
# image.save(image_path)
|
70 |
-
|
71 |
-
# generate_video(
|
72 |
-
# prompt=prompt,
|
73 |
-
# fvsm_path=FVSM_PATH,
|
74 |
-
# omsm_path=OMSM_PATH,
|
75 |
-
# image_path=image_path,
|
76 |
-
# cam_pose_name=cam_pose_name,
|
77 |
-
# output_path="./output/",
|
78 |
-
# dtype=torch.float16,
|
79 |
-
# )
|
80 |
-
# return "./output/generated_videos/your_video.mp4"
|
81 |
-
|
82 |
-
# # --------- Launch Gradio ---------
|
83 |
-
# iface = gr.Interface(
|
84 |
-
# fn=run_flovd,
|
85 |
-
# inputs=[
|
86 |
-
# gr.Textbox(label="Prompt"),
|
87 |
-
# gr.Image(type="pil", label="Input Image"),
|
88 |
-
# gr.Textbox(label="Camera Pose File Name", value="example.txt"),
|
89 |
-
# ],
|
90 |
-
# outputs=gr.Video(label="Generated Video"),
|
91 |
-
# title="FloVD - Optical Flow Video Diffusion with Camera Motion",
|
92 |
-
# )
|
93 |
-
# iface.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
29 |
subindent = " " * 4 * (level + 1)
|
30 |
for f in files:
|
31 |
print(f"{subindent}{f}")
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
+
# --------- UI Function ---------
|
34 |
+
def run_flovd(prompt, image, cam_pose_name):
|
35 |
+
download_if_missing()
|
36 |
+
image_path = "./temp_input.png"
|
37 |
+
image.save(image_path)
|
38 |
+
|
39 |
+
generate_video(
|
40 |
+
prompt=prompt,
|
41 |
+
fvsm_path=FVSM_PATH,
|
42 |
+
omsm_path=OMSM_PATH,
|
43 |
+
image_path=image_path,
|
44 |
+
cam_pose_name=cam_pose_name,
|
45 |
+
output_path="./output/",
|
46 |
+
dtype=torch.float16,
|
47 |
+
)
|
48 |
+
return "./output/generated_videos/your_video.mp4"
|
49 |
+
|
50 |
+
# --------- Launch Gradio ---------
|
51 |
+
iface = gr.Interface(
|
52 |
+
fn=run_flovd,
|
53 |
+
inputs=[
|
54 |
+
gr.Textbox(label="Prompt"),
|
55 |
+
gr.Image(type="pil", label="Input Image"),
|
56 |
+
gr.Textbox(label="Camera Pose File Name", value="example.txt"),
|
57 |
+
],
|
58 |
+
outputs=gr.Video(label="Generated Video"),
|
59 |
+
title="FloVD - Optical Flow Video Diffusion with Camera Motion",
|
60 |
+
)
|
61 |
+
iface.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|