-
Notifications
You must be signed in to change notification settings - Fork 28
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
Filename exception although file names and paths are the same or correct - windows issue #2
Comments
Are the filenames of images and their corresponding annotations similar? I mean, do you have the corresponding "Scenario_10_3_1_standing_by_vehicle_150ft-0058.xml" in the "annotations" directory. |
First, let me say thank you for putting this tool together. As to my issue, I believe it is Windows specific. The issue arises from how this code deals with windows paths. Here is the code:
That is from helpers.py in the validate_file_names function. What happens is that on windows it adds \ instead of / and this causes the exception. Anyways I resolved it by doing:
I have also been changing the code to use Pathlib and some other things. I hope to have some time next week to test on Linux/Ubuntu because I am concerned my hacks might cause issues themselves but for right now the code is doing what I need. Again thanks |
Thank you for pointing this out. I did not test this tool on Windows and I should have mentioned that in the docs. I will add it now. But thanks again for letting me know a potential fix around the problem. I am glad you found the tool helpful. 😊 |
I'm getting this same error even though I'm running on Linux (Ubuntu). I can check to make sure there is an xml for each image file by running this:
Which returns
I get
|
I solved my problem, so please ignore unless you're having a similar problem and want to try what I did. The slicer function is making sure that annotations and images filenames are exactly the same (with the exception of jpg and xml). If you're getting a similar error, you can try running this:
I had a couple of annotation files that python doesn't seem to think match up with image files (they do in terminal, but not in python), so I just deleted these two files, and it is working now. |
I am trying to use the image_bbox_slicer in that it fits exactly my use case. My problem is that it keeps through exceptions like below no matter what filenames or paths I used. I looked at your code a little bit thinking that maybe it is my file names which are like "Scenario_10_3_1_standing_by_vehicle_150ft-0058.jpg". I did not see anything in your code that would have a problem with the file name. Do you have any suggestions on what I am doing wrong?
Exception: Each image in
E:/sd_data_collection/sd_11_15_19/ripped_frames/tile_test/test_src/images
must have its corresponding XML file inE:/sd_data_collection/sd_11_15_19/ripped_frames/tile_test/test_src/annotations
with the same file name.The text was updated successfully, but these errors were encountered: