Annotate API

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-annotate repository and install it on your machine.
# clone repository and navigate to root directory
git clone [email protected]:roboflow/auto-annotate.git
cd auto-annotate
# setup python environment and activate it
python3 -m venv venv
source venv/bin/activate
# install
pip install -e .
Copy the ROBOFLOW_API_KEY from your Roboflow profile and export it as environment variable. You can also pass it directly as roboflow_api_key parameter to a2.annotate script.
export ROBOFLOW_API_KEY= ...
Execute a2.annotate script to automatically annotate your images.
python -m a2.annotate \
--source_image_directory ... \
--target_annotation_directory ... \
--roboflow_project_id ... \
--roboflow_project_version ...