OVDR Installation Manual

Prerequisites

⚠️ The following tools are optional or will be installed later in the guide:

Step 1 - Clone the Repository

git clone https://csprojects.nottingham.edu.cn/grp-team07-gitlab/grp-team07-gitlab-work.git
  cd grp-team07-gitlab-work

Step 2 - Backend Setup

conda create -n OVDR python=3.10 -y
      conda activate OVDR
      pip install -r requirements.txt
      
      conda create -n StableViton python=3.10 -y
      conda activate StableVITON
      pip install -r requirements.txt

Step 3 - AI Models Setup

conda activate StableVITON
      cd backend
      mkdir models
      cd models
      
      # Install Triton (for Windows)
      git clone https://github.com/PrashantSaikia/Triton-for-Windows
      cd Triton-for-Windows
      pip install triton-2.0.0-cp310-cp310-win_amd64.whl
      cd ..
      
      # Download clip-vit-large-patch14
      git clone https://huggingface.co/openai/clip-vit-large-patch14
      
      # Download StableVITON (ensure Git LFS is installed)
      git lfs install
      git clone https://huggingface.co/spaces/rlawjdghek/StableVITON
      
      # Download StavleVITON models
      go to https://huggingface.co/spaces/rlawjdghek/StableVITON/tree/main
      to download the checkpoints dir alone
      https://huggingface.co/spaces/rlawjdghek/StableVITON/tree/main
      download the checkpoints dir alone

Detectron2 for DensePose

To install detectron2 and DensePose on Windows, make sure Visual Studio Build Tools are installed:

  1. Download Visual C++ Build Tools
  2. Select Visual Studio Build Tools 2019
  3. In the installer, check:
    • MSVC (latest version, under “Single Component”)
    • Desktop development with C++ workload
  4. Install and restart your terminal.

Now install detectron2 and DensePose:

💡 Important: Use x64 Native Tools Command Prompt for VS 2019, not regular cmd or PowerShell

# Clone detectron2 repository
    git clone https://github.com/facebookresearch/detectron2.git
    
    # Activate your environment
    conda activate StableViton
    
    # Navigate to Detectron2 repo
    cd your_store_project_path/backend/models/detectron2/
    
    # Install detectron2
    set DISTUTILS_USE_SDK=1 && pip install .
    
    # Install DensePose
    cd ./projects/DensePose
    set DISTUTILS_USE_SDK=1 && pip install .

Step 4 - Frontend Setup

cd frontend
  npm install
  npm install concurrently wait-on --save-dev

Step 5 - Set Up MySQL (Optional for Local Try-On Only)

CREATE DATABASE ovdr CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
mysql -u root -p ovdr < backend/database/ovdr_structure.sql
  mysql -u root -p ovdr < backend/database/ovdr_data_only.sql

Edit your .env file in ./backend:

USER_NAME=root
  PASSWORD=yourpassword
  HOSTNAME=127.0.0.1
  PORT=3306
  DATABASE=ovdr

Step 6 - Run the Application

cd frontend
  conda activate OVDR
  npm run dev

If you encounter the error:

[0] Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.  
[0] - options.allowedHosts[0] should be a non-empty string.

Solution: Please modify the /frontend/node_modules/react-scripts/config/webpackDevServer.config.js file and change the allowedHosts configuration on line 46 to:

allowedHosts: "all",

Step 7 - Troubleshooting

1 - Error: ModuleNotFoundError

Try running the following command again:

pip install -r requirements.txt

Error: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE

If you see an error like:

ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. torch==2.0.1+cu117 from https://download.pytorch.org/... Expected sha256 ... Got ...

Solution 1 – Manually download and install the correct PyTorch wheels:

  1. Visit: https://download.pytorch.org/whl/cu117
  2. Download the matching .whl files for your Python version (e.g. cp310 for Python 3.10):
    • torch-2.0.1+cu117-cp310-cp310-win_amd64.whl
    • torchvision-0.15.2+cu117-cp310-cp310-win_amd64.whl
    • torchaudio-2.0.2-cp310-cp310-win_amd64.whl
  3. Run:
  4. pip install torch-*.whl torchvision-*.whl torchaudio-*.whl

The backend runs at http://localhost:5000, and the frontend at http://localhost:3000.