DeepStyleX is an image transformation family of models that applies a style to the image. This model is inspired from these two papers:
- Perceptual Losses for Real-Time Style Transfer and Super-Resolution
- Instance Normalization: The Missing Ingredient for Fast Stylization
Tip
This project contains a Web UI to make it easy to use. For more information, reffer to this section.
Important
There is a suit of pretrained models, reffer to this section.
python3 -m venv .venv
source .venv/bin/activateTo install the dependencies:
pip install -r requirements.txtIf it doesn't work, try
pip install torch pillow torchvision numpy tqdm pillow opencv-python
# For web-app
pip install fastapi python-multipart uvicornpython3 scripts/model-cli.py train --dataset data/scenes/Coco/ --epochs 4 --style-path data/style/leaf-style.jpg --resume-path data/saves/model1.pth --output-path data/saves/model1.pth --checkpoint-dir data/check/ --checkpoint-interval 200python3 scripts/model-cli.py eval --model-path data/saves/model1.pth --input-image data/Central-Park.jpg --output-image output/central-leaf.jpg Launch the server
uvicorn scripts.api:app --reload --port 8080Note: Your models should be in
data/saves/in order to be used in the web app
To download pretrained models, just run this python script:
python3 scripts/download-models.py 
