Git Product home page Git Product logo

python-opencv-notebook's Introduction

python-opencv-notebook

Ready to run jupyter notebook in docker, with Python 3.9, OpenCV 4, OpenCV contrib, and some recommended python libraries for data science (numpy, pandas, sklearn, etc).

Usage

  1. Install Docker CE - for Mac, for Windows or for Ubuntu

  2. Run this command from your project directory:

    docker run --interactive --tty --init --rm --name opencv-notebook --publish 8888:8888 --volume `pwd`/data:/app/data alexlouden/python-opencv-notebook

    The data directory will be created, shared with the docker container, and the jupyter notebook will be launched from here.

    Run Control + C to shut down the notebooks and stop the docker container.

    Parameter explanation:

    • --interactive - runs in foreground (will run in the background without)
    • --tty - runs a psudo TTY (for shell interaction, shell colours, Control + C)
    • --init - runs using tini to reap zombies
    • --rm - container is removed after exit. As long as you keep everything in data you won't lose anything. If you don't pass this argument then after the container is stopped you can run docker start -i opencv-notebook to restart it, or docker rm opencv-notebook to remove it.
    • --name - name the docker container
    • --publish - choose which ports to expose from the docker container to host
    • --volume - bind a volume, used to share data between container and host (must be an absolute path - I've used pwd)

    See docker docs for more info.

  3. You should see the following output:

    Copy/paste this URL into your browser when you connect for the first time, to login with a token: http://localhost:8888/?token=longsecrettoken

    Open the URL in your browser, and you should get access!

Notes

  • Aims to be a lot simpler and easier to understand than https://github.com/jupyter/docker-stacks
  • Uses the python 3.9.10 base docker image
  • Uses pip rather than conda (installs from requirements.txt)
  • No virtualenv - uses the docker container's system Python
  • Designed to run on your computer (not a public server) - no SSL, no password, runs as root docker user.

Building from source

You can clone this repo and build the image yourself with:

git clone [email protected]:alexlouden/python-opencv-notebook.git
cd python-opencv-notebook
docker build -t python-opencv-notebook .

python-opencv-notebook's People

Contributors

alexlouden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.