728x90
오픈소스 컴퓨터 비전 라이브러리 cvlib 을 설치해보자.
https://pypi.org/project/cvlib/
다음과 같이 설치할 수 있다.
(lindy) founder@casey:~$ pip install cvlib
Collecting cvlib
Downloading https://files.pythonhosted.org/packages/ee/f8/86bbd3187ae6741f01f541ee88ee1fbac398f4248b9b327fd497358b4ef1/cvlib-0.2.2.tar.gz (10.0MB)
|████████████████████████████████| 10.0MB 2.6MB/s
Requirement already satisfied: numpy in ./anaconda3/envs/lindy/lib/python3.7/site-packages (from cvlib) (1.16.4)
Collecting progressbar (from cvlib)
Downloading https://files.pythonhosted.org/packages/a3/a6/b8e451f6cff1c99b4747a2f7235aa904d2d49e8e1464e0b798272aa84358/progressbar-2.5.tar.gz
Requirement already satisfied: requests in ./anaconda3/envs/lindy/lib/python3.7/site-packages (from cvlib) (2.22.0)
Collecting pillow (from cvlib)
Downloading https://files.pythonhosted.org/packages/a4/da/2bd281c875686230eabc13d20ab590ea617563b0e746abfb0698c4d5b645/Pillow-6.1.0-cp37-cp37m-manylinux1_x86_64.whl (2.1MB)
|████████████████████████████████| 2.1MB 25.8MB/s
Collecting keras (from cvlib)
Downloading https://files.pythonhosted.org/packages/1b/18/2e1ef121e5560ac24c7ac9e363aa5fa7006c40563c989e7211aba95b793a/Keras-2.3.0-py2.py3-none-any.whl (377kB)
|████████████████████████████████| 378kB 31.4MB/s
Collecting imageio (from cvlib)
Downloading https://files.pythonhosted.org/packages/af/0a/943c965d372dae0b1f1482677d29030ab834351a61a9a632fd62f27f1523/imageio-2.5.0-py3-none-any.whl (3.3MB)
|████████████████████████████████| 3.3MB 29.0MB/s
Collecting imutils (from cvlib)
Downloading https://files.pythonhosted.org/packages/b5/94/46dcae8c061e28be31bcaa55c560cb30ee9403c9a4bb2659768ec1b9eb7d/imutils-0.5.3.tar.gz
Requirement already satisfied: certifi>=2017.4.17 in ./anaconda3/envs/lindy/lib/python3.7/site-packages (from requests->cvlib) (2019.6.16)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in ./anaconda3/envs/lindy/lib/python3.7/site-packages (from requests->cvlib) (1.25.3)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./anaconda3/envs/lindy/lib/python3.7/site-packages (from requests->cvlib) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in ./anaconda3/envs/lindy/lib/python3.7/site-packages (from requests->cvlib) (2.8)
Requirement already satisfied: six>=1.9.0 in ./anaconda3/envs/lindy/lib/python3.7/site-packages (from keras->cvlib) (1.12.0)
Collecting h5py (from keras->cvlib)
Downloading https://files.pythonhosted.org/packages/3f/c0/abde58b837e066bca19a3f7332d9d0493521d7dd6b48248451a9e3fe2214/h5py-2.10.0-cp37-cp37m-manylinux1_x86_64.whl (2.9MB)
|████████████████████████████████| 2.9MB 30.0MB/s
Collecting keras-preprocessing>=1.0.5 (from keras->cvlib)
Downloading https://files.pythonhosted.org/packages/28/6a/8c1f62c37212d9fc441a7e26736df51ce6f0e38455816445471f10da4f0a/Keras_Preprocessing-1.1.0-py2.py3-none-any.whl (41kB)
|████████████████████████████████| 51kB 1.5MB/s
Collecting scipy>=0.14 (from keras->cvlib)
Downloading https://files.pythonhosted.org/packages/94/7f/b535ec711cbcc3246abea4385d17e1b325d4c3404dd86f15fc4f3dba1dbb/scipy-1.3.1-cp37-cp37m-manylinux1_x86_64.whl (25.2MB)
|████████████████████████████████| 25.2MB 21.8MB/s
Collecting pyyaml (from keras->cvlib)
Downloading https://files.pythonhosted.org/packages/e3/e8/b3212641ee2718d556df0f23f78de8303f068fe29cdaa7a91018849582fe/PyYAML-5.1.2.tar.gz (265kB)
|████████████████████████████████| 266kB 31.3MB/s
Collecting keras-applications>=1.0.6 (from keras->cvlib)
Downloading https://files.pythonhosted.org/packages/71/e3/19762fdfc62877ae9102edf6342d71b28fbfd9dea3d2f96a882ce099b03f/Keras_Applications-1.0.8-py3-none-any.whl (50kB)
|████████████████████████████████| 51kB 16.0MB/s
Building wheels for collected packages: cvlib, progressbar, imutils, pyyaml
Building wheel for cvlib (setup.py) ... done
Stored in directory: /home/founder/.cache/pip/wheels/22/b7/0f/8d3ee1bf6f30d408e11250bd4d0a8270ffe22fb7b54a987380
Building wheel for progressbar (setup.py) ... done
Stored in directory: /home/founder/.cache/pip/wheels/c0/e9/6b/ea01090205e285175842339aa3b491adeb4015206cda272ff0
Building wheel for imutils (setup.py) ... done
Stored in directory: /home/founder/.cache/pip/wheels/16/84/1f/bf88641293cda2c8be81a5c4b8ca973dd9125a6dc3767417fd
Building wheel for pyyaml (setup.py) ... done
Stored in directory: /home/founder/.cache/pip/wheels/d9/45/dd/65f0b38450c47cf7e5312883deb97d065e030c5cca0a365030
Successfully built cvlib progressbar imutils pyyaml
Installing collected packages: progressbar, pillow, h5py, keras-preprocessing, scipy, pyyaml, keras-applications, keras, imageio, imutils, cvlib
Successfully installed cvlib-0.2.2 h5py-2.10.0 imageio-2.5.0 imutils-0.5.3 keras-2.3.0 keras-applications-1.0.8 keras-preprocessing-1.1.0 pillow-6.1.0 progressbar-2.5 pyyaml-5.1.2 scipy-1.3.1
설치된 버전 확인해보자. 텐서플로우 모듈을 찾을 수 없다는 에러가 발생했다.
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cvlib as cv
Using TensorFlow backend.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/founder/anaconda3/envs/lindy/lib/python3.7/site-packages/cvlib/__init__.py", line 8, in <module>
from .gender_detection import detect_gender
File "/home/founder/anaconda3/envs/lindy/lib/python3.7/site-packages/cvlib/gender_detection.py", line 4, in <module>
from keras.utils import get_file
File "/home/founder/anaconda3/envs/lindy/lib/python3.7/site-packages/keras/__init__.py", line 3, in <module>
from . import utils
File "/home/founder/anaconda3/envs/lindy/lib/python3.7/site-packages/keras/utils/__init__.py", line 6, in <module>
from . import conv_utils
File "/home/founder/anaconda3/envs/lindy/lib/python3.7/site-packages/keras/utils/conv_utils.py", line 9, in <module>
from .. import backend as K
File "/home/founder/anaconda3/envs/lindy/lib/python3.7/site-packages/keras/backend/__init__.py", line 1, in <module>
from .load_backend import epsilon
File "/home/founder/anaconda3/envs/lindy/lib/python3.7/site-packages/keras/backend/load_backend.py", line 90, in <module>
from .tensorflow_backend import *
File "/home/founder/anaconda3/envs/lindy/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 5, in <module>
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
텐서플로우를 설치한 후 다시 실행해보자. 정상적으로 라이브러리를 불러옴을 알 수 있다.
(lindy) founder@casey:~$ python
Python 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 21:52:21)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cvlib as cv
Using TensorFlow backend.
>>>
더욱 자세한 정보는 아래 사이트에서 찾아볼 수 있다.
728x90