bug fix
Browse files
gradio_app/custom_models/{image2normal.yaml → image2image-objaverseF-rgb2normal.yaml}
RENAMED
File without changes
|
gradio_app/custom_models/mvimg_prediction.py
CHANGED
@@ -11,10 +11,11 @@ from scripts.utils import session, simple_preprocess
|
|
11 |
|
12 |
training_config = "gradio_app/custom_models/image2mvimage.yaml"
|
13 |
checkpoint_path = "ckpt/img2mvimg/unet_state_dict.pth"
|
14 |
-
trainer, pipeline = load_pipeline(training_config, checkpoint_path)
|
15 |
-
pipeline.enable_model_cpu_offload()
|
16 |
|
17 |
def predict(img_list: List[Image.Image], guidance_scale=2., **kwargs):
|
|
|
|
|
|
|
18 |
if isinstance(img_list, Image.Image):
|
19 |
img_list = [img_list]
|
20 |
img_list = [rgba_to_rgb(i) if i.mode == 'RGBA' else i for i in img_list]
|
|
|
11 |
|
12 |
training_config = "gradio_app/custom_models/image2mvimage.yaml"
|
13 |
checkpoint_path = "ckpt/img2mvimg/unet_state_dict.pth"
|
|
|
|
|
14 |
|
15 |
def predict(img_list: List[Image.Image], guidance_scale=2., **kwargs):
|
16 |
+
trainer, pipeline = load_pipeline(training_config, checkpoint_path)
|
17 |
+
# pipeline.enable_model_cpu_offload()
|
18 |
+
|
19 |
if isinstance(img_list, Image.Image):
|
20 |
img_list = [img_list]
|
21 |
img_list = [rgba_to_rgb(i) if i.mode == 'RGBA' else i for i in img_list]
|
gradio_app/custom_models/normal_prediction.py
CHANGED
@@ -7,10 +7,11 @@ from scripts.all_typing import *
|
|
7 |
|
8 |
training_config = "gradio_app/custom_models/image2normal.yaml"
|
9 |
checkpoint_path = "ckpt/image2normal/unet_state_dict.pth"
|
10 |
-
trainer, pipeline = load_pipeline(training_config, checkpoint_path)
|
11 |
-
pipeline.enable_model_cpu_offload()
|
12 |
|
13 |
def predict_normals(image: List[Image.Image], guidance_scale=2., do_rotate=True, num_inference_steps=30, **kwargs):
|
|
|
|
|
|
|
14 |
img_list = image if isinstance(image, list) else [image]
|
15 |
img_list = [rgba_to_rgb(i) if i.mode == 'RGBA' else i for i in img_list]
|
16 |
images = trainer.pipeline_forward(
|
|
|
7 |
|
8 |
training_config = "gradio_app/custom_models/image2normal.yaml"
|
9 |
checkpoint_path = "ckpt/image2normal/unet_state_dict.pth"
|
|
|
|
|
10 |
|
11 |
def predict_normals(image: List[Image.Image], guidance_scale=2., do_rotate=True, num_inference_steps=30, **kwargs):
|
12 |
+
trainer, pipeline = load_pipeline(training_config, checkpoint_path)
|
13 |
+
# pipeline.enable_model_cpu_offload()
|
14 |
+
|
15 |
img_list = image if isinstance(image, list) else [image]
|
16 |
img_list = [rgba_to_rgb(i) if i.mode == 'RGBA' else i for i in img_list]
|
17 |
images = trainer.pipeline_forward(
|