- Intelligent Projects Using Python
- Santanu Pattanayak
- 129字
- 2021-07-02 14:10:50
Additional image generation through affine transformation
The keras image generator would work for our task using the following class:
datagen = ImageDataGenerator(
horizontal_flip = True,
vertical_flip = True,
width_shift_range = 0.1,
height_shift_range = 0.1,
channel_shift_range=0,
zoom_range = 0.2,
rotation_range = 20)
As you can see from the defined generator, we have enabled horizontal and vertical flipping, which is nothing but a reflection of the images along the horizontal and vertical axes, respectively. Similarly, we have defined the image translations along the width and the height to be within 10% of the pixel locations along those directions. The range of rotation is confined to an angle of 20 degrees, whereas the scale factor is defined to be within 0.8 to 1.2 of the original image.
推薦閱讀
- 觸摸屏實用技術(shù)與工程應(yīng)用
- Linux KVM虛擬化架構(gòu)實戰(zhàn)指南
- 顯卡維修知識精解
- 新型電腦主板關(guān)鍵電路維修圖冊
- 電腦常見問題與故障排除
- 深入淺出SSD:固態(tài)存儲核心技術(shù)、原理與實戰(zhàn)
- 計算機應(yīng)用與維護(hù)基礎(chǔ)教程
- 固態(tài)存儲:原理、架構(gòu)與數(shù)據(jù)安全
- 計算機組裝維修與外設(shè)配置(高等職業(yè)院校教改示范教材·計算機系列)
- STM32自學(xué)筆記
- FPGA實驗實訓(xùn)教程
- 筆記本電腦維修技能實訓(xùn)
- 計算機組裝、維護(hù)與維修項目教程
- 筆記本電腦的結(jié)構(gòu)、原理與維修
- 創(chuàng)客電子:Arduino和Raspberry Pi智能制作項目精選