Skip to content

syedhamza671/testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c5d0b38 Β· Feb 10, 2025

History

11 Commits
Feb 10, 2025

Repository files navigation

AutoLabeling Pipeline

πŸ“¦ Project Overview

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.


πŸ› οΈ Prerequisites

Before you begin, ensure you have the following installed:

  • Docker (latest version)
  • Docker Compose
  • NVIDIA Container Toolkit (if using GPU acceleration)
  • Git

πŸš€ Cloning the Repository

git clone https://github.com/your-username/AutoLabeling_Pipeline.git
cd AutoLabeling_Pipeline

🐳 Building the Docker Image

docker build -t auto_labeling .

⚑ Running the AutoLabeling Pipeline

It will Automatically switched to GPU if available othervise it'll use CPU

1️⃣ Using Docker Compose (with docker-compose.yml):

docker compose run auto_labeling --autolabel

2️⃣ Using Docker (without docker-compose.yml):

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

πŸ‚ Directory Structure

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

πŸ” Interacting with the Container

Open a Bash Shell Inside the Container:

docker run -it --entrypoint /bin/bash auto_labeling

Exploring Files:

ls /app
ls /var/log

Listing Running Containers:

docker ps

Removing Orphan Containers:

docker compose down --remove-orphans

πŸ›’οΈ Cleaning Up Docker Resources

Remove Unused Containers, Networks, Images:

docker system prune -a

List and Remove Dangling Images:

docker images -f "dangling=true"
docker rmi $(docker images -f "dangling=true" -q)

🚩 Pipeline Commands

Available Options:

  • Download Videos
  • Trim Videos
  • Extract Frames
  • Resize Frames
  • Auto-Label Frames
  • Annotate Images
  • Run the Full Pipeline

πŸš€ Example: 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.


βš™οΈ Environment Configuration

  • GPU Selection:
    • Set CUDA_VISIBLE_DEVICES=0 to use GPU in docker-compose.yml.
    • Set CUDA_VISIBLE_DEVICES="" to force CPU usage in docker-compose.yml.
  • GPU Selection:
    • To transfer ownership of all the directories and files created via Docker.
 sudo chown -R $(whoami):$(whoami) /

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published