Commit
•
a3d2317
1
Parent(s):
bf4a508
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,6 @@ from glob import glob
|
|
4 |
from pathlib import Path
|
5 |
from typing import Optional
|
6 |
|
7 |
-
|
8 |
import cv2
|
9 |
import numpy as np
|
10 |
import torch
|
@@ -19,6 +18,9 @@ from sgm.inference.helpers import embed_watermark
|
|
19 |
from sgm.util import default, instantiate_from_config
|
20 |
from huggingface_hub import hf_hub_download
|
21 |
|
|
|
|
|
|
|
22 |
from simple_video_sample import sample
|
23 |
|
24 |
num_frames = 25
|
@@ -91,9 +93,6 @@ def get_batch(keys, value_dict, N, T, device):
|
|
91 |
batch_uc[key] = torch.clone(batch[key])
|
92 |
return batch, batch_uc
|
93 |
|
94 |
-
|
95 |
-
import gradio as gr
|
96 |
-
import uuid
|
97 |
def resize_image(image_path, output_size=(1024, 576)):
|
98 |
with Image.open(image_path) as image:
|
99 |
# Calculate aspect ratios
|
|
|
4 |
from pathlib import Path
|
5 |
from typing import Optional
|
6 |
|
|
|
7 |
import cv2
|
8 |
import numpy as np
|
9 |
import torch
|
|
|
18 |
from sgm.util import default, instantiate_from_config
|
19 |
from huggingface_hub import hf_hub_download
|
20 |
|
21 |
+
import gradio as gr
|
22 |
+
import uuid
|
23 |
+
|
24 |
from simple_video_sample import sample
|
25 |
|
26 |
num_frames = 25
|
|
|
93 |
batch_uc[key] = torch.clone(batch[key])
|
94 |
return batch, batch_uc
|
95 |
|
|
|
|
|
|
|
96 |
def resize_image(image_path, output_size=(1024, 576)):
|
97 |
with Image.open(image_path) as image:
|
98 |
# Calculate aspect ratios
|