MacOS
$ python -m venv <your_venv_name> # e.g. opencv-inflearn
$ source <pwd>/<your_venv_name>/bin/activate
(opencv-inflearn) $
(opencv-inflearn) $ pip install jupyterlab
(opencv-inflearn) $ jupyter lab
opencv-python
: OpenCV for pythonpillow
: PIL (Python Image Library) for python3mediapipe
: On-device ML Library for face detection (and additional features)
(opencv-inflearn) $ pip install opencv-python pillow mediapipe
$ curl https://www.wfonts.com/download/data/2016/06/13/malgun-gothic/malgun-gothic.zip --output malgun-gothic.zip
$ unzip malgun-gothic.zip
In case of using MacOS, you need to additional set cv2.waitKey(1)
after cv2.destroyAllWindows()
for preventing infinity loop.
import cv2
img = cv2.imread(<image_dir>)
cv2.imshow('img', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
cv2.waitKey(1) # needed in MacOS