Spaces:
Running
Running
upd
Browse files- app.py +7 -9
- background.png +0 -0
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
from gradio_image_annotation import image_annotator
|
| 3 |
|
| 4 |
example_annotation = {
|
| 5 |
-
"image": "
|
| 6 |
"boxes": [],
|
| 7 |
}
|
| 8 |
|
|
@@ -27,16 +27,14 @@ def get_boxes_json(annotations):
|
|
| 27 |
|
| 28 |
with gr.Blocks() as demo:
|
| 29 |
with gr.Tab("DreamRenderer", id="DreamRenderer"):
|
| 30 |
-
annotator = image_annotator(
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
| 33 |
button_get = gr.Button("Get bounding boxes")
|
| 34 |
json_boxes = gr.JSON()
|
| 35 |
-
|
| 36 |
-
# button_add_label.click(
|
| 37 |
-
# add_label, [annotator, label_input], annotator
|
| 38 |
-
# )
|
| 39 |
button_get.click(get_boxes_json, annotator, json_boxes)
|
| 40 |
|
| 41 |
if __name__ == "__main__":
|
| 42 |
-
demo.launch()
|
|
|
|
| 2 |
from gradio_image_annotation import image_annotator
|
| 3 |
|
| 4 |
example_annotation = {
|
| 5 |
+
"image": "background.png",
|
| 6 |
"boxes": [],
|
| 7 |
}
|
| 8 |
|
|
|
|
| 27 |
|
| 28 |
with gr.Blocks() as demo:
|
| 29 |
with gr.Tab("DreamRenderer", id="DreamRenderer"):
|
| 30 |
+
annotator = image_annotator(example_annotation,
|
| 31 |
+
height=512,
|
| 32 |
+
width=512
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
button_get = gr.Button("Get bounding boxes")
|
| 36 |
json_boxes = gr.JSON()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
button_get.click(get_boxes_json, annotator, json_boxes)
|
| 38 |
|
| 39 |
if __name__ == "__main__":
|
| 40 |
+
demo.launch(share=True)
|
background.png
ADDED
|