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
Bugs in Folding Augmentation #55
Comments
Thanks, i will test it again the patch it in the next update. |
Thanks for testing it out . I couldn't get a similar error but I'm getting a different error instead. Could you try again to replace the
|
Fixed with PR #59 |
@kwcckw I found some bugs in
folding.py
, can you take a look?Bugs
fold_y_shift_min
andfold_y_shift_max
infolding.py
will become 0 after multiplication by a number in (0.1,0.2) due to the int cast, which makes fold_y_shift on the following line fail trying to generate a random from an empty range. This can be resolved by restricting images to be a minimum of 10x10.fold_y_shift
is sometimes 0 for similar reasons, which makes the call toimg_warped[:-fold_y_shift ,:,:]
on line 158 fail. It tries to take an empty slice of the array using:-fold_y_shift
, which makes theimg_fuse[cys:cye,cxs:cxe,:]
call on that same line fail with aValueError: could not broadcast input array from shape (0,14,3) into shape (95,14,3)
(for example - the real numbers are different every time, but the first value of the triple is always 0 because no elements were selected by the array slice.)four_point_transform()
, but I haven't been able to track down why yet. Here's the stack trace:Testing
You can test this yourself by making
test_folding_augmentation.py
in the project directory with the following contents:and running
pytest test_folding_augmentation.py
a bunch of times (it needs to be run several times because this bug doesn't always appear). You can make the first two bugs appear very reliably by settingxdim
andydim
to numbers less than 10.For easy testing you can run
for i in {1..20}; do pytest test_folding_augmentation.py; done;
The text was updated successfully, but these errors were encountered: