kyamagu commited on
Commit
0613dd1
·
verified ·
1 Parent(s): d9c675a

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -1,7 +1,7 @@
1
  ---
2
- tags: [gradio-custom-component, SimpleImage, image, annotation, bbox]
3
- title: gradio_imageannotator
4
- short_description: Bounding box annotation tool
5
  colorFrom: blue
6
  colorTo: yellow
7
  sdk: gradio
@@ -10,9 +10,9 @@ app_file: space.py
10
  ---
11
 
12
  # `gradio_bbox_annotator`
13
- <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.1.0%20-%20orange"> <a href="https://github.com/kyamagu/gradio-bbox-annotator/issues" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Issues-white?logo=github&logoColor=black"></a>
14
 
15
- Bounding box annotation tool
16
 
17
  ## Installation
18
 
@@ -32,9 +32,9 @@ example = BBoxAnnotator().example_value()
32
 
33
  demo = gr.Interface(
34
  lambda x: x,
35
- BBoxAnnotator(value=example, show_label=False), # interactive version of your component
36
- BBoxAnnotator(show_label=False), # static version of your component
37
- examples=[[example]], # uncomment this line to view the "example version" of your component
38
  )
39
 
40
 
 
1
  ---
2
+ tags: [gradio-custom-component, BBoxAnnotator, image, annotation, bbox]
3
+ title: gradio_bbox_annotator
4
+ short_description: Bounding box annotation tool for Gradio
5
  colorFrom: blue
6
  colorTo: yellow
7
  sdk: gradio
 
10
  ---
11
 
12
  # `gradio_bbox_annotator`
13
+ <a href="https://pypi.org/project/gradio_bbox_annotator/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_bbox_annotator"></a> <a href="https://github.com/kyamagu/gradio-bbox-annotator/issues" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Issues-white?logo=github&logoColor=black"></a> <a href="https://huggingface.co/spaces/kyamagu/gradio_bbox_annotator/discussions" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/%F0%9F%A4%97%20Discuss-%23097EFF?style=flat&logoColor=black"></a>
14
 
15
+ Bounding box annotation tool for Gradio
16
 
17
  ## Installation
18
 
 
32
 
33
  demo = gr.Interface(
34
  lambda x: x,
35
+ BBoxAnnotator(value=example, show_label=False), # input is interactive
36
+ BBoxAnnotator(show_label=False), # output is static
37
+ examples=[[example]], # examples are in the gallery format
38
  )
39
 
40
 
app.py CHANGED
@@ -7,9 +7,9 @@ example = BBoxAnnotator().example_value()
7
 
8
  demo = gr.Interface(
9
  lambda x: x,
10
- BBoxAnnotator(value=example, show_label=False), # interactive version of your component
11
- BBoxAnnotator(show_label=False), # static version of your component
12
- examples=[[example]], # uncomment this line to view the "example version" of your component
13
  )
14
 
15
 
 
7
 
8
  demo = gr.Interface(
9
  lambda x: x,
10
+ BBoxAnnotator(value=example, show_label=False), # input is interactive
11
+ BBoxAnnotator(show_label=False), # output is static
12
+ examples=[[example]], # examples are in the gallery format
13
  )
14
 
15
 
space.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
  from app import demo as app
4
  import os
5
 
