Skip to content

Latest commit

 

History

History
289 lines (203 loc) · 6.47 KB

File metadata and controls

289 lines (203 loc) · 6.47 KB

Installation Guide:

Complete installation guide for Reid Pose Refactored on Windows 11 with Python 3.11 and CUDA 12.1.

Prerequisites:

System Requirements:

  • Operating System: Windows 11 (tested), Windows 10, Linux, or macOS.
  • Python: 3.11 or higher.
  • CUDA: 12.1 or higher (for GPU acceleration).
  • GPU: NVIDIA GPU with 4GB+ VRAM (recommended).
  • RAM: 8GB minimum, 16GB recommended.
  • Storage: 5GB for models and dependencies.

Software Prerequisites:

  1. Python 3.11:

  2. NVIDIA CUDA Toolkit 12.1:

  3. Git:

Installation:

Step 1: Verify Python Installation:

Open a terminal (Command Prompt or PowerShell) and verify Python version:

python --version
#Should show: Python 3.8.x or above.

Step 2: Create Virtual Environment (Recommended):

Create and activate a virtual environment to isolate dependencies:

#Create virtual environment.
python -m venv reid_pose_env

#Activate on Windows.
reid_pose_env\Scripts\activate

#Activate on Linux/macOS.
source reid_pose_env/bin/activate

Step 3: Install PyTorch with CUDA 12.1:

Install PyTorch with CUDA 12.1 support (this is the most important step):

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

Verify PyTorch installation:

python -c "import torch; print(f'PyTorch: {torch.__version__}'); print(f'CUDA Available: {torch.cuda.is_available()}'); print(f'CUDA Version: {torch.version.cuda}')"

Expected output:

PyTorch: 2.x.x+cu121
CUDA Available: True
CUDA Version: 12.1

Step 4: Install Core Dependencies:

Install the main requirements:

pip install -r requirements.txt

This will install:

  • ultralytics (YOLOv11).
  • supervision (ByteTrack).
  • opencv-python (Computer Vision).
  • filterpy (Kalman Filtering).
  • scipy, numpy (Scientific Computing).
  • And all FastReID dependencies.

Step 5: Install newFastReID

Clone and install the newFastReID library:

# Clone the repository
git clone https://github.com/WhiteMetagross/newFastReID.git

# Navigate to the directory
cd newFastReID

# Install in editable mode
pip install -e .

# Return to project directory
cd ..

Verify newFastReID installation:

python -c "import fastreid; from fastreid.config import get_cfg; print('FastReID installed successfully')"

Step 6: Download Model Weights:

Create the models directory and download required models:

#Create models directory.
mkdir models
cd models

YOLOv11 Models (Auto downloaded):

YOLOv11 models will be automatically downloaded on first use:

  • yolov11n.pt: Person detection.
  • yolov11n-pose.pt: Pose estimation.

FastReID Models

Download the Market-1501 SBS model:

Option 1: Using gdown (if available)

# Install gdown if not already installed
pip install gdown

#Download Market-1501 SBS model:
gdown https://drive.google.com/uc?id=<model_id>

Option 2: Manual Download

  1. Visit: https://github.com/JDAI-CV/fast-reid.
  2. Navigate to Model Zoo.
  3. Download market_sbs_R101-ibn.pth.
  4. Place in models/ directory.

Option 3: Use existing model: If you have the model from the original project:

#Copy from original project.
copy ..\market_sbs_R101-ibn.pth models\

Step 7: Verify Installation:

Run the verification script:

python -c "
import sys
print('Python Version:', sys.version)

import torch
print('PyTorch Version:', torch.__version__)
print('CUDA Available:', torch.cuda.is_available())
print('CUDA Version:', torch.version.cuda if torch.cuda.is_available() else 'N/A')

import ultralytics
print('Ultralytics Version:', ultralytics.__version__)

import supervision as sv
print('Supervision Version:', sv.__version__)

import cv2
print('OpenCV Version:', cv2.__version__)

import fastreid
print('FastReID: Installed')

from filterpy.kalman import KalmanFilter
print('FilterPy: Installed')

import scipy
print('SciPy Version:', scipy.__version__)

print('\nAll dependencies installed successfully.')
"

Step 8: Test the System:

Run a quick test:

python main.py --help

You should see the help message with all available options.

Troubleshooting:

Issue: CUDA Not Available:

Problem: torch.cuda.is_available() returns False.

Solutions:

  1. Verify NVIDIA GPU is installed: nvidia-smi.
  2. Verify CUDA Toolkit is installed: nvcc --version.
  3. Reinstall PyTorch with correct CUDA version.
  4. Update NVIDIA drivers.

Issue: Import Error for fastreid:

Problem: ModuleNotFoundError: No module named 'fastreid'.

Solutions:

  1. Ensure newFastReID is installed: pip install -e newFastReID/.
  2. Check if you're in the correct virtual environment.
  3. Verify installation: pip list | grep fastreid.

Issue: YOLOv11 Model Download Fails:

Problem: Cannot download YOLOv11 models.

Solutions:

  1. Check internet connection.
  2. Download manually from: https://github.com/ultralytics/assets/releases.
  3. Place in ~/.cache/torch/hub/checkpoints/ or specify path directly.

Issue: Out of Memory (CUDA):

Problem: RuntimeError: CUDA out of memory.

Solutions:

  1. Reduce batch size in configuration.
  2. Use smaller model (yolov11n instead of yolov11m).
  3. Use CPU mode: --device cpu.
  4. Close other GPU-intensive applications.

Issue: Slow Performance on CPU:

Problem: Very slow tracking on CPU.

Solutions:

  1. Install CUDA and use GPU.
  2. Reduce input resolution.
  3. Use lighter models (yolov11n).
  4. Disable pose estimation if not needed.

Next Steps:

After successful installation:

  1. Test with webcam:

    python main.py --source 0 --mode standard
  2. Test with video:

    python main.py --source path/to/video.mp4 --mode pose
  3. Read the documentation:

    • README.md - Overview and quick start
    • docs/ - Detailed documentation (coming soon)

Version Compatibility:

Tested and verified on:

  • OS: Windows 11
  • Python: 3.11.x
  • CUDA: 12.1
  • PyTorch: 2.0+
  • GPU: NVIDIA RTX 4060 (and similar)

Should also work on:

  • Windows 10
  • Linux (Ubuntu 20.04+)
  • macOS (CPU only)
  • Python 3.8 - 3.11
  • CUDA 11.x (with appropriate PyTorch version)