--- tags: Demi --- # Style Transfer --- # fast-style-transfer https://github.com/lengstrom/fast-style-transfer ## Steps 1. 下載 anaconda 2. 開環境 ``` shell= conda create -n tf-gpu tensorflow-gpu=2.1.0 conda activate tf-gpu conda install jupyterlab jupyter lab ``` ``` python= !pip install moviepy==1.0.2 ``` 3. fast ``` shell git clone https://github.com/lengstrom/fast-style-transfer.git cd fast-style-transfer-master ``` 4. 下載訓練好的 models https://drive.google.com/drive/folders/0B9jhaT37ydSyRk9UX0wwX3BpMzQ?resourcekey=0-Z9LcNHC-BTB4feKwm4loXw ## 改圖而已 ``` shell= mkdir checkpoint # 放 style 的 models*.ckpt mkdir demi/imgs # 放要改的原圖 mkdir demi/results # 放結果圖 python3.7 evaluate.py --checkpoint checkpoint/scream.ckpt --in-path demi/imgs --out-path demi/results/ ``` run.sh ``` shell= python3.7 evaluate.py --checkpoint checkpoint/la_muse.ckpt --in-path demi/imgs --out-path demi/results/la_muse/ python3.7 evaluate.py --checkpoint checkpoint/rain_princess.ckpt --in-path demi/imgs --out-path demi/results/rain_princess/ python3.7 evaluate.py --checkpoint checkpoint/scream.ckpt --in-path demi/imgs --out-path demi/results/scream/ python3.7 evaluate.py --checkpoint checkpoint/udnie.ckpt --in-path demi/imgs --out-path demi/results/udnie/ python3.7 evaluate.py --checkpoint checkpoint/wave.ckpt --in-path demi/imgs --out-path demi/results/wave/ python3.7 evaluate.py --checkpoint checkpoint/wreck.ckpt --in-path demi/imgs --out-path demi/results/wreck/ ``` /bin/sh run.sh ## Train Model ``` shell= /bin/sh setup.sh ``` --- # Neural style transfer https://keras.io/examples/generative/neural_style_transfer/?fbclid=IwAR03SQ3F-cbOzzcfyR4DrS1CgeBACr3lnv2eTrm9WlyfRi0dK82WFkjzUjc