-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OneOf with bounding boxes crash #445
Comments
I propose to change the if statement: if isinstance(augmentation, Augmentation) and \
not isinstance(augmentation, OneOf) and \
not isinstance(augmentation, AugmentationSequence): Everything works okay until new error is thrown:
Seems like 798 line should process |
@Travvy88 Do you mind investigating this further to see if you can identify a solution? If so, you could prepare a PR and we could include you as a listed contributor associated with the library. |
Yes, I will try. |
@jboarman according to my research, the next error at line def __call__(self, image, layer=None, mask=None, keypoints=None, bounding_boxes=None, force=False):
if force or self.should_run():
# reset to prevent memory leaks
self.results = []
result = image
for augmentation in self.augmentations:
if isinstance(result, tuple):
result = result[0]
current_result = augmentation(result, mask=mask, keypoints=keypoints, bounding_boxes=bounding_boxes)
if isinstance(augmentation, Augmentation):
if (mask is not None) or (keypoints is not None) or (bounding_boxes is not None):
current_result, mask, keypoints, bounding_boxes = current_result
self.results.append(current_result)
# make sure result is not None when parsing it to the next augmentation
if not isinstance(result, tuple) and current_result is not None:
result = current_result
elif isinstance(current_result, tuple):
if current_result[0] is not None:
result = current_result
return result, self.augmentations Can you tell me, is that the plan? Or there is possibly a bug and the bboxes and other info should be nested into result variable to return it from AugmentationSequence? |
Thanks for pointing this out. In
Could you check and do the same for |
I fixed 751st line in |
Hello! Thanks for good library for doc augmentations.
I faced problem with bounding boxes. When I run augraphy pipeline with bounding boxes and there is the
OneOf
inside it crashes. When I deleteOneOf
everything works well.Error log:
It seems like
augmentationpipeline.py:754
line should filterOneOf
andAugmentationSequence
objects. However, both of them are children ofAugmentation
class.isinstance(augmentation, Augmentation)
is True when augmentation variable isOneOf
orAugmentationSequence
and this objects are not filtered.The text was updated successfully, but these errors were encountered: