jgraving / DeepPoseKit

a toolkit for pose estimation using deep learning

Home Page:http://deepposekit.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Index error for flipAxis in augmenter

Funkyojo opened this issue · comments

image
When I include flip axis left and right into the augmenter, I get this error.
I suspect that my non-square input dimension, (100,300), could be the source of the problem.
This is not a big problem for me personally since I have my own flipping pipeline, but the dev might want to know.

Following is the full error log:

IndexError Traceback (most recent call last)

in ()
6 use_graph=True,
7 random_seed=1,
----> 8 graph_scale=1)
9 train_generator.get_config()

11 frames

/usr/local/lib/python3.6/dist-packages/deepposekit/io/TrainingGenerator.py in init(self, generator, downsample_factor, use_graph, augmenter, shuffle, sigma, validation_split, graph_scale, random_seed)
119 self.confidence = True
120 self._init_augmenter(augmenter)
--> 121 self._init_data(generator)
122 self.on_epoch_end()
123

/usr/local/lib/python3.6/dist-packages/deepposekit/io/TrainingGenerator.py in _init_data(self, generator)
190
191 self.on_epoch_end()
--> 192 X, y = self.getitem(0)
193 self.n_output_channels = y.shape[-1]
194

/usr/local/lib/python3.6/dist-packages/deepposekit/io/TrainingGenerator.py in getitem(self, index)
253
254 # Generate data
--> 255 X, y = self.generate_batch(indexes)
256
257 return X, y

/usr/local/lib/python3.6/dist-packages/deepposekit/io/TrainingGenerator.py in generate_batch(self, indexes)
291 X, y = self.load_batch(indexes)
292 if self.augmenter is not None and not self.validation:
--> 293 X, y = self.augment(X, y)
294 if self.confidence:
295 y = draw_confidence_maps(

/usr/local/lib/python3.6/dist-packages/deepposekit/io/TrainingGenerator.py in augment(self, images, keypoints)
278 images_idx = images[idx, None]
279 keypoints_idx = keypoints[idx, None]
--> 280 augmented_idx = self.augmenter(images=images_idx, keypoints=keypoints_idx)
281 images_aug_idx, keypoints_aug_idx = augmented_idx
282 images_aug.append(images_aug_idx)

/usr/local/lib/python3.6/dist-packages/imgaug/augmenters/meta.py in call(self, *args, **kwargs)
1886 def call(self, *args, **kwargs):
1887 """Alias for :func:imgaug.augmenters.meta.Augmenter.augment."""
-> 1888 return self.augment(*args, **kwargs)
1889
1890 def pool(self, processes=None, maxtasksperchild=None, seed=None):

/usr/local/lib/python3.6/dist-packages/imgaug/augmenters/meta.py in augment(self, return_batch, hooks, **kwargs)
1857 )
1858
-> 1859 batch_aug = self.augment_batch(batch, hooks=hooks)
1860
1861 # return either batch or tuple of augmentables, depending on what

/usr/local/lib/python3.6/dist-packages/imgaug/augmenters/meta.py in augment_batch(self, batch, hooks)
437 for attr_name, attr in augmentables:
438 aug = getattr(augseq, "augment_%s" % (attr_name,))(
--> 439 attr, hooks=hooks)
440 setattr(batch, "%s_aug" % (attr_name,), aug)
441

/usr/local/lib/python3.6/dist-packages/imgaug/augmenters/meta.py in augment_keypoints(self, keypoints_on_images, parents, hooks)
949 random_state=ia.copy_random_state(self.random_state),
950 parents=parents,
--> 951 hooks=hooks
952 )
953 ia.forward_random_state(self.random_state)

/usr/local/lib/python3.6/dist-packages/imgaug/augmenters/meta.py in _augment_keypoints(self, keypoints_on_images, random_state, parents, hooks)
2858 keypoints_on_images=keypoints_on_images,
2859 parents=parents + [self],
-> 2860 hooks=hooks
2861 )
2862 return keypoints_on_images

/usr/local/lib/python3.6/dist-packages/imgaug/augmenters/meta.py in augment_keypoints(self, keypoints_on_images, parents, hooks)
949 random_state=ia.copy_random_state(self.random_state),
950 parents=parents,
--> 951 hooks=hooks
952 )
953 ia.forward_random_state(self.random_state)

/usr/local/lib/python3.6/dist-packages/deepposekit/augment/FlipAxis.py in _augment_keypoints(self, keypoints_on_images, random_state, parents, hooks)
136 swapped = keypoints_on_image.keypoints.copy()
137 for r in range(len(keypoints_on_image.keypoints)):
--> 138 idx = self.swap_index[r]
139 if idx >= 0:
140 keypoints_on_image.keypoints[r] = swapped[idx]

IndexError: index 3 is out of bounds for axis 0 with size 3

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

commented

This issue has been automatically closed because it has not had recent activity.