I have a very big datasets of images and their annotations saved in two separate folders, however not all images have an annotation file. How can I write a python code to check my image files (.JPG) in folder "A" and delete the image if there is not an annotation file (.xml) with the same name for that specific image, and do nothing if annotation file exists?
I have written the following code following @Gabip comment below:
How can I improve this code?
try this: