joheras / CLoDSA

122 stars 33 forks source link

Pascal VOC - 3 little issues with fix #78

Open Natriumpikant opened 1 year ago

Natriumpikant commented 1 year ago

Hello again. Since i work with PascalVOC this week i found some more issues you can fix if you have time for it.

I work with these one: pascalVOCLinearDetectionAugmentor.py

  1. Same like this one https://github.com/joheras/CLoDSA/issues/74 The algorithm has a problem with values as float so i changed it to the following:

x = int(float(bndbox.find('xmin').text)) y = int(float(bndbox.find('ymin').text)) h = int(float(bndbox.find('ymax').text))-y w = int(float(bndbox.find('xmax').text)) - x boxes.append((category, (x, y, w, h),confidenc

  1. Filename in the result xml.-file Filename in the original-xml: "12345.jpg" Filename in the created-xml: "12345" So the "jpg" is not there anymore.

    Hardcoded it for me as jpg, but think you have to add it depending on the filename:

childFilename.text = filename[0:filename.rfind(".")] + ".jpg"

  1. Some encoding issue However - i have no solution for this atm. In the original-xml i have some "ß" inside classnames and it works well in further proceeding. After augmenting it and using the created-xml i get problems with this "ß" regarding the encoding. Dont know why it is - but if you want you can also have a look.

This is the error i get, if working with "ß" in classnames (only in augmented xml)

Traceback (most recent call last):  File "create_csv_clodsa2.py", line 37, in <module>    main()  File "create_csv_clodsa2.py", line 33, in main    xml_df = xml_to_csv(image_path)  File "create_csv_clodsa2.py", line 13, in xml_to_csv    tree = ET.parse(xml_file)  File "/usr/lib/python3.7/xml/etree/ElementTree.py", line 1197, in parse    tree.parse(source, parser)  File "/usr/lib/python3.7/xml/etree/ElementTree.py", line 598, in parse    self._root = parser._parse_whole(source) xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 16, column 24

Edit Never mind, i think you can ignore point 3. Changed ß to ss in the whole dataset - will be better for further proceeding also with other libraries/frameworks.

Thanks so far :)