Update app.py
Browse files
app.py
CHANGED
|
@@ -82,6 +82,28 @@ def clear_bbox(bbox):
|
|
| 82 |
|
| 83 |
|
| 84 |
with gr.Blocks() as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
image = gr.State()
|
| 86 |
embedding = gr.State()
|
| 87 |
bbox = gr.State([[0, 0], [0, 0]])
|
|
|
|
| 82 |
|
| 83 |
|
| 84 |
with gr.Blocks() as demo:
|
| 85 |
+
gr.Markdown(
|
| 86 |
+
"""
|
| 87 |
+
# Instructions
|
| 88 |
+
1. Upload the image and press 'Send Image'
|
| 89 |
+
2. Wait until the word 'Done' appears on the 'Status' box
|
| 90 |
+
3. Click on the image where the upper left corner of the bbox should be
|
| 91 |
+
4. Click on the image where the lower right corner of the bbox should be
|
| 92 |
+
5. Check the coordinates using the 'bbox' box
|
| 93 |
+
6. Click on 'Send bounding box'
|
| 94 |
+
7. On the right side you will see the binary mask*
|
| 95 |
+
8. on the lower side you will see the points that made up the polygon*
|
| 96 |
+
9. Click on 'Clear bbox' to send another bounding box and repeat the steps from the thrid point
|
| 97 |
+
10. Repeat steps 3 to 9 until all the segments for this image are done
|
| 98 |
+
11. Click on the right corner of the image to remove it and repeat all the steps with the next
|
| 99 |
+
image
|
| 100 |
+
|
| 101 |
+
* If the binary mask is all black and the polygon is an empty list, it means the program did
|
| 102 |
+
not find any segment in the bbox. Make the bbox a little big bigger if that happens.
|
| 103 |
+
""")
|
| 104 |
+
|
| 105 |
+
|
| 106 |
+
|
| 107 |
image = gr.State()
|
| 108 |
embedding = gr.State()
|
| 109 |
bbox = gr.State([[0, 0], [0, 0]])
|