-
Update package lists:
sudo apt-get update
-
Install dependencies:
sudo apt-get install -y libgl1-mesa-glx git build-essential python3.8-venv python3.8-dev
-
Create and activate a virtual environment:
python3.8 -m venv venv source venv/bin/activate
-
Install Python dependencies:
pip install -r requirements.txt
-
Clone and install Detectron2:
git clone https://github.com/facebookresearch/detectron2.git cd detectron2 pip install -e . cd ..
-
Run the application:
gunicorn -c gunicorn_config.py app:app
The application will be served on http://localhost:5000/detect.
Tested working on Ubuntu Jammy 22.04 x86_64, Host: Windows Subsystem for Linux - Ubuntu (2.3.14).