Skip to content

A Python implementation of style transfer and super-resolution using perceptual loss, featuring flexible model customization, efficient training, and visual results generation.

Notifications You must be signed in to change notification settings

AcePeaX/DeepStyleX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo
DeepStyleX

DeepStyleX is an image transformation family of models that applies a style to the image. This model is inspired from these two papers:

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.

Getting started

python3 -m venv .venv
source .venv/bin/activate

To install the dependencies:

pip install -r requirements.txt

If it doesn't work, try

pip install torch pillow torchvision numpy tqdm pillow opencv-python

# For web-app
pip install fastapi python-multipart uvicorn

Example use case

Train

python3 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 200

Test

python3 scripts/model-cli.py eval --model-path data/saves/model1.pth --input-image data/Central-Park.jpg --output-image output/central-leaf.jpg 

Web app

Launch the server

uvicorn scripts.api:app --reload --port 8080

WebApp preview

Note: Your models should be in data/saves/ in order to be used in the web app

Download pretrained models

To download pretrained models, just run this python script:

python3 scripts/download-models.py 

About

A Python implementation of style transfer and super-resolution using perceptual loss, featuring flexible model customization, efficient training, and visual results generation.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages