Spaces:
Running
on
Zero
Running
on
Zero
Fix.
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import os
|
|
2 |
from PIL import Image, ImageOps
|
3 |
import random
|
4 |
|
|
|
5 |
import cv2
|
6 |
from diffusers import StableVideoDiffusionPipeline
|
7 |
from diffusers.image_processor import VaeImageProcessor
|
@@ -11,7 +12,6 @@ import gradio as gr
|
|
11 |
import numpy as np
|
12 |
from safetensors import safe_open
|
13 |
from segment_anything import build_sam, SamPredictor
|
14 |
-
import spaces
|
15 |
from tqdm import tqdm
|
16 |
import torch
|
17 |
|
@@ -34,6 +34,7 @@ INSTRUCTION = '''
|
|
34 |
2 steps to get started:
|
35 |
- Upload an image of a dynamic object.
|
36 |
- Add one or more drags on the object to specify the part-level interactions.
|
|
|
37 |
How to add drags:
|
38 |
- To add a drag, first click on the starting point of the drag, then click on the ending point of the drag, on the Input Image (leftmost).
|
39 |
- You can add up to 5 drags.
|
|
|
2 |
from PIL import Image, ImageOps
|
3 |
import random
|
4 |
|
5 |
+
import spaces
|
6 |
import cv2
|
7 |
from diffusers import StableVideoDiffusionPipeline
|
8 |
from diffusers.image_processor import VaeImageProcessor
|
|
|
12 |
import numpy as np
|
13 |
from safetensors import safe_open
|
14 |
from segment_anything import build_sam, SamPredictor
|
|
|
15 |
from tqdm import tqdm
|
16 |
import torch
|
17 |
|
|
|
34 |
2 steps to get started:
|
35 |
- Upload an image of a dynamic object.
|
36 |
- Add one or more drags on the object to specify the part-level interactions.
|
37 |
+
|
38 |
How to add drags:
|
39 |
- To add a drag, first click on the starting point of the drag, then click on the ending point of the drag, on the Input Image (leftmost).
|
40 |
- You can add up to 5 drags.
|
svd.py
CHANGED
@@ -1312,5 +1312,3 @@ class UNetDragSpatioTemporalConditionModel(ModelMixin, ConfigMixin, UNet2DCondit
|
|
1312 |
|
1313 |
if __name__ == "__main__":
|
1314 |
puppet_master = UNetDragSpatioTemporalConditionModel(num_drags=5)
|
1315 |
-
state_dict = torch.load("ckpts/0800000-ema.pt", map_location="cpu")
|
1316 |
-
puppet_master.load_state_dict(state_dict, strict=True)
|
|
|
1312 |
|
1313 |
if __name__ == "__main__":
|
1314 |
puppet_master = UNetDragSpatioTemporalConditionModel(num_drags=5)
|
|
|
|