How you can leverage the Roboflow inference API to automatically annotate your images
Automatically annotate your dataset with Roboflow inference API
Automatic image labeling can save you tons of time and is especially useful when:
- You already have a dataset and a model trained with Roboflow, but you have noticed that your model does not perform well in certain circumstances. You can then expand your dataset with a new batch of images to retrain the model and improve its accuracy. However, there is no point in labeling images those manually. You can simply use the model you already have, do the automatic annotation and just refine the labels.
- You want to create a new dataset, but you have found on Roboflow Universe a model capable of detecting objects visually similar to those in your future dataset. You can do automatic annotation and then refine the labels by changing their class name or removing redundant bounding boxes.
Open terminal and clone
auto-annotaterepository and install it on your machine.
# clone repository and navigate to root directory
git clone [email protected]:roboflow/auto-annotate.git
# setup python environment and activate it
python3 -m venv venv
pip install -e .
ROBOFLOW_API_KEYfrom your Roboflow profile and export it as environment variable. You can also pass it directly as
export ROBOFLOW_API_KEY= ...
a2.annotatescript to automatically annotate your images.
python -m a2.annotate \
--source_image_directory ... \
--target_annotation_directory ... \
--roboflow_project_id ... \