Spaces:
Runtime error
Runtime error
Shengyi Qian
commited on
Commit
•
b305be2
1
Parent(s):
8abd9ea
add error message and paper link
Browse files
app.py
CHANGED
@@ -96,7 +96,7 @@ def run_model(input_image):
|
|
96 |
|
97 |
mask = np.array(input_image['mask'])[:, :, :3].sum(axis=2)
|
98 |
if mask.sum() == 0:
|
99 |
-
raise gr.Error("No query point!")
|
100 |
ret, thresh = cv2.threshold(mask.astype(np.uint8), 50, 255, cv2.THRESH_BINARY)
|
101 |
contours, hierarchy = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
|
102 |
M = cv2.moments(contours[0])
|
@@ -216,7 +216,7 @@ examples = [
|
|
216 |
|
217 |
title = 'Understanding 3D Object Interaction from a Single Image'
|
218 |
description = """
|
219 |
-
<p style='text-align: center'> <a href='https://jasonqsy.github.io/3DOI/' target='_blank'>Project Page</a> | <a href='
|
220 |
Gradio demo for Understanding 3D Object Interaction from a Single Image. \n
|
221 |
You may click on of the examples or upload your own image. \n
|
222 |
After having the image, you can click on the image to create a single query point. You can then hit Run.\n
|
|
|
96 |
|
97 |
mask = np.array(input_image['mask'])[:, :, :3].sum(axis=2)
|
98 |
if mask.sum() == 0:
|
99 |
+
raise gr.Error("No query point! Please click on the image to create a query point.")
|
100 |
ret, thresh = cv2.threshold(mask.astype(np.uint8), 50, 255, cv2.THRESH_BINARY)
|
101 |
contours, hierarchy = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
|
102 |
M = cv2.moments(contours[0])
|
|
|
216 |
|
217 |
title = 'Understanding 3D Object Interaction from a Single Image'
|
218 |
description = """
|
219 |
+
<p style='text-align: center'> <a href='https://jasonqsy.github.io/3DOI/' target='_blank'>Project Page</a> | <a href='https://arxiv.org/abs/2305.09664' target='_blank'>Paper</a> | <a href='https://github.com/JasonQSY/3DOI' target='_blank'>Code</a></p>
|
220 |
Gradio demo for Understanding 3D Object Interaction from a Single Image. \n
|
221 |
You may click on of the examples or upload your own image. \n
|
222 |
After having the image, you can click on the image to create a single query point. You can then hit Run.\n
|