Complete guide for setting up the VisDrone Toolkit with virtualenv.
# 1. Clone repository
git clone https://github.com/dronefreak/VisDrone-dataset-python-toolkit.git
cd VisDrone-dataset-python-toolkit
# 2. Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# 3. Install package
pip install -e .
# 4. Test with webcam (no training needed!)
python scripts/webcam_demo.py --model fasterrcnn_mobilenet- Python: 3.8 or higher
- GPU (recommended): NVIDIA GPU with CUDA support
- CPU only: Works but much slower
Check your Python version:
python3 --version # Should be 3.8+git clone https://github.com/dronefreak/VisDrone-dataset-python-toolkit.git
cd VisDrone-dataset-python-toolkitWhy virtualenv? Keeps dependencies isolated from your system Python.
# Create venv
python3 -m venv venv
# Activate venv
source venv/bin/activate # Linux/Mac
# OR
venv\Scripts\activate # Windows
# Your prompt should now show (venv)For GPU (CUDA):
# CUDA 11.8 (most common)
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
# CUDA 12.1
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121For CPU only:
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpuVerify installation:
python -c "import torch; print(f'PyTorch: {torch.__version__}'); print(f'CUDA available: {torch.cuda.is_available()}')"pip install -e .pip install .pip install -e ".[dev]"# Check if package is installed
python -c "import visdrone_toolkit; print(visdrone_toolkit.__version__)"
# Run a quick test
python scripts/webcam_demo.py --helppip install -r requirements.txt
pip install -e .pip install -r requirements-dev.txt
pip install -e ".[dev]"pip install -e ".[coco]"pip install -e ".[all]"We provide a Makefile for common tasks:
# Create venv
make setup-venv
# Activate it
source venv/bin/activate
# Install with dev dependencies
make install-dev
# Run tests
make test
# Format code
make format
# Clean build artifacts
make cleanSee all commands:
make helpnvidia-smiLook for "CUDA Version: X.X" in the output.
Match PyTorch CUDA version to your system:
| System CUDA | PyTorch Command |
|---|---|
| 11.8 | pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118 |
| 12.1 | pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121 |
| CPU only | pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu |
python -c "import torch; print(torch.cuda.is_available()); print(torch.cuda.get_device_name(0))"Should output:
True
NVIDIA GeForce RTX 3090 # (or your GPU name)# Create data directory
mkdir -p data
# Download from official VisDrone website
# https://github.com/VisDrone/VisDrone-Dataset
# Extract files
# Expected structure:
# data/
# ├── VisDrone2019-DET-train/
# │ ├── images/
# │ └── annotations/
# └── VisDrone2019-DET-val/
# ├── images/
# └── annotations/python scripts/webcam_demo.py --model fasterrcnn_mobilenetThis uses pretrained COCO weights - works out of the box!
python scripts/train.py \
--train-img-dir data/VisDrone2019-DET-train/images \
--train-ann-dir data/VisDrone2019-DET-train/annotations \
--val-img-dir data/VisDrone2019-DET-val/images \
--val-ann-dir data/VisDrone2019-DET-val/annotations \
--model fasterrcnn_mobilenet \
--epochs 10 \
--batch-size 4 \
--output-dir outputs/first_modelSolution:
# Make sure you're in the right directory
cd /path/to/VisDrone-dataset-python-toolkit
# Install in editable mode
pip install -e .Solutions:
- Reduce batch size:
--batch-size 2or--batch-size 1 - Use smaller model:
--model fasterrcnn_mobilenet - Enable AMP:
--amp - Close other programs using GPU
Solutions:
-
Check NVIDIA drivers:
nvidia-smi -
Reinstall PyTorch with CUDA:
pip uninstall torch torchvision pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
Solution:
pip install opencv-python matplotlib pillow tqdmSolution:
# Add execute permissions
chmod +x scripts/*.pygit pull
pip install -e . --upgradepip install -r requirements.txt --upgrade# Deactivate virtualenv
deactivate
# Remove virtualenv
rm -rf venv/
# Remove package
pip uninstall visdrone-toolkitIf you prefer Docker:
# Build image
docker build -t visdrone-toolkit .
# Run container
docker run --gpus all -it visdrone-toolkit bashAfter installation:
- ✅ Test webcam demo
- ✅ Download VisDrone dataset
- ✅ Train your first model
- ✅ Read the documentation
See README.md for usage examples and scripts/README.md for script documentation.
- GitHub Issues: https://github.com/dronefreak/VisDrone-dataset-python-toolkit/issues
- Documentation: Check README.md and docs/
- Examples: See examples/ directory
- Python 3.8+
- 8GB RAM
- 10GB disk space
- Python 3.10+
- 16GB+ RAM
- NVIDIA GPU with 8GB+ VRAM
- 50GB+ disk space (for datasets)
- Python 3.11+
- 32GB+ RAM
- NVIDIA RTX 3090 or better
- SSD storage