lemonaddie commited on
Commit
4b22f7c
1 Parent(s): 6a7ab7f

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +13 -13
app2.py CHANGED
@@ -30,7 +30,7 @@ import cv2
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 models.depth_normal_pipeline_clip_cfg1 import DepthNormalEstimationPipeline
35
  from utils.seed_all import seed_all
36
  import matplotlib.pyplot as plt
@@ -55,8 +55,8 @@ sd_image_variations_diffusers_path = '.'
55
  image_encoder = CLIPVisionModelWithProjection.from_pretrained(sd_image_variations_diffusers_path, subfolder="image_encoder")
56
  feature_extractor = CLIPImageProcessor.from_pretrained(sd_image_variations_diffusers_path, subfolder="feature_extractor")
57
 
58
- #unet = UNet2DConditionModel.from_pretrained('./wocfg/unet_ema')
59
- unet = UNet2DConditionModel.from_pretrained('./cfg/unet_ema')
60
 
61
  pipe = DepthNormalEstimationPipeline(vae=vae,
62
  image_encoder=image_encoder,
@@ -78,7 +78,7 @@ def depth_normal(img,
78
  denoising_steps,
79
  ensemble_size,
80
  processing_res,
81
- guidance_scale,
82
  domain):
83
 
84
  #img = img.resize((processing_res, processing_res), Image.Resampling.LANCZOS)
@@ -88,7 +88,7 @@ def depth_normal(img,
88
  ensemble_size=ensemble_size,
89
  processing_res=processing_res,
90
  batch_size=0,
91
- guidance_scale=guidance_scale,
92
  domain=domain,
93
  show_progress_bar=True,
94
  )
@@ -152,13 +152,13 @@ def run_demo():
152
  label="Data Type (Must Select One matches your image)",
153
  value="indoor",
154
  )
155
- guidance_scale = gr.Slider(
156
- label="Classifier Free Guidance Scale",
157
- minimum=1,
158
- maximum=5,
159
- step=1,
160
- value=1,
161
- )
162
  denoising_steps = gr.Slider(
163
  label="Number of denoising steps (More stepes, better quality)",
164
  minimum=1,
@@ -195,7 +195,7 @@ def run_demo():
195
  inputs=[input_image, denoising_steps,
196
  ensemble_size,
197
  processing_res,
198
- guidance_scale,
199
  domain],
200
  outputs=[depth, normal]
201
  )
 
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 models.depth_normal_pipeline_clip_cfg1 import DepthNormalEstimationPipeline
35
  from utils.seed_all import seed_all
36
  import matplotlib.pyplot as plt
 
55
  image_encoder = CLIPVisionModelWithProjection.from_pretrained(sd_image_variations_diffusers_path, subfolder="image_encoder")
56
  feature_extractor = CLIPImageProcessor.from_pretrained(sd_image_variations_diffusers_path, subfolder="feature_extractor")
57
 
58
+ unet = UNet2DConditionModel.from_pretrained('./wocfg/unet_ema')
59
+ #unet = UNet2DConditionModel.from_pretrained('./cfg/unet_ema')
60
 
61
  pipe = DepthNormalEstimationPipeline(vae=vae,
62
  image_encoder=image_encoder,
 
78
  denoising_steps,
79
  ensemble_size,
80
  processing_res,
81
+ #guidance_scale,
82
  domain):
83
 
84
  #img = img.resize((processing_res, processing_res), Image.Resampling.LANCZOS)
 
88
  ensemble_size=ensemble_size,
89
  processing_res=processing_res,
90
  batch_size=0,
91
+ #guidance_scale=guidance_scale,
92
  domain=domain,
93
  show_progress_bar=True,
94
  )
 
152
  label="Data Type (Must Select One matches your image)",
153
  value="indoor",
154
  )
155
+ # guidance_scale = gr.Slider(
156
+ # label="Classifier Free Guidance Scale",
157
+ # minimum=1,
158
+ # maximum=5,
159
+ # step=1,
160
+ # value=1,
161
+ # )
162
  denoising_steps = gr.Slider(
163
  label="Number of denoising steps (More stepes, better quality)",
164
  minimum=1,
 
195
  inputs=[input_image, denoising_steps,
196
  ensemble_size,
197
  processing_res,
198
+ #guidance_scale,
199
  domain],
200
  outputs=[depth, normal]
201
  )