Last active
March 3, 2018 17:07
-
-
Save uitspitss/2d10a71c7c4b1f06d64f76b13115b854 to your computer and use it in GitHub Desktop.
docker + jupyter で画像処理用コンテナ ref: https://qiita.com/uitspitss/items/beaba95390731d7f508b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM jupyter/base-notebook | |
USER root | |
RUN apt-get update -y && apt-get install -y python-opencv | |
USER jovyan | |
RUN pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master \ | |
jupyter_nbextensions_configurator pillow opencv-python | |
RUN jupyter contrib nbextension install --user && jupyter nbextensions_configurator enable --user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM jupyter/base-notebook | |
USER root | |
RUN apt-get update -y && apt-get install -y python-opencv | |
USER jovyan | |
RUN pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master \ | |
jupyter_nbextensions_configurator pillow opencv-python | |
RUN jupyter contrib nbextension install --user && jupyter nbextensions_configurator enable --user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker build -t jupyter_blog . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -it --rm -v $PWD:/home/jovyan/work --name jupyter_blog -p 8888:8888 jupyter_blog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.display import display | |
from PIL import Image | |
import cv2 | |
import numpy as np | |
img = Image.open('myicon.jpg') | |
display(img) | |
_img = np.asarray(img) | |
_img = cv2.GaussianBlur(_img, (45, 1), 0) | |
display(Image.fromarray(_img)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment