xinjie.wang commited on
Commit
da4caa5
·
1 Parent(s): 64fae85
Files changed (2) hide show
  1. app.py +0 -2
  2. common.py +3 -1
app.py CHANGED
@@ -46,8 +46,6 @@ with gr.Blocks(
46
  <style>
47
  #img-fit img {
48
  object-fit: contain !important;
49
- width: 100% !important;
50
- height: 100% !important;
51
  }
52
  </style>
53
  """
 
46
  <style>
47
  #img-fit img {
48
  object-fit: contain !important;
 
 
49
  }
50
  </style>
51
  """
common.py CHANGED
@@ -80,7 +80,7 @@ IMAGESR_MODEL = ImageRealESRGAN(outscale=4)
80
 
81
  if os.getenv("GRADIO_APP") == "imageto3d":
82
  RBG_REMOVER = RembgRemover()
83
- SAM_PREDICTOR = SAMPredictor(model_type="vit_h")
84
  PIPELINE = TrellisImageTo3DPipeline.from_pretrained(
85
  "JeffreyXiang/TRELLIS-image-large"
86
  )
@@ -319,6 +319,8 @@ def select_point(
319
  sel_pix.append((evt.index, 1)) # default foreground_point
320
 
321
  masks = SAM_PREDICTOR.generate_masks(image, sel_pix)
 
 
322
  seg_image = SAM_PREDICTOR.get_segmented_image(image, masks)
323
 
324
  for point, label in sel_pix:
 
80
 
81
  if os.getenv("GRADIO_APP") == "imageto3d":
82
  RBG_REMOVER = RembgRemover()
83
+ SAM_PREDICTOR = SAMPredictor(model_type="vit_h", device="cpu")
84
  PIPELINE = TrellisImageTo3DPipeline.from_pretrained(
85
  "JeffreyXiang/TRELLIS-image-large"
86
  )
 
319
  sel_pix.append((evt.index, 1)) # default foreground_point
320
 
321
  masks = SAM_PREDICTOR.generate_masks(image, sel_pix)
322
+ print("sel_pix", sel_pix)
323
+ print("masks", masks)
324
  seg_image = SAM_PREDICTOR.get_segmented_image(image, masks)
325
 
326
  for point, label in sel_pix: