Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -56,7 +56,7 @@ random_seed = 42
|
|
56 |
video_length = 201
|
57 |
W = 1024
|
58 |
H = W
|
59 |
-
device = "cpu"
|
60 |
|
61 |
def get_pipe_image_and_video_predictor():
|
62 |
vae = AutoencoderKLWan.from_pretrained("./model/vae", torch_dtype=torch.float16)
|
@@ -242,6 +242,9 @@ def track_video(n_frames,video_state):
|
|
242 |
images = [cv2.resize(img, (W_, H_)) for img in images]
|
243 |
video_state["origin_images"] = images
|
244 |
images = np.array(images)
|
|
|
|
|
|
|
245 |
inference_state = video_predictor.init_state(images=images/255, device=device)
|
246 |
video_state["inference_state"] = inference_state
|
247 |
|
|
|
56 |
video_length = 201
|
57 |
W = 1024
|
58 |
H = W
|
59 |
+
device = "cpu"
|
60 |
|
61 |
def get_pipe_image_and_video_predictor():
|
62 |
vae = AutoencoderKLWan.from_pretrained("./model/vae", torch_dtype=torch.float16)
|
|
|
242 |
images = [cv2.resize(img, (W_, H_)) for img in images]
|
243 |
video_state["origin_images"] = images
|
244 |
images = np.array(images)
|
245 |
+
|
246 |
+
global video_predictor
|
247 |
+
video_predictor=video_predictor.to("cuda")
|
248 |
inference_state = video_predictor.init_state(images=images/255, device=device)
|
249 |
video_state["inference_state"] = inference_state
|
250 |
|