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

Commit 34f8e62

Browse files
committed
Improve the alias used to invoke docker, so it's more robust to directory locations and input paths.
1 parent 02d2fca commit 34f8e62

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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"
92+
alias enhance="function ne() { docker run -v \`dirname \$1\`:/ne/input -it alexjc/neural-enhance input/\`basename \$1\`; }; ne"
9393
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:
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

0 commit comments

Comments
 (0)