Augmentor 使用介绍

2018-04-01 16:33:35 浏览数 (3)

Augmentor 使用介绍

原图

<center>

<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/qgyfcdgf0ib.jpg" style="border:5px solid black;border-radius:15px;">

</center>

random_distortion(probability, grid_height, grid_width, magnitude)

最终选择参数为

  • p.random_distortion(probability=0.8, grid_height=3, grid_width=3, magnitude=6)

<center>

代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/5bubp44fkk2.jpg" style="border:5px solid black;border-radius:15px;">

</center>

其他参数效果:

magnitudegrid_width,grid_height越大,扭曲程度越大


  • p.random_distortion(probability=0.6, grid_height=6, grid_width=6, magnitude=5)

<center>

代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/w1h2pozgsb4.jpg" style="border:5px solid black;border-radius:15px;">

</center>

  • p.random_distortion(probability=0.6, grid_height=6, grid_width=6, magnitude=9)

<center>

代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/lskpr02hcvt.jpg" style="border:5px solid black;border-radius:15px;">

</center>

  • p.random_distortion(probability=0.6, grid_height=10, grid_width=10, magnitude=5)

<center>

代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/jbomeok2ebd.jpg" style="border:5px solid black;border-radius:15px;">

</center>

random_erasing(probability, rectangle_area)

rectangle_area表示覆盖区域的比例,值越大比例越大。但是设置为1的时候并不是全覆盖,不知道为什么,反正也没必要弄清楚

  • p.random_erasing(1,1)

<center>

代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/fyiuon2oken.jpg" style="border:5px solid black;border-radius:15px;">

</center>

zoom_random(probability, percentage_area)

放大图片,然后按照percenta_area的比例对图片进行crop。

  • p.zoom_random(probability=1, percentage_area=0.2)

<center>

代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/4wbhu3jjulw.jpg" style="border:5px solid black;border-radius:15px;">

</center>

  • p.zoom_random(probability=1, percentage_area=0.8)

<center>

代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/ufrutrgco4f.jpg" style="border:5px solid black;border-radius:15px;">

</center>

zoom(probability, min_factor, max_factor)

  • p.zoom(probability=1, min_factor=1.1, max_factor=1.5)

<center>

代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/euis2kdvhae.jpg" style="border:5px solid black;border-radius:15px;">

</center>

  • p.zoom(probability=1, min_factor=2, max_factor=2)

<center>

代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/qid41yxqqo3.jpg" style="border:5px solid black;border-radius:15px;">

</center>

组合操作

代码语言:txt复制
p.rotate_random_90(probability=0.8)
p.random_distortion(probability=0.8, grid_height=3, grid_width=3, magnitude=6)
p.random_erasing(0.3, 0.2)
p.zoom(probability=0.4, min_factor=1.1, max_factor=1.5)
p.sample(6)

<center>

代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/0lgnqc1n2zu.jpg" style="border:5px solid black;border-radius:15px;">
代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/gb5juwe3ckk.jpg" style="border:5px solid black;border-radius:15px;">
代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/ofsy0scpiyv.jpg" style="border:5px solid black;border-radius:15px;">
代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/wrqlk1zna0n.jpg" style="border:5px solid black;border-radius:15px;">
代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/udddr4bnvhj.jpg" style="border:5px solid black;border-radius:15px;">
代码语言:txt复制
<img src="https://img.yuanmabao.com/zijie/pic/2018/04/01/hgsu5sh0qep.jpg" style="border:5px solid black;border-radius:15px;">

</center>

0 人点赞