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

Provide Sample Weights to ImageDataGenerator.flow_from_dataframe #147

Open
docmarionum1 opened this Issue Jan 24, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@docmarionum1
Copy link

docmarionum1 commented Jan 24, 2019

I'd like to specify sample weights when using ImageDataGenerator.flow_from_dataframe. I see that flow supports it, so I could load my images into a numpy array first and use flow. But it seems like it makes sense to allow flow_from_dataframe to support it as well.

To implement, flow_from_dataframe would optionally take a weight_col parameter, and then if weight_col is not None, _get_batches_of_transformed_samples would return a third item, the sample weights.

I'd be happy to send a pull request if this is something that y'all agree makes sense.

@docmarionum1 docmarionum1 added the image label Jan 24, 2019

@rragundez

This comment has been minimized.

Copy link
Collaborator

rragundez commented Jan 24, 2019

I was thinking on adding that, so thanks for helping out. Please name the column accordingly to the parameter in flow, I think sample_weights_col. Let me know if you need some help or so :)
Thanks again

@rragundez

This comment has been minimized.

Copy link
Collaborator

rragundez commented Feb 7, 2019

@docmarionum1 I created PR #166 that implements this. Please have a look.

@docmarionum1

This comment has been minimized.

Copy link
Author

docmarionum1 commented Feb 8, 2019

@rragundez Thanks! Testing it out and it works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment