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

The number of images is different to the number of annotations #61

Open
sudenursenkal opened this issue May 7, 2022 · 1 comment
Open

Comments

@sudenursenkal
Copy link

sudenursenkal commented May 7, 2022

Hello,
I want to augment my dataset using the code "Augmenting a dataset for object detection in YOLO". However, I am getting the following error during "Applying the augmentation process". I have multiple label boxes on an image in my dataset. So there is more than one data in xml file too. Can't I use Clodsa on this dataset?

Exception Traceback (most recent call last)
in ()
----> 1 augmentor.applyAugmentation()

1 frames
/usr/local/lib/python3.7/dist-packages/clodsa/augmentors/yoloLinearDetectionAugmentor.py in applyAugmentation(self)
86
87 def applyAugmentation(self):
---> 88 self.readImagesAndAnnotations()
89 if not(os._exists(self.outputPath)):
90 os.makedirs(self.outputPath)

/usr/local/lib/python3.7/dist-packages/clodsa/augmentors/yoloLinearDetectionAugmentor.py in readImagesAndAnnotations(self)
83 self.labelPaths = list(paths.list_files(self.inputPath,validExts=(".txt")))
84 if (len(self.imagePaths) != len(self.labelPaths)):
---> 85 raise Exception("The number of images is different to the number of annotations")
86
87 def applyAugmentation(self):

Exception: The number of images is different to the number of annotations

EDIT: I found the solution. The problem was that the existing jpg-png files in the folder were together and the file named classes.txt was skipped. The problem was solved by running the jpg and their txt files separately. :)

@joheras
Copy link
Owner

joheras commented May 9, 2022 via email

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