Create a Docker container based on Ubuntu and go inside
I'm mounting a volume because I want to share files locally I want to use Jupyter, so I have a port connected
docker run -it -v $(pwd):/code -p 8888:8888 --name opencv ubuntu /bin/bash
Annual event
apt-get -y update && apt-get -y upgrade
Various installations
apt-get -y install python3-pip vim
pip3 install opencv-python jupyterlab pandas matplotlib scikit-learn seaborn
apt-get -y install libgl1-mesa-dev libgtk2.0-dev
#If you do not include these, you will get an error with import cv2
jupyter lab --ip=0.0.0.0 --allow-root --LabApp.token=''
Do this and access localhost: 8888 in your browser
You can't run cv2.imshow ()
this way, right? .. ..
I will update it as soon as it is resolved.
Please let me know if you know the solution. .. ..
(Memo) This area seems to be helpful https://qiita.com/oreyutarover/items/cca3511012b6ad97a1ce https://kamino.hatenablog.com/entry/docker_gui
I wrote a separate article about the version that works with cv2.imshow ()
!!
https://qiita.com/RyuGotoo/items/3e36622c52beb9d4e932
Recommended Posts