Spaces:
Running
on
Zero
Running
on
Zero
guangkaixu
commited on
Commit
·
12daec9
1
Parent(s):
bb97b26
upload
Browse files
app.py
CHANGED
@@ -62,7 +62,6 @@ def process_image(
|
|
62 |
path_input,
|
63 |
processing_res=default_image_processing_res,
|
64 |
):
|
65 |
-
assert False
|
66 |
name_base, name_ext = os.path.splitext(os.path.basename(path_input))
|
67 |
print(f"Processing image {name_base}{name_ext}")
|
68 |
|
@@ -267,9 +266,10 @@ def main():
|
|
267 |
|
268 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
269 |
|
270 |
-
|
271 |
-
|
272 |
-
|
|
|
273 |
empty_text_embed = torch.from_numpy(np.load("./empty_text_embed.npy")).to(device, dtype)[None] # [1, 77, 1024]
|
274 |
|
275 |
pipe = GenPerceptPipeline(vae=vae,
|
|
|
62 |
path_input,
|
63 |
processing_res=default_image_processing_res,
|
64 |
):
|
|
|
65 |
name_base, name_ext = os.path.splitext(os.path.basename(path_input))
|
66 |
print(f"Processing image {name_base}{name_ext}")
|
67 |
|
|
|
266 |
|
267 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
268 |
|
269 |
+
dtype = torch.float16
|
270 |
+
|
271 |
+
vae = AutoencoderKL.from_pretrained("guangkaixu/GenPercept", subfolder='vae').to(dtype)
|
272 |
+
unet_depth_v1 = UNet2DConditionModel.from_pretrained('guangkaixu/GenPercept', subfolder="unet_depth_v1").to(dtype)
|
273 |
empty_text_embed = torch.from_numpy(np.load("./empty_text_embed.npy")).to(device, dtype)[None] # [1, 77, 1024]
|
274 |
|
275 |
pipe = GenPerceptPipeline(vae=vae,
|