6
- _docs = {'BBoxAnnotator': {'description': 'Creates an image component that can be used to upload images with bounding box annotations (as an input)\nor display images with bounding box annotations (as an output). This component can be used to annotate\nimages.', 'members': {'__init__': {'value': {'type': 'str\n | Path\n | tuple[\n str | Path,\n list[tuple[int, int, int, int, str | None]],\n ]\n | None', 'default': 'None', 'description': 'A path or URL for the image, or a tuple of the image and list of (left, top, right, bottom, label) annotations.'}, 'categories': {'type': 'list[str] | None', 'default': 'None', 'description': 'a list of categories to choose from when annotating the image.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'the label for this component, displayed above the component if `show_label` is `True` and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component corresponds to.'}, 'every': {'type': 'Timer | float | None', 'default': 'None', 'description': 'Continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.'}, 'inputs': {'type': 'Component | Sequence[Component] | set[Component] | None', 'default': 'None', 'description': 'Components that are used as inputs to calculate `value` if `value` is a function (has no effect otherwise). `value` is recalculated any time the inputs change.'}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'show_download_button': {'type': 'bool', 'default': 'True', 'description': 'If True, will display button to download annotations.'}, 'container': {'type': 'bool', 'default': 'True', 'description': 'If True, will place the component in a container - providing some extra padding around the border.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will allow users to upload and edit an image; if False, can only be used to display images. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}, 'key': {'type': 'int | str | None', 'default': 'None', 'description': 'if assigned, will be used to assume identity across a re-render. Components that have the same key across a re-render will have their value preserved.'}}, 'postprocess': {'value': {'type': 'str\n | pathlib.Path\n | tuple[\n str | pathlib.Path,\n list[tuple[int, int, int, int, str | None]],\n ]\n | None', 'description': 'Expects a `str` or `pathlib.Path` object containing the path to the image, or a tuple of'}}, 'preprocess': {'return': {'type': 'tuple[str, list[tuple[int, int, int, int, str | None]]]\n | None', 'description': 'A tuple of `str` containing the path to the image and a list of annotations.'}, 'value': None}}, 'events': {'clear': {'type': None, 'default': None, 'description': 'This listener is triggered when the user clears the BBoxAnnotator using the clear button for the component.'}, 'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the BBoxAnnotator changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'upload': {'type': None, 'default': None, 'description': 'This listener is triggered when the user uploads a file into the BBoxAnnotator.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'BBoxAnnotator': []}}}
7
 
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
@@ -21,10 +21,10 @@ with gr.Blocks(
21
  # `gradio_bbox_annotator`
22
 
23
  <div style="display: flex; gap: 7px;">
24
- <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.1.0%20-%20orange"> <a href="https://github.com/kyamagu/gradio-bbox-annotator/issues" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Issues-white?logo=github&logoColor=black"></a>
25
  </div>
26
 
27
- Bounding box annotation tool
28
  """, elem_classes=["md-custom"], header_links=True)
29
  app.render()
30
  gr.Markdown(
@@ -47,9 +47,9 @@ example = BBoxAnnotator().example_value()
47
 
48
  demo = gr.Interface(
49
  lambda x: x,
50
- BBoxAnnotator(value=example, show_label=False), # interactive version of your component
51
- BBoxAnnotator(show_label=False), # static version of your component
52
- examples=[[example]], # uncomment this line to view the "example version" of your component
53
  )
54
 
55
 
 
3
  from app import demo as app
4
  import os
5
 
6
+ _docs = {'BBoxAnnotator': {'description': 'Bounding box annotator component.\n\nCreates an image component that can be used to upload images with bounding box annotations (as an input)\nor display images with bounding box annotations (as an output). This component can be used to annotate\nimages.', 'members': {'__init__': {'value': {'type': 'str\n | Path\n | tuple[\n str | Path,\n list[tuple[int, int, int, int, str | None]],\n ]\n | None', 'default': 'None', 'description': 'A path or URL for the image, or a tuple of the image and list of (left, top, right, bottom, label) annotations.'}, 'categories': {'type': 'list[str] | None', 'default': 'None', 'description': 'a list of categories to choose from when annotating the image.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'the label for this component, displayed above the component if `show_label` is `True` and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component corresponds to.'}, 'every': {'type': 'Timer | float | None', 'default': 'None', 'description': 'Continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.'}, 'inputs': {'type': 'Component | Sequence[Component] | set[Component] | None', 'default': 'None', 'description': 'Components that are used as inputs to calculate `value` if `value` is a function (has no effect otherwise). `value` is recalculated any time the inputs change.'}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'show_download_button': {'type': 'bool', 'default': 'True', 'description': 'If True, will display button to download annotations.'}, 'container': {'type': 'bool', 'default': 'True', 'description': 'If True, will place the component in a container - providing some extra padding around the border.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will allow users to upload and edit an image; if False, can only be used to display images. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}, 'key': {'type': 'int | str | None', 'default': 'None', 'description': 'if assigned, will be used to assume identity across a re-render. Components that have the same key across a re-render will have their value preserved.'}}, 'postprocess': {'value': {'type': 'str\n | pathlib.Path\n | tuple[\n str | pathlib.Path,\n list[tuple[int, int, int, int, str | None]],\n ]\n | None', 'description': 'Expects a `str` or `pathlib.Path` object containing the path to the image, or a tuple of'}}, 'preprocess': {'return': {'type': 'tuple[str, list[tuple[int, int, int, int, str | None]]]\n | None', 'description': 'A tuple of `str` containing the path to the image and a list of annotations.'}, 'value': None}}, 'events': {'clear': {'type': None, 'default': None, 'description': 'This listener is triggered when the user clears the BBoxAnnotator using the clear button for the component.'}, 'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the BBoxAnnotator changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'upload': {'type': None, 'default': None, 'description': 'This listener is triggered when the user uploads a file into the BBoxAnnotator.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'BBoxAnnotator': []}}}
7
 
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
 
21
  # `gradio_bbox_annotator`
22
 
23
  <div style="display: flex; gap: 7px;">
24
+ <a href="https://pypi.org/project/gradio_bbox_annotator/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_bbox_annotator"></a> <a href="https://github.com/kyamagu/gradio-bbox-annotator/issues" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Issues-white?logo=github&logoColor=black"></a> <a href="https://huggingface.co/spaces/kyamagu/gradio_bbox_annotator/discussions" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/%F0%9F%A4%97%20Discuss-%23097EFF?style=flat&logoColor=black"></a>
25
  </div>
26
 
27
+ Bounding box annotation tool for Gradio
28
  """, elem_classes=["md-custom"], header_links=True)
