(img, v)
| 112 | |
| 113 | |
| 114 | def Cutout(img, v): #[0, 60] => percentage: [0, 0.2] => change to [0, 0.5] |
| 115 | assert 0.0 <= v <= 0.5 |
| 116 | if v <= 0.: |
| 117 | return img |
| 118 | |
| 119 | v = v * img.size[0] |
| 120 | return CutoutAbs(img, v) |
| 121 | |
| 122 | |
| 123 | def CutoutAbs(img, v): # [0, 60] => percentage: [0, 0.2] |