adpro commited on
Commit
7f86340
·
verified ·
1 Parent(s): 3d07564

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -13,11 +13,7 @@ model = DPTForDepthEstimation.from_pretrained("Intel/dpt-large")
13
 
14
  def process_image(image_path):
15
  image_path = Path(image_path)
16
- image_raw = Image.open(image_path)
17
- image = image_raw.resize(
18
- (800, int(800 * image_raw.size[1] / image_raw.size[0])),
19
- Image.Resampling.LANCZOS,
20
- )
21
 
22
  # prepare image for the model
23
  encoding = feature_extractor(image, return_tensors="pt")
@@ -49,9 +45,7 @@ iface = gr.Interface(
49
  fn=process_image,
50
  inputs=[gr.Image(type="filepath", label="Input Image")],
51
  outputs=[
52
- gr.Image(label="predicted depth", type="pil"),
53
- gr.Model3D(label="3d mesh reconstruction", clear_color=[1.0, 1.0, 1.0, 1.0]),
54
- gr.File(label="3d gLTF"),
55
  ],
56
  title=title,
57
  description=description,
 
13
 
14
  def process_image(image_path):
15
  image_path = Path(image_path)
16
+ image = Image.open(image_path)
 
 
 
 
17
 
18
  # prepare image for the model
19
  encoding = feature_extractor(image, return_tensors="pt")
 
45
  fn=process_image,
46
  inputs=[gr.Image(type="filepath", label="Input Image")],
47
  outputs=[
48
+ inputs=[gr.inputs.Image(type="filepath", label="Input Image")],
 
 
49
  ],
50
  title=title,
51
  description=description,