原版opencv执行图像增强出现
(py37cv34) kobosp@R1015u:~/SLAC/TreeLabelMerge$ python3 7YOLOAlbumentation.py
Traceback (most recent call last):
File "7YOLOAlbumentation.py", line 2, in <module>
import cv2
File "/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/__init__.py", line 9, in <module>
from .cv2 import _registerMatType
ImportError: cannot import name '_registerMatType' from 'cv2.cv2' (/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/cv2.cpython-37m-x86_64-linux-gnu.so)
先卸载图像增强
pip uninstall albumentations
Found existing installation: albumentations 1.1.0
Uninstalling albumentations-1.1.0:
Would remove:
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/albumentations-1.1.0.dist-info
再卸载原版OPENCV heartless
!pip uninstall opencv-python-headless
pip uninstall albumentations uninstall opencv-python-headless
WARNING: Skipping albumentations as it is not installed.
WARNING: Skipping uninstall as it is not installed.
Found existing installation: opencv-python-headless 4.5.5.64
Uninstalling opencv-python-headless-4.5.5.64:
Would remove:
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2
安装老版本heartless
pip install albumentations -i https:
Looking in indexes: https:
Collecting albumentations
Using cached https:
Requirement already satisfied: PyYAML in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (6.0)
Requirement already satisfied: scikit-image>=0.16.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (0.19.2)
Requirement already satisfied: numpy>=1.11.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (1.21.3)
Requirement already satisfied: opencv-python-headless>=4.1.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (4.1.2.30)
Requirement already satisfied: scipy in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (1.7.3)
Requirement already satisfied: qudida>=0.0.4 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (0.0.4)
Requirement already satisfied: typing-extensions in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from qudida>=0.0.4->albumentations) (4.1.1)
Requirement already satisfied: scikit-learn>=0.19.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from qudida>=0.0.4->albumentations) (1.0.2)
Requirement already satisfied: packaging>=20.0 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (21.3)
Requirement already satisfied: pillow!=7.1.0,!=7.1.1,!=8.3.0,>=6.1.0 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (9.1.0)
Requirement already satisfied: imageio>=2.4.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (2.18.0)
Requirement already satisfied: PyWavelets>=1.1.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (1.3.0)
Requirement already satisfied: tifffile>=2019.7.26 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (2021.11.2)
Requirement already satisfied: networkx>=2.2 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (2.6.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from packaging>=20.0->scikit-image>=0.16.1->albumentations) (3.0.7)
Requirement already satisfied: threadpoolctl>=2.0.0 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-learn>=0.19.1->qudida>=0.0.4->albumentations) (3.1.0)
Requirement already satisfied: joblib>=0.11 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-learn>=0.19.1->qudida>=0.0.4->albumentations) (1.1.0)
Installing collected packages: albumentations
Successfully installed albumentations-1.1.0
安装图像zqiang
pip install albumentations -i https:
Looking in indexes: https:
Collecting albumentations
Using cached https:
Requirement already satisfied: PyYAML in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (6.0)
Requirement already satisfied: scikit-image>=0.16.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (0.19.2)
Requirement already satisfied: numpy>=1.11.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (1.21.3)
Requirement already satisfied: opencv-python-headless>=4.1.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (4.1.2.30)
Requirement already satisfied: scipy in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (1.7.3)
Requirement already satisfied: qudida>=0.0.4 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (0.0.4)
Requirement already satisfied: typing-extensions in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from qudida>=0.0.4->albumentations) (4.1.1)
Requirement already satisfied: scikit-learn>=0.19.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from qudida>=0.0.4->albumentations) (1.0.2)
Requirement already satisfied: packaging>=20.0 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (21.3)
Requirement already satisfied: pillow!=7.1.0,!=7.1.1,!=8.3.0,>=6.1.0 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (9.1.0)
Requirement already satisfied: imageio>=2.4.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (2.18.0)
Requirement already satisfied: PyWavelets>=1.1.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (1.3.0)
Requirement already satisfied: tifffile>=2019.7.26 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (2021.11.2)
Requirement already satisfied: networkx>=2.2 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (2.6.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from packaging>=20.0->scikit-image>=0.16.1->albumentations) (3.0.7)
Requirement already satisfied: threadpoolctl>=2.0.0 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-learn>=0.19.1->qudida>=0.0.4->albumentations) (3.1.0)
Requirement already satisfied: joblib>=0.11 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-learn>=0.19.1->qudida>=0.0.4->albumentations) (1.1.0)
Installing collected packages: albumentations
Successfully installed albumentations-1.1.0
opencv版本不匹配导致没法显示
Traceback (most recent call last):
File "7YOLOAlbumentation.py", line 24, in <module>
cv2.waitKey(0)
cv2.error: OpenCV(4.1.2) /io/opencv/modules/highgui/src/window.cpp:717: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvWaitKey'
差不多能用就新
|