Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Commit 1ad40b6

Browse files
committed
Merge branch 'master' into v0.2
2 parents ac49676 + 0c31e53 commit 1ad40b6

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

README.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Pre-trained models are provided in the GitHub releases. Training your own is a
6464
6565
# Train the model using an adversarial setup based on [4] below.
6666
python3.4 enhance.py --train "data/*.jpg" --model custom --scales=2 --epochs=250 \
67-
--perceptual-layer=conv5_2 --smoothness-weight=2e4 --adversary-weight=2e5 \
67+
--perceptual-layer=conv5_2 --smoothness-weight=2e4 --adversary-weight=1e3 \
6868
--generator-start=5 --discriminator-start=0 --adversarial-start=5 \
6969
--discriminator-size=64
7070
@@ -84,16 +84,23 @@ Pre-trained models are provided in the GitHub releases. Training your own is a
8484

8585
The easiest way to get up-and-running is to `install Docker <https://www.docker.com/>`_. Then, you should be able to download and run the pre-built image using the ``docker`` command line tool. Find out more about the ``alexjc/neural-enhance`` image on its `Docker Hub <https://hub.docker.com/r/alexjc/neural-enhance/>`_ page.
8686

87-
We recommend you setup an alias called ``enhance`` to automatically expose your ``images`` folder from the current directory so the script can access files and store results where you can access them. This is how you can do it in your terminal console on OSX or Linux:
87+
**Single Image** — We suggest you setup an alias called ``enhance`` to automatically expose the folder containing your specified image, so the script can read it and store results where you can access them. This is how you can do it in your terminal console on OSX or Linux:
8888

8989
.. code:: bash
9090
9191
# Setup the alias. Put this in your .bash_rc or .zshrc file so it's available at startup.
92-
alias enhance="docker run -v $(pwd)/images:/ne/images -it alexjc/neural-enhance"
93-
92+
alias enhance='function ne() { docker run -v $(PWD)/`dirname $1`:/ne/input -it alexjc/neural-enhance input/`basename $1`; }; ne'
93+
9494
# Now run any of the examples above using this alias, without the `.py` extension.
9595
enhance images/example.jpg
9696
97+
**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:
98+
99+
.. code:: bash
100+
101+
# Process multiple images, make sure to quote the argument!
102+
enhance "images/*.jpg"
103+
97104
If you want to run on your NVIDIA GPU, you can instead use the image ``alexjc/neural-enhance:gpu`` which comes with CUDA and CUDNN pre-installed in the image. Then run it within `nvidia-docker <https://github.com/NVIDIA/nvidia-docker>`_ and it should use your physical hardware!
98105

99106

enhance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def extend(lst): return itertools.chain(lst, itertools.repeat(lst[-1]))
104104
# Load the underlying deep learning libraries based on the device specified. If you specify THEANO_FLAGS manually,
105105
# the code assumes you know what you are doing and they are not overriden!
106106
os.environ.setdefault('THEANO_FLAGS', 'floatX=float32,device={},force_device=True,allow_gc=True,'\
107-
'print_active_device=False,lib.cnmem=1.0'.format(args.device))
107+
'print_active_device=False'.format(args.device))
108108

109109
# Scientific & Imaging Libraries
110110
import numpy as np

0 commit comments

Comments
 (0)