mdbloice / Augmentor

Image augmentation library in Python for machine learning.
https://augmentor.readthedocs.io/en/stable
MIT License
5.08k stars 866 forks source link

int() argument must be a string, a bytes-like object or a number, not 'Image' #235

Closed ccl-private closed 3 years ago

ccl-private commented 3 years ago

follow "https://augmentor.readthedocs.io/en/master/userguide/extend.html#using-non-pil-image-objects" and face error above.

mdbloice commented 3 years ago

Hi there,

Hmm I think you'll have to give me some more information what you are trying to do. That code snippet shows you that you can work with objects other than PIL images, however they must be converted back to PIL images before being returned by the perform_operation() function. Is that perhaps more clear?

ccl-private commented 3 years ago

I have overcome this problem just now. This is because the parameter of function perform_operation "image" is a list(). image add a for loop, it worked.

ccl-private commented 3 years ago

the example in "https://augmentor.readthedocs.io/en/master/userguide/extend.html#using-non-pil-image-objects" is out of date.

mdbloice commented 3 years ago

I have overcome this problem just now. This is because the parameter of function perform_operation "image" is a list(). image add a for loop, it worked.

Yes indeed, this is not clear from that part of the documentation and is out of date. The perform_operation() function expects a list of images to be returned, even if only one image is returned.

Thanks for taking the time to clear this up.