Aluren commited on
Commit
8cdefc6
·
verified ·
1 Parent(s): 2c8a6a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -7,7 +7,7 @@ import spaces
7
  import gradio as gr
8
  import numpy as np
9
  import torch
10
- # from gradio_image_prompter import ImagePrompter
11
  from gradio_litmodel3d import LitModel3D
12
  from huggingface_hub import snapshot_download
13
  from PIL import Image
@@ -31,7 +31,12 @@ MARKDOWN = """
31
  3. If you want the refine result to be more consistent with the image, please manually increase the CFG strength.
32
  """
33
  EXAMPLES = [
34
- ["assets/image/100.png","assets/model/100.glb",42,False,]
 
 
 
 
 
35
  ]
36
  # EXAMPLES = [
37
  # [
@@ -125,7 +130,7 @@ def run_detailgen3d(
125
  guidance_scale,
126
  ):
127
  surface = load_mesh(mesh)
128
- image = Image.open(image).convert("RGB")
129
 
130
  batch_size = 1
131
 
@@ -168,8 +173,8 @@ def run_refinement(
168
  # print("rgb_image", rgb_image)
169
  # print("mesh", rgb_image)
170
 
171
- # if not isinstance(rgb_image, Image.Image) and "image" in rgb_image:
172
- # rgb_image = Image.open(rgb_image["image"]).convert("RGB")
173
 
174
  scene = run_detailgen3d(
175
  pipeline,
@@ -194,8 +199,8 @@ with gr.Blocks() as demo:
194
  with gr.Row():
195
  with gr.Column():
196
  with gr.Row():
197
- # image_prompts = ImagePrompter(label="Input Image", type="pil")
198
- image_prompts = gr.Image(label="Example Image", type="pil")
199
  mesh = gr.Model3D(label="Input Coarse Model",camera_position=(90,90,3))
200
 
201
  with gr.Accordion("Generation Settings", open=False):
 
7
  import gradio as gr
8
  import numpy as np
9
  import torch
10
+ from gradio_image_prompter import ImagePrompter
11
  from gradio_litmodel3d import LitModel3D
12
  from huggingface_hub import snapshot_download
13
  from PIL import Image
 
31
  3. If you want the refine result to be more consistent with the image, please manually increase the CFG strength.
32
  """
33
  EXAMPLES = [
34
+ {
35
+ "image": "assets/image/100.png",
36
+ },
37
+ "assets/model/100.glb",
38
+ 42,
39
+ False,
40
  ]
41
  # EXAMPLES = [
42
  # [
 
130
  guidance_scale,
131
  ):
132
  surface = load_mesh(mesh)
133
+ # image = Image.open(image).convert("RGB")
134
 
135
  batch_size = 1
136
 
 
173
  # print("rgb_image", rgb_image)
174
  # print("mesh", rgb_image)
175
 
176
+ if not isinstance(rgb_image, Image.Image) and "image" in rgb_image:
177
+ rgb_image = Image.open(rgb_image["image"]).convert("RGB")
178
 
179
  scene = run_detailgen3d(
180
  pipeline,
 
199
  with gr.Row():
200
  with gr.Column():
201
  with gr.Row():
202
+ image_prompts = ImagePrompter(label="Input Image", type="pil")
203
+ # image_prompts = gr.Image(label="Example Image", type="pil")
204
  mesh = gr.Model3D(label="Input Coarse Model",camera_position=(90,90,3))
205
 
206
  with gr.Accordion("Generation Settings", open=False):