# 1. Install Build Tools first cmake # 2. Install Specific PyTorch/CUDA Version (Compatible with Python 3.10) --extra-index-url https://download.pytorch.org/whl/cu118 torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 # 3. Install minimal essential dependencies for Detectron2 build pyyaml>=5.1 fvcore>=0.1.5 iopath>=0.1.7 # 4. Install other libraries needed by your app.py gradio opencv-python-headless matplotlib termcolor cloudpickle submitit ftfy regex tqdm # 5. Install Detectron2 FROM SOURCE (listed last) # Use --no-build-isolation to try and force it to use the already installed torch # Requires C++ build tools (should be present via cmake/apt installs in base HF image) git+https://github.com/facebookresearch/detectron2.git#egg=detectron2 --config-settings --no-build-isolation # 6. Install CLIP from source git+https://github.com/openai/CLIP.git