SlimFace-demo / docs /test /inference_test_doc.md
danhtran2mind's picture
Upload 164 files
b7f710c verified

A newer version of the Gradio SDK is available: 5.41.1

Upgrade

Running Inference Test Script

Instructions to run the tests/inference_test.sh script in the tests folder on Linux, Windows, and macOS.

Prerequisites

  1. Install Python, PyTorch, Accelerate:
    pip install -r requirements/requirements.txt
    
  2. Create virtual environment:
    python -m venv venv
    source venv/bin/activate  # Linux/macOS
    .\venv\Scripts\activate   # Windows
    
  3. Make script executable (Linux/macOS):
    chmod +x tests/inference_test.sh
    

Linux

  1. Open terminal, go to folder:
    cd tests
    
  2. Run script:
    ./inference_test.sh
    
  3. Fix issues:
    • Use bash inference_test.sh if ./ fails.
    • Fix line endings:
      sudo apt install dos2unix
      dos2unix inference_test.sh
      

Windows (using WSL)

  1. Install WSL and Ubuntu from Microsoft Store.
  2. Install dependencies:
    sudo apt update
    sudo apt install python3 python3-pip
    pip install -r requirements/requirements.txt
    
  3. Go to folder:
    cd ./tests
    
  4. Make executable:
    chmod +x inference_test.sh
    
  5. Run script:
    ./inference_test.sh
    
  6. Fix issues:
    • Fix line endings:
      sudo apt install dos2unix
      dos2unix inference_test.sh
      

macOS

  1. Open Terminal, go to folder:
    cd tests
    
  2. Install dependencies:
    brew install python
    pip install -r requirements/requirements.txt
    
  3. Make executable:
    chmod +x inference_test.sh
    
  4. Run script:
    ./inference_test.sh
    
  5. Fix issues:
    • Fix line endings:
      brew install dos2unix
      dos2unix inference_test.sh
      

Notes

  • Ensure GPU support (CUDA for Linux/Windows, MPS for macOS) if needed.
  • Check script for extra settings (e.g., export CUDA_VISIBLE_DEVICES=0).
  • Save output:
    ./inference_test.sh > output.log 2>&1