原版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/*
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/albumentations/*
Proceed (y/n)? y
Successfully uninstalled albumentations-1.1.0
再卸载原版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/*
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless-4.5.5.64.dist-info/*
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libavcodec-65fa80df.so.58.134.100
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libavformat-8ef5c7db.so.58.76.100
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libavutil-9c768859.so.56.70.100
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libbz2-a273e504.so.1.0.6
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libcrypto-09fe7800.so.1.1
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libgfortran-91cc3cb1.so.3.0.0
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libopenblas-r0-f650aae0.3.3.so
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libquadmath-96973f99.so.0.0.0
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libssl-b92f8066.so.1.1
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libswresample-99364a1c.so.3.9.100
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libswscale-e6451464.so.5.9.100
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libvpx-1016051d.so.7.0.0
Would not remove (might be manually added):
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libQtCore-ada04e4a.so.4.8.7
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libQtGui-903938cd.so.4.8.7
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libQtTest-1183da5d.so.4.8.7
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libavcodec-4cf96bc1.so.58.65.103
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libavformat-b798543f.so.58.35.101
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libavutil-ac3ec209.so.56.38.100
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libbz2-7225278b.so.1.0.3
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libcrypto-cc2fb98b.so.1.1
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libssl-fdf0b66c.so.1.1
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libswresample-994f1795.so.3.6.100
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libswscale-99a5f1f1.so.5.6.100
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libvpx-3dd7ccd6.so.6.2.0
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libz-a147dcb0.so.1.2.3
/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/cv2.cpython-37m-x86_64-linux-gnu.so
Proceed (y/n)? y
Successfully uninstalled opencv-python-headless-4.5.5.64
安装老版本heartless
pip install albumentations -i https://pypi.mirrors.ustc.edu.cn/simple/
Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/
Collecting albumentations
Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/75/27/a8b0a738f8423b7ef9d0c9f8e73d5867395dbdae563c1655e9548cf700b9/albumentations-1.1.0-py3-none-any.whl (102 kB)
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://pypi.mirrors.ustc.edu.cn/simple/
Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/
Collecting albumentations
Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/75/27/a8b0a738f8423b7ef9d0c9f8e73d5867395dbdae563c1655e9548cf700b9/albumentations-1.1.0-py3-none-any.whl (102 kB)
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'
差不多能用就新