From 80d7b57bec20d7333618f82983d6c317273deb70 Mon Sep 17 00:00:00 2001 From: "Alex J. Champandard" Date: Thu, 10 Nov 2016 17:20:20 +0100 Subject: [PATCH] Prepare build scripts for merge and update README. --- README.rst | 8 ++++---- docker-cpu.df | 4 ++-- docker-gpu.df | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index d567bf3..fc3da2e 100644 --- a/README.rst +++ b/README.rst @@ -65,7 +65,7 @@ Pre-trained models are provided in the GitHub releases. Training your own is a .. code:: bash # Remove the model file as don't want to reload the data to fine-tune it. - rm -f ne4x*.pkl.bz2 + rm -f ne?x*.pkl.bz2 # Pre-train the model using perceptual loss from paper [1] below. python3.4 enhance.py --train "data/*.jpg" --model custom --scales=2 --epochs=50 \ @@ -79,7 +79,7 @@ Pre-trained models are provided in the GitHub releases. Training your own is a --discriminator-size=64 # The newly trained model is output into this file... - ls ne4x-custom-*.pkl.bz2 + ls ne?x-custom-*.pkl.bz2 .. image:: docs/BankLobby_example.gif @@ -109,14 +109,14 @@ Here's the simplest way you can call the script using ``docker``, assuming you'r alias enhance='function ne() { docker run --rm -v "$(pwd)/`dirname ${@:$#}`":/ne/input -it alexjc/neural-enhance ${@:1:$#-1} "input/`basename ${@:$#}`"; }; ne' # Now run any of the examples above using this alias, without the `.py` extension. - enhance --zoom=1 --model=small images/example.jpg + enhance --zoom=1 --model=repair images/broken.jpg **Multiple Images** — To enhance multiple images in a row (faster) from a folder or widlcard specification, make sure to quote the argument to the alias command: .. code:: bash # Process multiple images, make sure to quote the argument! - enhance --zoom=2 --model=small "images/*.jpg" + enhance --zoom=2 "images/*.jpg" If you want to run on your NVIDIA GPU, you can instead change the alias to use the image ``alexjc/neural-enhance:gpu`` which comes with CUDA and CUDNN pre-installed. Then run it within `nvidia-docker `_ and it should use your physical hardware! diff --git a/docker-cpu.df b/docker-cpu.df index 2e8dcb4..e861ffa 100644 --- a/docker-cpu.df +++ b/docker-cpu.df @@ -26,8 +26,8 @@ RUN /opt/conda/bin/python3.5 -m pip install -q -r "requirements.txt" COPY enhance.py . # Get a pre-trained neural networks, non-commercial & attribution. -RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.2/ne1x-small-0.2.pkl.bz2" -RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.2/ne2x-small-0.2.pkl.bz2" +RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.3/ne1x-photo-repair-0.3.pkl.bz2" +RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.3/ne2x-photo-default-0.3.pkl.bz2" # Set an entrypoint to the main enhance.py script ENTRYPOINT ["/opt/conda/bin/python3.5", "enhance.py", "--device=cpu"] diff --git a/docker-gpu.df b/docker-gpu.df index 90f33fd..512388c 100644 --- a/docker-gpu.df +++ b/docker-gpu.df @@ -24,8 +24,8 @@ RUN /opt/conda/bin/python3.5 -m pip install -q -r "requirements.txt" COPY enhance.py . # Get a pre-trained neural networks, non-commercial & attribution. -RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.2/ne1x-small-0.2.pkl.bz2" -RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.2/ne2x-small-0.2.pkl.bz2" +RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.3/ne1x-photo-repair-0.3.pkl.bz2" +RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.3/ne2x-photo-default-0.3.pkl.bz2" # Set an entrypoint to the main enhance.py script ENTRYPOINT ["/opt/conda/bin/python3.5", "enhance.py", "--device=gpu"]