-
Notifications
You must be signed in to change notification settings - Fork 2
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
Image augmentation #18
Changes from 1 commit
77a066b
8f21e58
4df2a7a
604e306
6bd75cd
0788b0d
55d3995
88472c8
ced288a
f6f3a99
38112db
8465d4d
2b92273
9a1f9ec
aee63b9
5868270
1e8ef8a
343a876
bed6f7e
1816a4f
7717133
e461410
f574ea4
56824b8
600cc71
2f87dde
fa02ba0
d06338d
e110256
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,10 @@ | |
class TestImageAugmenter(unittest.TestCase): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a test that actually takes an image and apply a transformation, to make sure it properly happen? It can be that it takes a random transformation on a manually created 1,H,W,C numpy array and when applied we make sure some change happened. This will also prevent bugs on theimplementation |
||
def test_every_augmenter(self): | ||
image_augmenter = ImageAugmenter() | ||
configuration = image_augmenter.get_hyperparameter_search_space().sample_configuration() | ||
configuration = image_augmenter.get_hyperparameter_search_space().get_default_configuration() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the default have every augmentation? I guess then this is fine, but perhaps add a comment here that this is implicitly assumed for this test |
||
image_augmenter = image_augmenter.set_hyperparameters(configuration=configuration) | ||
X = dict(X_train=np.random.randint(0, 255, (8, 3, 16, 16), dtype=np.uint8), image_height=16, image_width=16) | ||
for name, augmenter in image_augmenter.available_augmenters.items(): | ||
if not augmenter.use_augmenter: | ||
continue | ||
augmenter = augmenter.fit(X) | ||
# check if augmenter in the component has correct name | ||
self.assertEqual(augmenter.get_image_augmenter().name, name) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would simplify this as follows:
Remove
scale_min
,translate_percent_min
and hardcode them to 0.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I had made a mistake in interpreting what scale means. So, if we have scale as 1, that would mean scaled to 100% of original size(i.e, no change) else with 0.5 then 50% of the image. So I think scale offset should be 0 to 0.4(therefore scale_min) and it should go from scale_min to 1 and that should mean we scale it to anything between 60%(1-0.4) and 100%(1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect that if you specify the scaling percentage as e.g. (0, 0.4) that the augmentation scales the images from 60 % - 140 %, which it should. Could you double check that this is done now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Lucas, I checked and it is that whatever number we enter, its the percentage of zooming out(if greater than 1) or zooming in(if less than 1). So if we want something like 60-140%, we could have 1 - offset and 1+offset, or we could fix the offset and learn what to use as the centre point. Let me know what you think is more appropriate.