The AutoLabeling Pipeline automates the process of labeling data for computer vision tasks. It is designed to handle large datasets efficiently and supports both CPU and GPU environments using Docker.
Before you begin, ensure you have the following installed:
- Docker (latest version)
- Docker Compose
- NVIDIA Container Toolkit (if using GPU acceleration)
- Git
git clone https://github.com/your-username/AutoLabeling_Pipeline.git
cd AutoLabeling_Pipeline
docker build -t auto_labeling .
It will Automatically switched to GPU if available othervise it'll use CPU
docker compose run auto_labeling --autolabel
without using docker-compose.yml
GPU configs and To run Docker with X11 forwarding:
xhost +local:docker
sudo docker run --rm \
-v $(pwd)/videos:/app/videos \
-v $(pwd)/trimmed_videos:/app/trimmed_videos \
-v $(pwd)/frames:/app/frames \
-v $(pwd)/resized_frames:/app/resized_frames \
-v $(pwd)/labeled_data:/app/labeled_data \
-v $(pwd)/auto_labeling.sh:/app/auto_labeling.sh \
-v $(pwd)/pipeline/model_selector.py:/app/pipeline/model_selector.py \
-v $(pwd)/pipeline/helper.py:/app/pipeline/helper.py \
-v $(pwd)/pipeline/tool.py:/app/pipeline/tool.py \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-p 8000:8000 \
auto_labeling --full_pipeline
AutoLabeling_Pipeline/
βββ docker-compose.yml # Docker Compose file
βββ Dockerfile # Image build configuration
βββ auto_labeling.sh # Entry script
βββ pipeline/ # Pipeline scripts
β βββ main.py # Core processing logic
β βββ model_selector.py # Model selection logic
β βββ tool.py # Helper tools
β βββ helper.py # Additional helpers
βββ requirements.txt # Dependencies
βββ videos/ # Downloaded videos
βββ trimmed_videos/ # Trimmed video clips
βββ frames/ # Extracted frames
βββ resized_frames/ # Resized frames
βββ labeled_data/ # Auto-labeled data
docker run -it --entrypoint /bin/bash auto_labeling
ls /app
ls /var/log
docker ps
docker compose down --remove-orphans
docker system prune -a
docker images -f "dangling=true"
docker rmi $(docker images -f "dangling=true" -q)
- Download Videos
- Trim Videos
- Extract Frames
- Resize Frames
- Auto-Label Frames
- Annotate Images
- Run the Full Pipeline
docker compose run auto_labeling --full_pipeline
This will execute all the steps. Uncomment the necessary lines in auto_labeling.sh
to customize the flow.
- GPU Selection:
- Set
CUDA_VISIBLE_DEVICES=0
to use GPU indocker-compose.yml
. - Set
CUDA_VISIBLE_DEVICES=""
to force CPU usage indocker-compose.yml
.
- Set
- GPU Selection:
- To transfer ownership of all the directories and files created via Docker.
sudo chown -R $(whoami):$(whoami) /