Spaces:
Running
on
Zero
Running
on
Zero
YuxueYang
commited on
Commit
·
531d0cf
1
Parent(s):
2a59fa8
Set default pretrained model to "checkpoints/LayerAnimate-Mix"
Browse files
app.py
CHANGED
@@ -68,6 +68,7 @@ class LayerAnimate:
|
|
68 |
self.sample_grid = np.meshgrid(np.linspace(0, self.W - 1, 10, dtype=int), np.linspace(0, self.H - 1, 10, dtype=int))
|
69 |
self.sample_grid = np.stack(self.sample_grid, axis=-1).reshape(-1, 1, 2)
|
70 |
self.sample_grid = np.repeat(self.sample_grid, self.L, axis=1) # [N, F, 2]
|
|
|
71 |
|
72 |
@spaces.GPU
|
73 |
def set_seed(self, seed):
|
@@ -243,6 +244,9 @@ class LayerAnimate:
|
|
243 |
return output_video_path, output_video_traj_path
|
244 |
|
245 |
|
|
|
|
|
|
|
246 |
def update_layer_region(image, layer_mask):
|
247 |
if image is None or layer_mask is None:
|
248 |
return None, False
|
@@ -412,7 +416,6 @@ if __name__ == "__main__":
|
|
412 |
6. **Note: Remember to click "Clear" button to clear all the controls before switching to another example.**<br>
|
413 |
""")
|
414 |
|
415 |
-
layeranimate = LayerAnimate()
|
416 |
layer_indices = [gr.Number(value=i, visible=False) for i in range(LAYER_CAPACITY)]
|
417 |
layer_tracking_points = [gr.State([[]]) for _ in range(LAYER_CAPACITY)]
|
418 |
layer_masks = []
|
@@ -505,10 +508,9 @@ if __name__ == "__main__":
|
|
505 |
pretrained_model_path = gr.Dropdown(
|
506 |
label="Pretrained Model",
|
507 |
choices=[
|
508 |
-
"None",
|
509 |
"checkpoints/LayerAnimate-Mix",
|
510 |
],
|
511 |
-
value="
|
512 |
)
|
513 |
text_prompt = gr.Textbox(label="Text Prompt", value="an anime scene.")
|
514 |
text_n_prompt = gr.Textbox(label="Negative Text Prompt", value="")
|
|
|
68 |
self.sample_grid = np.meshgrid(np.linspace(0, self.W - 1, 10, dtype=int), np.linspace(0, self.H - 1, 10, dtype=int))
|
69 |
self.sample_grid = np.stack(self.sample_grid, axis=-1).reshape(-1, 1, 2)
|
70 |
self.sample_grid = np.repeat(self.sample_grid, self.L, axis=1) # [N, F, 2]
|
71 |
+
self.set_model("checkpoints/LayerAnimate-Mix")
|
72 |
|
73 |
@spaces.GPU
|
74 |
def set_seed(self, seed):
|
|
|
244 |
return output_video_path, output_video_traj_path
|
245 |
|
246 |
|
247 |
+
layeranimate = LayerAnimate()
|
248 |
+
|
249 |
+
|
250 |
def update_layer_region(image, layer_mask):
|
251 |
if image is None or layer_mask is None:
|
252 |
return None, False
|
|
|
416 |
6. **Note: Remember to click "Clear" button to clear all the controls before switching to another example.**<br>
|
417 |
""")
|
418 |
|
|
|
419 |
layer_indices = [gr.Number(value=i, visible=False) for i in range(LAYER_CAPACITY)]
|
420 |
layer_tracking_points = [gr.State([[]]) for _ in range(LAYER_CAPACITY)]
|
421 |
layer_masks = []
|
|
|
508 |
pretrained_model_path = gr.Dropdown(
|
509 |
label="Pretrained Model",
|
510 |
choices=[
|
|
|
511 |
"checkpoints/LayerAnimate-Mix",
|
512 |
],
|
513 |
+
value="checkpoints/LayerAnimate-Mix",
|
514 |
)
|
515 |
text_prompt = gr.Textbox(label="Text Prompt", value="an anime scene.")
|
516 |
text_n_prompt = gr.Textbox(label="Negative Text Prompt", value="")
|