-
Notifications
You must be signed in to change notification settings - Fork 866
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
Added support of ground truth images for Keras generator #126
base: master
Are you sure you want to change the base?
Conversation
|
||
if scaled: | ||
X = X.astype('float32') | ||
X /= 255 | ||
X /= 255. |
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.
This is something I overlooked, dividing by 255
needs to be fixed...
X /= 255. | ||
if self.process_ground_truth_images: | ||
y = y.astype('float32') | ||
y /= 255. |
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.
And here of course
Hi @npielawski thanks a lot for making the PR, and sorry for the delay in replying, I have been away from my office for the past couple of weeks. Anyway, yes I think we can fix this quite easily to work with |
Hi @mdbloice, no problem for the delay, I didn't expect anything over the summer. Please feel free to take any piece of my code to integrate in yours, if you need to. Also, I double pushed two different functionalities: the ability to work with ground truth images in Keras, but also the preallocation of the batch. |
Yeah actually something I also wanted to implement was preallocation - so I will use what you've written there for that. |
You're welcome :) |
Tried to add the support of ground truth images for the Keras generator. Here is an example:
`p = Augmentor.Pipeline('dataset/train/images')
p.ground_truth('dataset/train/masks')
Augmenting operations
p.flip_left_right(probability=0.5)
p.flip_top_bottom(probability=0.5)
batch_gen = p.keras_generator
image, label = next(p.keras_generator(batch_size=1))`
where image contains the input image, and label the ground truth.
Unfortunately, this new functionality changed the API, with _execute() returning an array of images, instead of a single image.