Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,20 +3,28 @@ from gradio_client import Client, handle_file
|
|
| 3 |
|
| 4 |
def predict_depth(image):
|
| 5 |
client = Client("prs-eth/marigold")
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
return "No depth output available"
|
| 21 |
|
| 22 |
# Gradio Interface
|
|
|
|
| 3 |
|
| 4 |
def predict_depth(image):
|
| 5 |
client = Client("prs-eth/marigold")
|
| 6 |
+
try:
|
| 7 |
+
# Full parameter set assuming all are required
|
| 8 |
+
result = client.predict(
|
| 9 |
+
handle_file(image),
|
| 10 |
+
1, # Ensemble size
|
| 11 |
+
10, # Number of denoising steps
|
| 12 |
+
"0", # Processing resolution
|
| 13 |
+
handle_file('https://example.com/sample_file.pdf'), # Placeholder URL for required file inputs
|
| 14 |
+
handle_file('https://example.com/sample_file.pdf'),
|
| 15 |
+
handle_file('https://example.com/sample_file.pdf'),
|
| 16 |
+
0.5, # Relative near plane position
|
| 17 |
+
0.9, # Relative far plane position
|
| 18 |
+
10, # Embossing level
|
| 19 |
+
2, # Smoothing filter size
|
| 20 |
+
-50, # Near plane offset
|
| 21 |
+
api_name="/submit_depth_fn"
|
| 22 |
+
)
|
| 23 |
+
if result and result[0]:
|
| 24 |
+
return result[0]
|
| 25 |
+
except Exception as e:
|
| 26 |
+
return f"An error occurred: {str(e)}"
|
| 27 |
+
|
| 28 |
return "No depth output available"
|
| 29 |
|
| 30 |
# Gradio Interface
|