Spaces:
Runtime error
Runtime error
Xu Ma
commited on
Commit
·
2488a15
1
Parent(s):
e4425ca
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ feature_extractor = DPTFeatureExtractor.from_pretrained("Intel/dpt-large")
|
|
| 11 |
model = DPTForDepthEstimation.from_pretrained("Intel/dpt-large")
|
| 12 |
|
| 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(
|
|
@@ -106,19 +106,7 @@ description = "This demo shows the effectiveness of LIVE <a href='' target='_bla
|
|
| 106 |
examples = [["examples/" + img] for img in os.listdir("examples/")]
|
| 107 |
|
| 108 |
iface = gr.Interface(fn=process_image,
|
| 109 |
-
inputs=[gr.inputs.Image(type="filepath", label="Input Image")
|
| 110 |
-
gr.inputs.Radio(
|
| 111 |
-
[
|
| 112 |
-
'add 5 paths one by one',
|
| 113 |
-
'add 8 paths one by one',
|
| 114 |
-
'add [1,3,5,7] paths',
|
| 115 |
-
'add [1,2,4,8,16,32,32,32...] total 128 paths',
|
| 116 |
-
'add [1,2,4,8,16,32,32,32...] total 256 paths',
|
| 117 |
-
],
|
| 118 |
-
type="value",
|
| 119 |
-
default='add 5 paths one by one',
|
| 120 |
-
label='experiment id'
|
| 121 |
-
)
|
| 122 |
],
|
| 123 |
outputs=[gr.outputs.Image(label="predicted depth", type="pil"),
|
| 124 |
gr.outputs.Image3D(label="3d mesh reconstruction", clear_color=[
|
|
|
|
| 11 |
model = DPTForDepthEstimation.from_pretrained("Intel/dpt-large")
|
| 12 |
|
| 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(
|
|
|
|
| 106 |
examples = [["examples/" + img] for img in os.listdir("examples/")]
|
| 107 |
|
| 108 |
iface = gr.Interface(fn=process_image,
|
| 109 |
+
inputs=[gr.inputs.Image(type="filepath", label="Input Image")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
],
|
| 111 |
outputs=[gr.outputs.Image(label="predicted depth", type="pil"),
|
| 112 |
gr.outputs.Image3D(label="3d mesh reconstruction", clear_color=[
|