Skip to content

About

Easy setup for mmdetection

Resources

Stars

22 stars

Watchers

1 watching

Forks

Latest commit

 

History

49 Commits

Folders and files

Repository files navigation

MMDetection Easy Setup

License

This repository provides a simplified approach to installing MMDetection, designed for beginners to solve common environment configuration issues like CUDA error, mmcv, mmdet setup error, and dependency conflict error.

中文 | English

🌟 Features

  • ✅ Pre-configured environment files, no need to solve dependency issues manually
  • ✅ Detailed step-by-step instructions for first-time users
  • ✅ Automated installation scripts for one-click setup
  • ✅ Avoids common errors and pitfalls

📋 Requirements

  • Python 3.8
  • CUDA 11.8
  • Sufficient disk space (at least 5GB)

⚠️ If you plan to use a different version (e.g., Python 3.10 or CUDA 12),
please manually align compatible versions of PyTorch, MMCV, and MMEngine to avoid conflicts.
Incompatible versions may cause installation issues or runtime errors.
If you are using a 50-series GPU might cause some error!!

✅ Recommended references:

🚀 Quick Installation

Method 1: Using Conda (environment.yml) (Recommend)

  1. Clone this repository
git clone https://github.com/yourusername/mmdetection-easy-setup.git
cd mmdetection-easy-setup
  1. Create and activate Conda environment
conda env create -f environment.yml
conda activate mmdetection_easy_setup
  1. Use mim install mmengine and mmcv
mim install mmengine
mim install "mmcv==2.1.0"
  1. Install mmdet

Case a: If you develop and run mmdet directly, install it from source:

git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -v -e .
# "-v" means verbose, or more output
# "-e" means installing a project in editable mode,
# thus any local modifications made to the code will take effect without reinstallation.

Case b: If you use mmdet as a dependency or third-party package, install it with MIM:

mim install mmdet

✅ Now you can verify the installation

Method 2: Using pip (requirements.txt)

  1. Clone this repository
git clone https://github.com/yourusername/easy-mmdetection-setup.git
cd easy-mmdetection-setup
  1. Create virtual environment
python -m venv mmdetection_easy_setup
source mmdetection_easy_setup/bin/activate  # Linux
# or
mmdetection_easy_setup\Scripts\activate  # Windows
  1. Install dependencies
pip install -r requirements.txt
  1. Use mim install mmengine and mmcv
mim install mmengine
mim install "mmcv==2.1.0"
  1. Install mmdet

Case a: If you develop and run mmdet directly, install it from source:

git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -v -e .
# "-v" means verbose, or more output
# "-e" means installing a project in editable mode,
# thus any local modifications made to the code will take effect without reinstallation.

Case b: If you use mmdet as a dependency or third-party package, install it with MIM:

mim install mmdet

✅ Now you can verify the installation

Method 3: One-click Installation Script

# Linux/Mac
./install.sh

# Windows
install.bat

🔍 Verify Installation

After successful installation, run the following test:

cd ./mmdetection-easy-setup
python verify_install_env.py
# Execute in Python
import mmdet
import torch

print(f"MMDetection version: {mmdet.__version__}")
print(f"PyTorch version: {torch.__version__}")
print(f"CUDA available: {torch.cuda.is_available()}")

📝 Getting Started Tutorial

After installation, check out MMdetection Getting Started Guide to learn how to:

  1. Run your first object detection
  2. Use pre-trained models for inference
  3. Train with your own dataset
  4. See example code for common tasks

❓ Common Issues & Solutions

Getting "CUDA error: ..." during installation This usually indicates that the PyTorch version doesn't match your CUDA version. Make sure to use a PyTorch build that matches your system's CUDA version. You can find compatible versions at the PyTorch website.
ImportError: cannot import name 'XXXX' from 'mmdet' This typically happens when MMCV and MMDetection versions are not compatible. Please ensure you're using our provided environment files where the versions have been tested for compatibility.

📊 Tested Environments

This installation method has been tested on:

  • Windows 11 + CUDA 11.8

👥 Contributing

If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

📜 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

🙏 Acknowledgements

  • MMDetection - For creating this amazing object detection toolbox
  • OpenMMLab - For their continued contributions to the computer vision community

About

Easy setup for mmdetection

Resources

Stars

22 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages