Closed Smankusors closed 4 years ago
Hello, thanks for the PR, Could you add some tests that check that the new behavior is respected?
Hello, thanks for the PR, Could you add some tests that check that the new behavior is respected?
hmm currently I'm on Windows. But I have trouble running tests. I got
E ModuleNotFoundError: No module named 'resource'
I think I will need to use Linux to run tests? I already tried pip3 install resource
but still module not found 😢
anyway, what do you think about this?
def test_random_brightness_scale():
img = np.ones((1, 1, 3)) * 128
zeros = np.zeros((1, 1, 3))
assert np.array_equal(img, affine_transformations.random_brightness(img, [1, 1], scale=False))
assert np.array_equal(zeros, affine_transformations.random_brightness(img, [1, 1], scale=True))
Yeah looks good. Yup you need UNIX to run the rest. We should probably change that.
alright, I run the tests on the Google Colab 🤣
And I made little changes so the tests can run successfully.
Summary
This add an option to not scale the image (to 0 - 255) when doing
random_brightness
. This also might fixes #114.Code example :
Related Issues
There's no documentation about this on keras.io...
PR Overview