Skip to content

Commit

Permalink
docs: Add documentation, include in Tour. #1323
Browse files Browse the repository at this point in the history
  • Loading branch information
mturoci committed May 12, 2022
1 parent 713bbac commit dd0af81
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions py/examples/tour.conf
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ table_menu.py
table_markdown.py
tags.py
image.py
image_annotator.py
file_stream.py
frame.py
frame_path.py
Expand Down
1 change: 1 addition & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ module.exports = {
"widgets/form/file_upload",
"widgets/form/frame",
"widgets/form/image",
"widgets/form/image_annotator",
"widgets/form/inline",
"widgets/form/label",
"widgets/form/link",
Expand Down
29 changes: 29 additions & 0 deletions website/widgets/form/image_annotator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Image Annotator
keywords:
- form
- image_annotator
custom_edit_url: null
---

Use image annotator when you need to draw bounding boxes over an image. Useful for computer vision.

```py
image = 'https://images.pexels.com/photos/2696064/pexels-photo-2696064.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'
q.page['example'] = ui.form_card(box='1 1 9 10', items=[
ui.image_annotator(
name='annotator',
title='Drag to annotate',
image=image,
image_height='700px',
tags=[
ui.image_annotator_tag(name='p', label='Person', color='$cyan'),
ui.image_annotator_tag(name='f', label='Food', color='$blue'),
],
items=[
ui.image_annotator_item(shape=ui.image_annotator_rect(x1=649, y1=393, x2=383, y2=25), tag='p'),
],
),
ui.button(name='submit', label='Submit', primary=True)
])
```

0 comments on commit dd0af81

Please sign in to comment.