lemonaddie
commited on
Commit
•
00a9186
1
Parent(s):
f3be028
Update app2.py
Browse files
app2.py
CHANGED
@@ -29,8 +29,8 @@ import cv2
|
|
29 |
|
30 |
import sys
|
31 |
sys.path.append("../")
|
32 |
-
|
33 |
-
from models.depth_normal_pipeline_clip_cfg import DepthNormalEstimationPipeline
|
34 |
from utils.seed_all import seed_all
|
35 |
import matplotlib.pyplot as plt
|
36 |
from utils.de_normalized import align_scale_shift
|
@@ -54,8 +54,8 @@ sd_image_variations_diffusers_path = '.'
|
|
54 |
image_encoder = CLIPVisionModelWithProjection.from_pretrained(sd_image_variations_diffusers_path, subfolder="image_encoder")
|
55 |
feature_extractor = CLIPImageProcessor.from_pretrained(sd_image_variations_diffusers_path, subfolder="feature_extractor")
|
56 |
|
57 |
-
|
58 |
-
unet = UNet2DConditionModel.from_pretrained('./cfg/unet_ema')
|
59 |
|
60 |
pipe = DepthNormalEstimationPipeline(vae=vae,
|
61 |
image_encoder=image_encoder,
|
@@ -77,7 +77,7 @@ def depth_normal(img,
|
|
77 |
denoising_steps,
|
78 |
ensemble_size,
|
79 |
processing_res,
|
80 |
-
guidance_scale,
|
81 |
domain):
|
82 |
|
83 |
#img = img.resize((processing_res, processing_res), Image.Resampling.LANCZOS)
|
@@ -87,7 +87,7 @@ def depth_normal(img,
|
|
87 |
ensemble_size=ensemble_size,
|
88 |
processing_res=processing_res,
|
89 |
batch_size=0,
|
90 |
-
guidance_scale=guidance_scale,
|
91 |
domain=domain,
|
92 |
show_progress_bar=True,
|
93 |
)
|
@@ -151,13 +151,13 @@ def run_demo():
|
|
151 |
label="Data Type (Must Select One matches your image)",
|
152 |
value="indoor",
|
153 |
)
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
)
|
161 |
denoising_steps = gr.Slider(
|
162 |
label="Number of denoising steps (More stepes, better quality)",
|
163 |
minimum=1,
|
@@ -194,7 +194,7 @@ def run_demo():
|
|
194 |
inputs=[input_image, denoising_steps,
|
195 |
ensemble_size,
|
196 |
processing_res,
|
197 |
-
guidance_scale,
|
198 |
domain],
|
199 |
outputs=[depth, normal]
|
200 |
)
|
|
|
29 |
|
30 |
import sys
|
31 |
sys.path.append("../")
|
32 |
+
from models.depth_normal_pipeline_clip import DepthNormalEstimationPipeline
|
33 |
+
#from models.depth_normal_pipeline_clip_cfg import DepthNormalEstimationPipeline
|
34 |
from utils.seed_all import seed_all
|
35 |
import matplotlib.pyplot as plt
|
36 |
from utils.de_normalized import align_scale_shift
|
|
|
54 |
image_encoder = CLIPVisionModelWithProjection.from_pretrained(sd_image_variations_diffusers_path, subfolder="image_encoder")
|
55 |
feature_extractor = CLIPImageProcessor.from_pretrained(sd_image_variations_diffusers_path, subfolder="feature_extractor")
|
56 |
|
57 |
+
unet = UNet2DConditionModel.from_pretrained('./wocfg/unet_ema')
|
58 |
+
#unet = UNet2DConditionModel.from_pretrained('./cfg/unet_ema')
|
59 |
|
60 |
pipe = DepthNormalEstimationPipeline(vae=vae,
|
61 |
image_encoder=image_encoder,
|
|
|
77 |
denoising_steps,
|
78 |
ensemble_size,
|
79 |
processing_res,
|
80 |
+
#guidance_scale,
|
81 |
domain):
|
82 |
|
83 |
#img = img.resize((processing_res, processing_res), Image.Resampling.LANCZOS)
|
|
|
87 |
ensemble_size=ensemble_size,
|
88 |
processing_res=processing_res,
|
89 |
batch_size=0,
|
90 |
+
#guidance_scale=guidance_scale,
|
91 |
domain=domain,
|
92 |
show_progress_bar=True,
|
93 |
)
|
|
|
151 |
label="Data Type (Must Select One matches your image)",
|
152 |
value="indoor",
|
153 |
)
|
154 |
+
# guidance_scale = gr.Slider(
|
155 |
+
# label="Classifier Free Guidance Scale",
|
156 |
+
# minimum=1,
|
157 |
+
# maximum=5,
|
158 |
+
# step=1,
|
159 |
+
# value=1,
|
160 |
+
# )
|
161 |
denoising_steps = gr.Slider(
|
162 |
label="Number of denoising steps (More stepes, better quality)",
|
163 |
minimum=1,
|
|
|
194 |
inputs=[input_image, denoising_steps,
|
195 |
ensemble_size,
|
196 |
processing_res,
|
197 |
+
#guidance_scale,
|
198 |
domain],
|
199 |
outputs=[depth, normal]
|
200 |
)
|