东方耀AI技术分享

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 3316|回复: 0

[课堂笔记] 安装图像增强库imgaug会影响opencv的使用

[复制链接]

1365

主题

1856

帖子

1万

积分

管理员

Rank: 10Rank: 10Rank: 10

积分
14418
QQ
发表于 2019-12-24 15:47:23 | 显示全部楼层 |阅读模式

安装图像增强库imgaug会影响opencv的使用

  1. (py3_tf1_gpu_torch) dfy888@Dfy888-Ubuntu:~/py3_tf1_gpu_torch_works$ pip3 install opencv-python
  2. Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
  3. Collecting opencv-python
  4.   Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c0/a9/9828dfaf93f40e190ebfb292141df6b7ea1a2d57b46263e757f52be8589f/opencv_python-4.1.2.30-cp36-cp36m-manylinux1_x86_64.whl (28.3MB)
  5.      |████████████████████████████████| 28.3MB 23kB/s
  6. Requirement already satisfied: numpy>=1.11.3 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from opencv-python) (1.18.0)
  7. Installing collected packages: opencv-python
  8. Successfully installed opencv-python-4.1.2.30
  9. (py3_tf1_gpu_torch) dfy888@Dfy888-Ubuntu:~/py3_tf1_gpu_torch_works$ pip3 install imgaug
  10. Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
  11. Collecting imgaug
  12.   Downloading https://pypi.tuna.tsinghua.edu.cn/packages/11/df/5a3bba95b4600d5ca7aff072082ef0d9837056dd28cc4e738e7ce88dd8f8/imgaug-0.3.0-py2.py3-none-any.whl (819kB)
  13.      |████████████████████████████████| 829kB 1.1MB/s
  14. Requirement already satisfied: six in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from imgaug) (1.13.0)
  15. Requirement already satisfied: scipy in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from imgaug) (1.4.1)
  16. Collecting opencv-python-headless
  17.   Downloading https://pypi.tuna.tsinghua.edu.cn/packages/5d/96/b2824df85d8c5f148125e4fee073a62fde17639502fe67042b212ebfe488/opencv_python_headless-4.1.2.30-cp36-cp36m-manylinux1_x86_64.whl (21.8MB)
  18.      |████████████████████████████████| 21.8MB 10.6MB/s
  19. Collecting scikit-image>=0.14.2
  20.   Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c8/bb/771800366f41d66eef51e4b80515f8ef7edab234a3f244fdce3bafe89b39/scikit_image-0.16.2-cp36-cp36m-manylinux1_x86_64.whl
  21. Collecting Shapely
  22.   Using cached https://pypi.tuna.tsinghua.edu.cn/packages/38/b6/b53f19062afd49bb5abd049aeed36f13bf8d57ef8f3fa07a5203531a0252/Shapely-1.6.4.post2-cp36-cp36m-manylinux1_x86_64.whl
  23. Collecting imageio
  24.   Using cached https://pypi.tuna.tsinghua.edu.cn/packages/1a/de/f7f985018f462ceeffada7f6e609919fbcc934acd9301929cba14bc2c24a/imageio-2.6.1-py3-none-any.whl
  25. Requirement already satisfied: Pillow in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from imgaug) (6.2.1)
  26. Requirement already satisfied: matplotlib in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from imgaug) (3.1.2)
  27. Requirement already satisfied: numpy>=1.15 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from imgaug) (1.18.0)
  28. Collecting networkx>=2.0
  29.   Using cached https://pypi.tuna.tsinghua.edu.cn/packages/41/8f/dd6a8e85946def36e4f2c69c84219af0fa5e832b018c970e92f2ad337e45/networkx-2.4-py3-none-any.whl
  30. Collecting PyWavelets>=0.4.0
  31.   Using cached https://pypi.tuna.tsinghua.edu.cn/packages/59/bb/d2b85265ec9fa3c1922210c9393d4cdf7075cc87cce6fe671d7455f80fbc/PyWavelets-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
  32. Requirement already satisfied: python-dateutil>=2.1 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from matplotlib->imgaug) (2.8.1)
  33. Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from matplotlib->imgaug) (2.4.5)
  34. Requirement already satisfied: kiwisolver>=1.0.1 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from matplotlib->imgaug) (1.1.0)
  35. Requirement already satisfied: cycler>=0.10 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from matplotlib->imgaug) (0.10.0)
  36. Requirement already satisfied: decorator>=4.3.0 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from networkx>=2.0->scikit-image>=0.14.2->imgaug) (4.4.1)
  37. Requirement already satisfied: setuptools in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib->imgaug) (42.0.2.post20191203)
  38. Installing collected packages: opencv-python-headless, networkx, PyWavelets, imageio, scikit-image, Shapely, imgaug
  39. Successfully installed PyWavelets-1.1.1 Shapely-1.6.4.post2 imageio-2.6.1 imgaug-0.3.0 networkx-2.4 opencv-python-headless-4.1.2.30 scikit-image-0.16.2
复制代码

主要是因为:安装imgaug时会安装opencv-python-headless(这个在捣乱)
执行以下几步:
pip3 uninstall opencv-python-headless
pip3 uninstall opencv-python
pip3 install opencv-python
之后OpenCV可以正常imread imshow啦 我亲自遇到过的



  1. (py3_tf1_gpu_torch) dfy888@Dfy888-Ubuntu:~/py3_tf1_gpu_torch_works$ pip3 uninstall opencv-python-headless
  2. Uninstalling opencv-python-headless-4.1.2.30:
  3.   Would remove:
  4.     /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/*
  5.     /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/opencv_python_headless-4.1.2.30.dist-info/*
  6.   Would not remove (might be manually added):
  7.     /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/.libs/libQtCore-bbdab771.so.4.8.7
  8.     /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/.libs/libQtGui-903938cd.so.4.8.7
  9.     /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/.libs/libQtTest-1183da5d.so.4.8.7
  10. Proceed (y/n)? y
  11.   Successfully uninstalled opencv-python-headless-4.1.2.30
  12. (py3_tf1_gpu_torch) dfy888@Dfy888-Ubuntu:~/py3_tf1_gpu_torch_works$ pip3 uninstall opencv-python
  13. Uninstalling opencv-python-4.1.2.30:
  14.   Would remove:
  15.     /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/.libs/libQtCore-bbdab771.so.4.8.7
  16.     /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/.libs/libQtGui-903938cd.so.4.8.7
  17.     /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/.libs/libQtTest-1183da5d.so.4.8.7
  18.     /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/opencv_python-4.1.2.30.dist-info/*
  19. Proceed (y/n)? y
  20.   Successfully uninstalled opencv-python-4.1.2.30
  21. (py3_tf1_gpu_torch) dfy888@Dfy888-Ubuntu:~/py3_tf1_gpu_torch_works$ pip3 install opencv-python
  22. Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
  23. Collecting opencv-python
  24.   Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c0/a9/9828dfaf93f40e190ebfb292141df6b7ea1a2d57b46263e757f52be8589f/opencv_python-4.1.2.30-cp36-cp36m-manylinux1_x86_64.whl
  25. Requirement already satisfied: numpy>=1.11.3 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from opencv-python) (1.18.0)
  26. Installing collected packages: opencv-python
  27. Successfully installed opencv-python-4.1.2.30
复制代码





让天下人人学会人工智能!人工智能的前景一片大好!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|人工智能工程师的摇篮 ( 湘ICP备2020019608号-1 )

GMT+8, 2024-3-28 16:35 , Processed in 0.178576 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表