- 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.
推薦閱讀
- Learning Cocos2d-x Game Development
- Cortex-M3 + μC/OS-II嵌入式系統開發入門與應用
- Linux KVM虛擬化架構實戰指南
- 新型電腦主板關鍵電路維修圖冊
- 計算機組裝與系統配置
- Effective STL中文版:50條有效使用STL的經驗(雙色)
- Manage Partitions with GParted How-to
- Camtasia Studio 8:Advanced Editing and Publishing Techniques
- Learning Game Physics with Bullet Physics and OpenGL
- 分布式系統與一致性
- 計算機組裝與維護(第3版)
- Source SDK Game Development Essentials
- Hands-On Artificial Intelligence for Banking
- 電腦組裝與維護即時通
- Learning Microsoft Cognitive Services