Skip to content

Instantly share code, notes, and snippets.

@n1ckfg
Last active January 24, 2018 02:42
Show Gist options
  • Save n1ckfg/d602bbfe7bb418bb0eb0428f4b1d7e1b to your computer and use it in GitHub Desktop.
Save n1ckfg/d602bbfe7bb418bb0eb0428f4b1d7e1b to your computer and use it in GitHub Desktop.

SETUP for NEURAL-ENHANCE on Ubuntu 16.04 / 171226 https://github.com/alexjc/neural-enhance

  1. Remove old versions of Docker sudo apt-get remove docker docker-engine docker.io

  2. Docker dependencies sudo apt-get install
    apt-transport-https
    ca-certificates
    curl
    software-properties-common

  3. Add Docker repo key curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

  4. Add Docker repo sudo add-apt-repository
    "deb [arch=amd64] https://download.docker.com/linux/ubuntu
    $(lsb_release -cs)
    stable"

  5. Install Docker sudo apt-get update sudo apt-get install docker-ce

  6. Install Neural-Enhance Docker image sudo docker run --rm -v pwd:/ne/input -it alexjc/neural-enhance --help

  7. Add an alias to your .bashrc alias enhance='function ne() { sudo docker run --rm -v "$(pwd)/dirname ${@:$#}":/ne/input -it alexjc/neural-enhance ${@:1:$#-1} "input/basename ${@:$#}"; }; ne'

  8. Run a test command: enhance --zoom=1 --model=repair images/broken.jpg enhance --zoom=2 "images/*.jpg"

Notes:

  • By default the Docker container assumes that input files are in a subdirectory of the GitHub repo ./input .
  • The --model=repair switch only works together with --zoom=1. Use it to clean up the output of higher zoom levels in a separate pass.
  • You can also use the repair switch to clean up an image resized in other software.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment