SAM2 Labeling on Video Example (left) and YOLOv8 Fine-Tuning Example (right)
SAM2 Video autolabeler, fine-tuning, and inference pipeline for YOLOv8-seg using ultralytics. This project consists of:
- Frontend: React/Next.js app
- Backend: Python + YOLOv8, hosted on FastAPI
Make sure you have the following installed:
- Node.js (v18+ recommended)
- pnpm
npm install -g pnpm - NVIDIA GPU + CUDA (optional but highly recommended)
- From the repo root, create the Conda environment:
conda env create -f backend/environment.yml
conda activate sam2env- Start the backend:
cd backend
uvicorn app.main:app --reload --workers 1Backend should now be running at http://localhost:8000
- (Optional, for fine-tune and inference) Install ultralytics models:
python3 install_ultralytics_models.py- Install frontend dependencies via pnpm:
cd frontend
pnpm install- Configure environment variables, create a
.env.localfile infrontendif needed
cat <<EOF > .env.local
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000
EOF- Start frontend dev server:
pnpm devFrontend should now be running at: http://localhost:3000
This issue relates to how the uvicorn server uses multiple workers. The easiest fix is to restart the backend server with 1 worker:
uvicorn app.main:app --reload --workers 1- Currently only 1 segmentation per dataset is allowed
- Support for pose models (figure out labeling service)
MIT License
This project provides training and deployment tooling. Users are responsible for ensuring model weights, datasets, and downstream deployments comply with applicable licenses and regulations.
@ekberndt's YOLOv8 Instance Segmentation Fine-Tuning helped me with the fine-tuning setion of this project.