Augmentor
Augmentor copied to clipboard
Issue:"There are no images in the pipeline"
Following is the code I am using to create my pipeline for image augmentation. There is only 1 image in the directory I specify in 'new_source_directory'. I am using this in google colab. The 'new_output_directory' argument creates the directory in my google drive so I know that it's not a permissions issue in google colab. I am using Python 3 notebook in google colab. Any help you provide is appreciated. The complete error is found below my code.
point2files = Augmentor.Pipeline()
point2files.ground_truth('One_size/{}'.format(One_size_lbls[1]))
point2files.add_further_directory(new_source_directory='One_size/{}'.format(One_size_lbls[1]),new_output_directory='../../Augmented/{}'.format(One_size_lbls[1]))
point2files.rotate(probability=0.9,max_left_rotation=25,max_right_rotation=25)
point2files.zoom_random(probability=0.9,percentage_area=0.9)
point2files.flip_left_right(probability=0.9)
point2files.flip_top_bottom(probability=0.9)
point2files.shear(probability=0.9,max_shear_left=25, max_shear_right=25)
point2files.skew_tilt(probability=0.9)
point2files.sample(10)
` 0 ground truth image(s) found. Initialised with 0 image(s) found. Output directory set to One_size/['w_0003c59']/../../Augmented/['w_0003c59'].
IndexError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/Augmentor/Pipeline.py in sample(self, n, multi_threaded) 341 """ 342 if len(self.augmentor_images) == 0: --> 343 raise IndexError("There are no images in the pipeline. " 344 "Add a directory using add_directory(), " 345 "pointing it to a directory containing images.")
IndexError: There are no images in the pipeline. Add a directory using add_directory(), pointing it to a directory containing images.`
You might have run into the same bug as #91, where you have an empty folder (or folder with no images) in your source directory. Haven't looked into what's causing the bug, but for now I just sidestepped it by moving my source images into a new directory with no other folders and running there.