Skip to content

Commit

Permalink
fix tflearn#129 (random_crop)
Browse files Browse the repository at this point in the history
  • Loading branch information
aymericdamien committed Jun 6, 2016
1 parent c5bdfe0 commit c23f79e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tflearn/data_augmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def add_random_crop(self, crop_shape, padding=None):
imgaug.add_random_crop((32, 32), 6)
```
Args:
Arguments:
crop_shape: `tuple` of `int`. The crop shape (height, width).
padding: `int`. If not None, the image is padded with 'padding' 0s.
Expand Down Expand Up @@ -141,6 +141,8 @@ def add_random_blur(self, sigma_max=5.):

def _random_crop(self, batch, crop_shape, padding=None):
oshape = np.shape(batch[0])
if padding:
oshape = (oshape[0] + padding, oshape[1] + padding)
new_batch = []
npad = ((padding, padding), (padding, padding), (0, 0))
for i in range(len(batch)):
Expand Down

0 comments on commit c23f79e

Please sign in to comment.