29
  app.render()
30
  gr.Markdown(
 
47
 
48
  demo = gr.Interface(
49
  lambda x: x,
50
+ BBoxAnnotator(value=example, show_label=False), # input is interactive
51
+ BBoxAnnotator(show_label=False), # output is static
52
+ examples=[[example]], # examples are in the gallery format
53
  )
54
 
55
 
src/README.md CHANGED
@@ -1,7 +1,7 @@
1
  ---
2
- tags: [gradio-custom-component, SimpleImage, image, annotation, bbox]
3
- title: gradio_imageannotator
4
- short_description: Bounding box annotation tool
5
  colorFrom: blue
6
  colorTo: yellow
7
  sdk: gradio
@@ -10,9 +10,9 @@ app_file: space.py
10
  ---
11
 
12
  # `gradio_bbox_annotator`
13
- <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.1.0%20-%20orange"> <a href="https://github.com/kyamagu/gradio-bbox-annotator/issues" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Issues-white?logo=github&logoColor=black"></a>
14
 
15
- Bounding box annotation tool
16
 
17
  ## Installation
18
 
@@ -32,9 +32,9 @@ example = BBoxAnnotator().example_value()
32
 
33
  demo = gr.Interface(
34
  lambda x: x,
35
- BBoxAnnotator(value=example, show_label=False), # interactive version of your component
36
- BBoxAnnotator(show_label=False), # static version of your component
37
- examples=[[example]], # uncomment this line to view the "example version" of your component
38
  )
39
 
40
 
 
1
  ---
2
+ tags: [gradio-custom-component, BBoxAnnotator, image, annotation, bbox]
3
+ title: gradio_bbox_annotator
4
+ short_description: Bounding box annotation tool for Gradio
5
  colorFrom: blue
6
  colorTo: yellow
7
  sdk: gradio
 
10
  ---
11
 
12
  # `gradio_bbox_annotator`
13
+ <a href="https://pypi.org/project/gradio_bbox_annotator/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_bbox_annotator"></a> <a href="https://github.com/kyamagu/gradio-bbox-annotator/issues" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Issues-white?logo=github&logoColor=black"></a> <a href="https://huggingface.co/spaces/kyamagu/gradio_bbox_annotator/discussions" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/%F0%9F%A4%97%20Discuss-%23097EFF?style=flat&logoColor=black"></a>
14
 
15
+ Bounding box annotation tool for Gradio
16
 
17
  ## Installation
18
 
 
32
 
33
  demo = gr.Interface(
34
  lambda x: x,
35
+ BBoxAnnotator(value=example, show_label=False), # input is interactive
36
+ BBoxAnnotator(show_label=False), # output is static
37
+ examples=[[example]], # examples are in the gallery format
38
  )
39
 
40
 
src/backend/gradio_bbox_annotator/bbox_annotator.py CHANGED
@@ -1,4 +1,4 @@
1
- """gr.BboxAnnotator() component."""
2
 
3
  from __future__ import annotations
4
 
@@ -48,6 +48,8 @@ class AnnotatedImage(GradioModel):
48
  @document()
49
  class BBoxAnnotator(Component):
50
  """
 
 
51
  Creates an image component that can be used to upload images with bounding box annotations (as an input)
52
  or display images with bounding box annotations (as an output). This component can be used to annotate
53
  images.
 
1
+ """BboxAnnotator() component."""
2
 
3
  from __future__ import annotations
4
 
 
48
  @document()
49
  class BBoxAnnotator(Component):
50
  """
51
+ Bounding box annotator component.
52
+
53
  Creates an image component that can be used to upload images with bounding box annotations (as an input)
54
  or display images with bounding box annotations (as an output). This component can be used to annotate
55
  images.
src/backend/gradio_bbox_annotator/bbox_annotator.pyi CHANGED
@@ -1,4 +1,4 @@
1
- """gr.BBoxAnnotator() component."""
2
 
3
  from __future__ import annotations
4
 
@@ -49,6 +49,8 @@ from gradio.events import Dependency
49
  @document()
50
  class BBoxAnnotator(Component):
51
  """
 
 
52
  Creates an image component that can be used to upload images with bounding box annotations (as an input)
53
  or display images with bounding box annotations (as an output). This component can be used to annotate
54
  images.
 
1
+ """BBoxAnnotator() component."""
2
 
3
  from __future__ import annotations
4
 
 
49
  @document()
50
  class BBoxAnnotator(Component):
51
  """
52
+ Bounding box annotator component.
53
+
54
  Creates an image component that can be used to upload images with bounding box annotations (as an input)
55
  or display images with bounding box annotations (as an output). This component can be used to annotate
56
  images.
src/demo/app.py CHANGED
@@ -7,9 +7,9 @@ example = BBoxAnnotator().example_value()
7
 
8
  demo = gr.Interface(
9
  lambda x: x,
10
- BBoxAnnotator(value=example, show_label=False), # interactive version of your component
11
- BBoxAnnotator(show_label=False), # static version of your component
12
- examples=[[example]], # uncomment this line to view the "example version" of your component
13
  )
14
 
15
 
 
7
 
8
  demo = gr.Interface(
9
  lambda x: x,
10
+ BBoxAnnotator(value=example, show_label=False), # input is interactive
11
+ BBoxAnnotator(show_label=False), # output is static
12
+ examples=[[example]], # examples are in the gallery format
13
  )
14
 
15
 
src/demo/space.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
  from app import demo as app
4
  import os
5
 
6
- _docs = {'BBoxAnnotator': {'description': 'Creates an image component that can be used to upload images with bounding box annotations (as an input)\nor display images with bounding box annotations (as an output). This component can be used to annotate\nimages.', 'members': {'__init__': {'value': {'type': 'str\n | Path\n | tuple[\n str | Path,\n list[tuple[int, int, int, int, str | None]],\n ]\n | None', 'default': 'None', 'description': 'A path or URL for the image, or a tuple of the image and list of (left, top, right, bottom, label) annotations.'}, 'categories': {'type': 'list[str] | None', 'default': 'None', 'description': 'a list of categories to choose from when annotating the image.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'the label for this component, displayed above the component if `show_label` is `True` and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component corresponds to.'}, 'every': {'type': 'Timer | float | None', 'default': 'None', 'description': 'Continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.'}, 'inputs': {'type': 'Component | Sequence[Component] | set[Component] | None', 'default': 'None', 'description': 'Components that are used as inputs to calculate `value` if `value` is a function (has no effect otherwise). `value` is recalculated any time the inputs change.'}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'show_download_button': {'type': 'bool', 'default': 'True', 'description': 'If True, will display button to download annotations.'}, 'container': {'type': 'bool', 'default': 'True', 'description': 'If True, will place the component in a container - providing some extra padding around the border.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will allow users to upload and edit an image; if False, can only be used to display images. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}, 'key': {'type': 'int | str | None', 'default': 'None', 'description': 'if assigned, will be used to assume identity across a re-render. Components that have the same key across a re-render will have their value preserved.'}}, 'postprocess': {'value': {'type': 'str\n | pathlib.Path\n | tuple[\n str | pathlib.Path,\n list[tuple[int, int, int, int, str | None]],\n ]\n | None', 'description': 'Expects a `str` or `pathlib.Path` object containing the path to the image, or a tuple of'}}, 'preprocess': {'return': {'type': 'tuple[str, list[tuple[int, int, int, int, str | None]]]\n | None', 'description': 'A tuple of `str` containing the path to the image and a list of annotations.'}, 'value': None}}, 'events': {'clear': {'type': None, 'default': None, 'description': 'This listener is triggered when the user clears the BBoxAnnotator using the clear button for the component.'}, 'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the BBoxAnnotator changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'upload': {'type': None, 'default': None, 'description': 'This listener is triggered when the user uploads a file into the BBoxAnnotator.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'BBoxAnnotator': []}}}
7
 
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
@@ -21,10 +21,10 @@ with gr.Blocks(
21
  # `gradio_bbox_annotator`
22
 
23
  <div style="display: flex; gap: 7px;">
24
- <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.1.0%20-%20orange"> <a href="https://github.com/kyamagu/gradio-bbox-annotator/issues" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Issues-white?logo=github&logoColor=black"></a>
25
  </div>
26
 
27
- Bounding box annotation tool
28
  """, elem_classes=["md-custom"], header_links=True)
29
  app.render()
30
  gr.Markdown(
@@ -47,9 +47,9 @@ example = BBoxAnnotator().example_value()
47
 
48
  demo = gr.Interface(
49
  lambda x: x,
50
- BBoxAnnotator(value=example, show_label=False), # interactive version of your component
51
- BBoxAnnotator(show_label=False), # static version of your component
52
- examples=[[example]], # uncomment this line to view the "example version" of your component
53
  )
54
 
55
 
 
3
  from app import demo as app
4
  import os
5
 
6
+ _docs = {'BBoxAnnotator': {'description': 'Bounding box annotator component.\n\nCreates an image component that can be used to upload images with bounding box annotations (as an input)\nor display images with bounding box annotations (as an output). This component can be used to annotate\nimages.', 'members': {'__init__': {'value': {'type': 'str\n | Path\n | tuple[\n str | Path,\n list[tuple[int, int, int, int, str | None]],\n ]\n | None', 'default': 'None', 'description': 'A path or URL for the image, or a tuple of the image and list of (left, top, right, bottom, label) annotations.'}, 'categories': {'type': 'list[str] | None', 'default': 'None', 'description': 'a list of categories to choose from when annotating the image.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'the label for this component, displayed above the component if `show_label` is `True` and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component corresponds to.'}, 'every': {'type': 'Timer | float | None', 'default': 'None', 'description': 'Continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.'}, 'inputs': {'type': 'Component | Sequence[Component] | set[Component] | None', 'default': 'None', 'description': 'Components that are used as inputs to calculate `value` if `value` is a function (has no effect otherwise). `value` is recalculated any time the inputs change.'}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'show_download_button': {'type': 'bool', 'default': 'True', 'description': 'If True, will display button to download annotations.'}, 'container': {'type': 'bool', 'default': 'True', 'description': 'If True, will place the component in a container - providing some extra padding around the border.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will allow users to upload and edit an image; if False, can only be used to display images. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}, 'key': {'type': 'int | str | None', 'default': 'None', 'description': 'if assigned, will be used to assume identity across a re-render. Components that have the same key across a re-render will have their value preserved.'}}, 'postprocess': {'value': {'type': 'str\n | pathlib.Path\n | tuple[\n str | pathlib.Path,\n list[tuple[int, int, int, int, str | None]],\n ]\n | None', 'description': 'Expects a `str` or `pathlib.Path` object containing the path to the image, or a tuple of'}}, 'preprocess': {'return': {'type': 'tuple[str, list[tuple[int, int, int, int, str | None]]]\n | None', 'description': 'A tuple of `str` containing the path to the image and a list of annotations.'}, 'value': None}}, 'events': {'clear': {'type': None, 'default': None, 'description': 'This listener is triggered when the user clears the BBoxAnnotator using the clear button for the component.'}, 'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the BBoxAnnotator changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'upload': {'type': None, 'default': None, 'description': 'This listener is triggered when the user uploads a file into the BBoxAnnotator.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'BBoxAnnotator': []}}}
7
 
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
 
21
  # `gradio_bbox_annotator`
22
 
23
  <div style="display: flex; gap: 7px;">
24
+ <a href="https://pypi.org/project/gradio_bbox_annotator/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_bbox_annotator"></a> <a href="https://github.com/kyamagu/gradio-bbox-annotator/issues" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Issues-white?logo=github&logoColor=black"></a> <a href="https://huggingface.co/spaces/kyamagu/gradio_bbox_annotator/discussions" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/%F0%9F%A4%97%20Discuss-%23097EFF?style=flat&logoColor=black"></a>
25
  </div>
26
 
27
+ Bounding box annotation tool for Gradio
28
  """, elem_classes=["md-custom"], header_links=True)
29
  app.render()
30
  gr.Markdown(
 
47
 
48
  demo = gr.Interface(
49
  lambda x: x,
50
+ BBoxAnnotator(value=example, show_label=False), # input is interactive
51
+ BBoxAnnotator(show_label=False), # output is static
52
+ examples=[[example]], # examples are in the gallery format
53
  )
54
 
55
 
src/pyproject.toml CHANGED
@@ -8,8 +8,8 @@ build-backend = "hatchling.build"
8
 
9
  [project]
10
  name = "gradio_bbox_annotator"
11
- version = "0.1.0"
12
- description = "Bounding box annotation tool"
13
  readme = "README.md"
14
  license = "apache-2.0"
15
  requires-python = ">=3.10"
@@ -22,7 +22,6 @@ classifiers = [
22
  'Operating System :: OS Independent',
23
  'Programming Language :: Python :: 3',
24
  'Programming Language :: Python :: 3 :: Only',
25
- 'Programming Language :: Python :: 3.9',
26
  'Programming Language :: Python :: 3.10',
27
  'Programming Language :: Python :: 3.11',
28
  'Programming Language :: Python :: 3.12',
@@ -34,7 +33,7 @@ classifiers = [
34
 
35
  [project.urls]
36
  repository = "https://github.com/kyamagu/gradio-bbox-annotator"
37
- # space = "your space url"
38
 
39
  [project.optional-dependencies]
40
  dev = ["build", "twine"]
 
8
 
9
  [project]
10
  name = "gradio_bbox_annotator"
11
+ version = "0.1.1"
12
+ description = "Bounding box annotation tool for Gradio"
13
  readme = "README.md"
14
  license = "apache-2.0"
15
  requires-python = ">=3.10"
 
22
  'Operating System :: OS Independent',
23
  'Programming Language :: Python :: 3',
24
  'Programming Language :: Python :: 3 :: Only',
 
25
  'Programming Language :: Python :: 3.10',
26
  'Programming Language :: Python :: 3.11',
27
  'Programming Language :: Python :: 3.12',
 
33
 
34
  [project.urls]
35
  repository = "https://github.com/kyamagu/gradio-bbox-annotator"
36
+ space = "https://huggingface.co/spaces/kyamagu/gradio_bbox_annotator"
37
 
38
  [project.optional-dependencies]
39
  dev = ["build", "twine"]