yejunliang23 commited on
Commit
204eb17
Β·
verified Β·
1 Parent(s): 3fe6827

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -6
app.py CHANGED
@@ -164,17 +164,12 @@ def activate_button() -> gr.Button:
164
  def deactivate_button() -> gr.Button:
165
  return gr.Button(interactive=False)
166
 
167
- def load_model():
168
  pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
169
  try:
170
  pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8))) # Preload rembg
171
  except:
172
  pass
173
- model = {"pipeline":pipeline}
174
- return model
175
-
176
- with gr.Blocks() as demo:
177
- demo.load(fn=load_model, inputs=None, outputs=None)
178
  gr.Markdown("""
179
  ## Image to 3D Asset with [TRELLIS](https://trellis3d.github.io/)
180
  * Upload an image and click "Generate" to create a 3D asset. If the image has alpha channel, it be used as the mask. Otherwise, we use `rembg` to remove the background.
 
164
  def deactivate_button() -> gr.Button:
165
  return gr.Button(interactive=False)
166
 
167
+ with gr.Blocks() as demo:
168
  pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
169
  try:
170
  pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8))) # Preload rembg
171
  except:
172
  pass
 
 
 
 
 
173
  gr.Markdown("""
174
  ## Image to 3D Asset with [TRELLIS](https://trellis3d.github.io/)
175
  * Upload an image and click "Generate" to create a 3D asset. If the image has alpha channel, it be used as the mask. Otherwise, we use `rembg` to remove the background.