A Python library for computer vision annotation tasks using Dash
Project description
Dash Annotate CV - A dash library for computer vision annotation tasks
dash_annotate_cv
is a Python Dash library for computer vision annotation tasks. It exposes reusable annotation components in a library format for dash
.
Supported tasks:
- Annotation of images (whole image labels)
Roadmap for future tasks:
- Annotating multiple labels per image
- Annotating bounding boxes
- Annotating videos
- Annotating tags
Note: this library is not meant for production usage. It is meant to be used for quick prototyping and testing of annotation tasks.
Getting started
-
(Recommended) Create a new conda environment.
conda create -n dash_annotate_cv python=3.11 conda activate dash_annotate_cv
-
Install.
pip install dash_annotate_cv
Or from the repository:
pip install -r requirements.txt pip install -e .
-
Run the example.
cd examples python example.py
Example
You can also check out the examples.
# Import the library
import dash_annotate_cv as dac
# Other imports
from dash import Dash, html
import dash_bootstrap_components as dbc
from skimage import data
# Load some images
images = [ ("chelsea",data.chelsea()), ("astronaut",data.astronaut()), ("camera",data.camera()) ]
# Set up the image and label sources
image_source = dac.ImageSource(images=images)
label_source = dac.LabelSource(labels=["astronaut", "camera", "cat"])
# Set up writing
storage = dac.AnnotationStorage(storage_type=dac.AnnotationStorage.Type.JSON, json_file="annotations.json")
app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
app.layout = dbc.Container([
html.H1("Annotate Images"),
dac.AnnotateImageLabelsAIO(label_source, image_source, annotation_storage=storage)
])
app.run(debug=True)
The result is shown in the gif above.
Loading the annotations & format
Loading the annotations is as simple as:
with open("annotations.json","r") as f:
annotations = dac.ImageAnnotations.from_dict(json.load(f))
See the ImageAnnotations
class for more information on the format.
Dev
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for dash_annotate_cv-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f88f12ec4e711af417ef32c8231382b37138762a1a5fc0b092cebb99f12a195 |
|
MD5 | 8dda02648b5b16737dd89486d13e5300 |
|
BLAKE2b-256 | f691fcc90a28896d683e80ccf0541018d407b8f9af0a2fcd42bd237cf11e5fc5 |