{"id":18418948,"url":"https://github.com/smrfeld/dash-annotate-cv","last_synced_at":"2025-04-07T13:31:26.384Z","repository":{"id":192676742,"uuid":"687282100","full_name":"smrfeld/dash-annotate-cv","owner":"smrfeld","description":"Dash components for computer vision annotation tasks","archived":false,"fork":false,"pushed_at":"2024-04-28T06:01:38.000Z","size":1369,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T19:03:24.015Z","etag":null,"topics":["annotations","computer-vision","dash","data-labeling","machine-learning","plotly","plotly-dash"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/dash-annotate-cv/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smrfeld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-05T03:18:55.000Z","updated_at":"2024-11-24T19:42:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7c5284f-ec5e-4d60-b569-e0b721a89567","html_url":"https://github.com/smrfeld/dash-annotate-cv","commit_stats":{"total_commits":40,"total_committers":3,"mean_commits":"13.333333333333334","dds":"0.22499999999999998","last_synced_commit":"929f7811b5cedbeeed3a1398c5561785afbda54c"},"previous_names":["smrfeld/dash-annotate-cv"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smrfeld%2Fdash-annotate-cv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smrfeld%2Fdash-annotate-cv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smrfeld%2Fdash-annotate-cv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smrfeld%2Fdash-annotate-cv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smrfeld","download_url":"https://codeload.github.com/smrfeld/dash-annotate-cv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247661696,"owners_count":20975101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["annotations","computer-vision","dash","data-labeling","machine-learning","plotly","plotly-dash"],"created_at":"2024-11-06T04:15:05.605Z","updated_at":"2025-04-07T13:31:25.325Z","avatar_url":"https://github.com/smrfeld.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dash Annotate CV - A dash library for computer vision annotation tasks\n\n`dash_annotate_cv` is a Python Dash library for computer vision annotation tasks. It exposes reusable annotation components in a library format for `dash`.\n\n![](readme_gif_image_labels.gif)\n*Example of whole-image label annotations*\n\n![](readme_gif_bboxs.gif)\n*Example of bounding box annotations*\n\nSupported tasks:\n- [x] Annotation of images (whole image labels)\n- [x] Annotating multiple labels per image\n- [x] Annotating bounding boxes including labels\n- [x] Support for COCO format\n\nRoadmap for future tasks:\n- [ ] Support for more annotation formats: YOLO, etc.\n- [ ] Support for image segmentation tasks.\n- [ ] Support for skeleton annotation tasks.\n- [ ] Annotating video events\n- [ ] Annotating video tags\n\n**Note**: this library is not meant for production usage. It is meant to be used for quick prototyping and testing of annotation tasks.\n\n## Getting started\n\n1. (Recommended) Create a new conda environment.\n\n    ```bash\n    conda create -n dash_annotate_cv python=3.11\n    conda activate dash_annotate_cv\n    ```\n\n2. Install using pip:\n\n    ```bash\n    pip install dash_annotate_cv\n    ```\n\n    Or local install from the repository:\n\n    ```bash\n    git clone https://github.com/smrfeld/dash-annotate-cv \n    cd dash-annotate-cv\n    pip install -e .\n    ```\n\n3. Run the example as described next.\n\n## Examples\n\nThe app can be launched in two ways:\n1. A simple command line utility lets you get up and running quickly.\n2. The app can be launched by writing a short Python script, which lets you use the annotation components in a flexible way in your own Dash app. We follow the practices of resuable components in Dash described in [All-in-one components for Dash](https://dash.plotly.com/all-in-one-components).\n\nEach is described here briefly. You can also check out the [examples](examples).\n\n### Command line utility\n\nTo get started labeling immediately, you can use a simple command line utility. You just need to write a config YAML file. You can see the [examples](examples) directory for more examples - as simple example is as follows:\n\n```yaml\n# Annotation mode\n# image_labels = Annotate images with whole-image labels\n# bboxs = Annotate bounding boxes in each image\nmode: image_labels\n\n# Label source\nlabel_source:\n  labels:\n  - astronaut\n  - camera\n  - cat\n\n# Image source\nimage_source:\n\n  # Image source type\n  source_type: list_of_files\n\n  # List of files\n  list_of_files:\n  - ex_chelsea.jpg\n  - ex_astronaut.jpg\n  - ex_camera.jpg\n\n# Storage (optional)\nstorage:\n  storage_type: json\n  json_file: example.json\n\n# Options (optional)\noptions:\n\n  # How many labels can be selected per image\n  selection_mode: single\n```\n\nTo launch the app, simply run:\n\n```bash\ndacv conf.yml\n```\n\nNavigate to the default address `http://127.0.0.1:8050/` in your browser to use the app.\n\nUse `dacv -h` for a complete list of options. Or check out the [examples](examples) directory for more examples.\n\n### Python\n\nYou can use the library in your own Dash app. This is recommended as a more flexible way to create your own annotation interface. The following example shows how to use the library to annotate images with labels.\n\n```python\n# Import the library\nimport dash_annotate_cv as dac\n\n# Other imports\nfrom dash import Dash, html\nimport dash_bootstrap_components as dbc\nfrom skimage import data\n\n# Load some images\nimages = [ (\"chelsea\",data.chelsea()), (\"astronaut\",data.astronaut()), (\"camera\",data.camera()) ] # type: ignore\nimages_pil = [ (name,Image.fromarray(image)) for name,image in images ]\n\n# Set up the image and label sources\nimage_source = dac.ImageSource(images=images_pil)\nlabel_source = dac.LabelSource(labels=[\"astronaut\", \"camera\", \"cat\"])\n\n# Set up writing\nstorage = dac.AnnotationStorage(storage_types=[dac.StorageType.JSON], json_file=\"annotations.json\")\n\napp = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])\napp.layout = dbc.Container([\n    html.H1(\"Annotate Images\"),\n    dac.AnnotateImageLabelsAIO(label_source, image_source, annotation_storage=storage)\n    ])\napp.run(debug=True)\n```\n\nThe result is shown in the gif above. Check out the [examples](examples) directory for more examples.\n\n### Loading the annotations \u0026 format\n\nLoading the annotations is as simple as:\n\n```python\nwith open(\"annotations.json\",\"r\") as f:\n    annotations = dac.ImageAnnotations.from_dict(json.load(f))\n```\n\nSee the `ImageAnnotations` class for more information on the format.\n\n## Dev\n\nSome useful references:\n\n* [All-in-one components for Dash](https://dash.plotly.com/all-in-one-components)\n* [Image annotation in Dash](https://dash.plotly.com/annotations)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmrfeld%2Fdash-annotate-cv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmrfeld%2Fdash-annotate-cv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmrfeld%2Fdash-annotate-cv/lists"}