话不多说,直接上github: https://github.com/aleju/imgaug
imgaug库介绍:
This python library helps you with augmenting images for your machine learning projects. It converts a set of input images into a new, much larger set of slightly altered images.
这个python的库可以帮助你在你的机器学习项目中增强你的数据。它可以将你的输入图片转换成很多新的、更大数据量的轻微变动的图片,这对于数量比较小的数据集来说简直是福音!!
如下:
这是比较base的转换,像加入噪声、裁切等基本常用的数据增强方法
下面是一些比较特殊的:
具体安装步骤:
主要是参考 https://imgaug.readthedocs.io/en/latest/source/installation.html
(1)安装imgaug库前的准备:
你需要安装好上述的库,最好是用cv2
(2)安装imgaug库
为了确保获得最新的下载版本(从github上),输入:
sudo pip install git+https://github.com/aleju/imgaug
如果你要装在python3.处,则输入:
sudo pip3 install git+https://github.com/aleju/imgaug
(3)如果你要卸载imgaug库
输入:
pip uninstall imgaug
或者
pip3 uninstall imgaug
安装完成如下: