Auto Labeler is an automated image annotation tool that leverages the power of OpenAI's GPT-4 Vision API to detect objects in images and provide bounding box annotations.
- Object Detection: Automatically identifies objects in images.
- Bounding Box Annotations: Generates bounding boxes around detected objects.
- Multiple Formats: Supports saving annotations in both TensorFlow Object Detection and JSON formats.
- Custom Labels: Allows for specifying custom object labels for detection.
- Python 3.6 or higher
Clone the repository to your local machine:
git clone https://github.com/Flode-Labs/auto-labeler.git
- Install required packages:
pip install -r requirements.txt
- Set your OpenAI API key:
api_key = "YOUR_API_KEY"
- Specify the path of the folder with the images that you want to label:
input_folder = '/path/to/input/folder'
- Specify the path of the folder where you want to save the labels:
output_folder = '/path/to/output/folder'
- Specify the format in which you want to save the labels:
output_format = 'json' # or 'tf'
- Define the list of labels you want to detect:
labels = ['cat', 'dog', 'bird']
- Run the main script:
python main.py
encode_image(image_path)
: Encodes the image to base64 format.detect_objects(image_path, labels)
: Detects objects in the image as specified by labels.save_tf_annotations(...)
: Saves annotations in TensorFlow Object Detection XML format.save_json_annotations(...)
: Saves annotations in JSON format.process_images_in_folder(...)
: Processes multiple images in a specified folder.
- OpenAI for providing the GPT-4 Vision API.
- The Python community for maintaining and improving the libraries used in this project.
Ensure you replace YOUR_API_KEY
with your actual OpenAI API key.