Using https://github.com/jfilter/universal-style-transfer-pytorch to transform images.
The main repo is https://github.com/jfilter/MDMA.
We use a fresh Ubuntu 16.04. installation and use root for everything. Feel free to change to a proper user.
- Install pipenv
git clone https://github.com/jfilter/universal-style-transfer-pytorchcd universal-style-transfer-pytorch && pipenv install && ./setup.sh && cd ..git clone https://github.com/jfilter/MDMA-style-transfer && cd MDMA-style-transfer- Create a
secrets.pyfor with the basic auth credentials to connect toMDMA:
username = 'XXX'
password = 'XXX'
- Create a script
do.shthat does the actual transfer:
cd /root/MDMA-style-transfer && /usr/local/bin/pipenv run python run.py >> /root/log.txt 2>&1
- To make sure the bash script only runs once at the same time:
apt-get install run-one - add to your crontab (
crontab -e) to run e.g. every minute
* * * * * run-one /root/do.sh
Right now, you can only transform one image in a batch. This is because the style weight has to be set for a batch. We allow to set the style weight individual for each image. Thus, we process only one.
MIT.