zouzx commited on
Commit
37f1879
1 Parent(s): 5b4642b

add log for image size

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -15,9 +15,9 @@ code_dir = snapshot_download("zouzx/TriplaneGaussian", local_dir="./code", token
15
 
16
  sys.path.append(code_dir)
17
 
18
- # if not LOCAL_CODE:
19
- import subprocess
20
- subprocess.run(["pip", "install", "--upgrade", "gradio"])
21
 
22
  import gradio as gr
23
  print("gr version: ", gr.__version__)
@@ -78,6 +78,7 @@ def preprocess(input_raw, save_path):
78
 
79
  # input_raw = Image.open(image_path)
80
  input_raw.thumbnail([512, 512], Image.Resampling.LANCZOS)
 
81
  image_sam = sam_out_nosave(
82
  sam_predictor, input_raw.convert("RGB"), pred_bbox(input_raw)
83
  )
@@ -140,7 +141,7 @@ def launch(port):
140
 
141
  with gr.Row(variant='panel'):
142
  with gr.Column(scale=1):
143
- input_image = gr.Image(value=None, image_mode="RGB", width=512, height=512, type="pil", label="Input Image")
144
  gr.Markdown(
145
  """
146
  **Camera distance** denotes the distance between camera center and scene center.
 
15
 
16
  sys.path.append(code_dir)
17
 
18
+ if not LOCAL_CODE:
19
+ import subprocess
20
+ subprocess.run(["pip", "install", "--upgrade", "gradio"])
21
 
22
  import gradio as gr
23
  print("gr version: ", gr.__version__)
 
78
 
79
  # input_raw = Image.open(image_path)
80
  input_raw.thumbnail([512, 512], Image.Resampling.LANCZOS)
81
+ print("image size:", input_raw.size)
82
  image_sam = sam_out_nosave(
83
  sam_predictor, input_raw.convert("RGB"), pred_bbox(input_raw)
84
  )
 
141
 
142
  with gr.Row(variant='panel'):
143
  with gr.Column(scale=1):
144
+ input_image = gr.Image(value=None, image_mode="RGB", width=512, height=512, type="pil", sources="upload", label="Input Image")
145
  gr.Markdown(
146
  """
147
  **Camera distance** denotes the distance between camera center and scene center.