Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
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(
|
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,
|