2.0 KiB
2.0 KiB
Project Scripts
Setup Scripts
setup.bat (Windows) / setup.sh (Linux/Mac)
Creates a new conda environment and installs all required packages from requirements.txt.
What it does:
- Checks that conda is installed
- Creates a conda environment named
photo_judgerswith Python 3.11 - Installs all packages from
requirements.txt:torch,torchvision,torchaudio(PyTorch with CUDA 12.1)transformers(HuggingFace)simple-aesthetics-predictor(LAION aesthetic predictor)Pillow(image processing)tqdm(progress bars)numpy(numerical operations)
Usage:
# Windows
setup.bat
# Linux/Mac
chmod +x setup.sh
./setup.sh
Run Scripts
run.bat (Windows) / run.sh (Linux/Mac)
Activates the conda environment and runs the scorer.
What it does:
- Activates the
photo_judgersconda environment - Runs
python -m src.scorerwith any additional arguments passed through
Usage:
# Windows
run.bat
# Linux/Mac
chmod +x run.sh
./run.sh
Optional arguments:
--input <path>— Directory or file to score--output <path>— Output JSON file (default:output.json)--threshold <value>— Score threshold for keep/reject (default: TBD)
Project Structure
photo_judgers/
├── src/
│ ├── __init__.py
│ ├── scorer.py # Menu + proxy (entry point)
│ └── scorers/
│ ├── __init__.py
│ ├── base.py # BaseScorer abstract class
│ └── laion.py # LAION V2 implementation
├── requirements.txt
├── setup.bat / setup.sh
├── run.bat / run.sh
├── output.json # Generated by scorer
├── docs/
├── test/
└── .pi/
Adding a New Scorer
- Create
src/scorers/<name>.pywith a class that follows the LAION pattern - Register it in
src/scorer.pyby adding to theSCORERSlist - Add any new dependencies to
requirements.txt - Update
src/scorers/__init__.pyto export the new class