Skip to content
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

sample with array fails #224

Open
nyk2001 opened this issue Jun 4, 2020 · 1 comment
Open

sample with array fails #224

nyk2001 opened this issue Jun 4, 2020 · 1 comment

Comments

@nyk2001
Copy link

nyk2001 commented Jun 4, 2020

Hi,

I am using Augmentor package 0.2.8 (with Anaconda)

I am using an image to generate sample data but I am getting an error message. My code is


img_array = np.asarray(PIL.Image.open(r"A.png"))
p = Augmentor.Pipeline()
p.flip_top_bottom(0.5)
img_augmented = p.sample_with_array(img_array)

I get the following error message


 return images[0]
IndexError: list index out of range

Can anyone please help me with that ?

@zabboud
Copy link

zabboud commented Apr 17, 2022

I'm not sure if this is relevant anymore -- but here's the answer in case anyone else might need it.

You want to use Augmentor.DataPipeline() instead of Augmentor.Pipeline() when feeding in arrays.

It takes in two arguments, the first one is a list of lists of arrays, the second one is a list of labels. Check out the example in the link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants