Cartucho / OpenLabeling

Label images and video for Computer Vision applications
Apache License 2.0
926 stars 266 forks source link

Output dir issue #69

Closed BFascione closed 4 years ago

BFascione commented 4 years ago

Hi , I'm trying to set the output directory. and I keep getting this error , I'm hoping you can help or advise

the command I'm running is python main.py -i d:\datasets\images_in\ -o d:\datasets\images_out\ --tracker DASIAMRPN -n 125 both Directory's exist

I think my issue is the path is missing a backslash \

this is what I get on the error 'd:\datasets\images_out\PASCAL_VOCpeople_walking_mp4\people_walking_mp4_0.xml'

this is what I Think it should be 'd:\datasets\images_out\PASCAL_VOC\people_walking_mp4\people_walking_mp4_0.xml'

for it to find the directory

see full error below

File "main.py", line 1036, in create_PASCAL_VOC_xml(ann_path, abs_path, folder_name, image_name, img_height, img_width, depth) File "main.py", line 757, in create_PASCAL_VOC_xml write_xml(xml_str, xml_path) File "main.py", line 282, in write_xml with open(xml_path, 'wb') as temp_xml: FileNotFoundError: [Errno 2] No such file or directory: 'd:\datasets\images_out\PASCAL_VOCpeople_walking_mp4\people_walking_mp4_0.xml'

can you please help Brian

BFascione commented 4 years ago

I get the same issues if I leave the output dir. as default and only change the input directory

python main.py -i d:\datasets\images_in\ --tracker DASIAMRPN -n 125

FileNotFoundError: [Errno 2] No such file or directory: 'output\PASCAL_VOCpeople_walking_mp4\people_walking_mp4_0.xml' (Tensorflow-05) C:\Users\brian\PycharmProjects\Github\OpenLabeling\main>

Cartucho commented 4 years ago

Yeah, the problem is being caused by the lack of backslash. I have to debug this on windows. There is a os.path.join missing somewhere

Cartucho commented 4 years ago

Could you check what is going to the variable xml_path in the function create_PASCAL_VOC_xml()?

I mean adding a print(xml_path) to line 738

BFascione commented 4 years ago

I've printed out xml_path from the create_PASCAL_VOC_xml()

this is what I got back .. hope it helps

d:\datasets\images_out\PASCAL_VOCpeople_walking_mp4\people_walking_mp4_0.xml

BFascione commented 4 years ago

I've manged to find a fix/work-around that seems to work

I've added +'\' to the new_path = os.path.join(OUTPUT_DIR , ann_dir)

see below

def get_annotation_paths(img_path, annotation_formats): annotation_paths = [] for ann_dir, ann_ext in annotation_formats.items(): new_path = os.path.join(OUTPUT_DIR , ann_dir + '\')

Brian

Cartucho commented 4 years ago

I think I just fixed it. Could you give it a try with the new version?

BFascione commented 4 years ago

yes works thanks