Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Error in VOC Parsing #16

Open
ilyasmg opened this issue Apr 1, 2019 · 3 comments
Open

Error in VOC Parsing #16

ilyasmg opened this issue Apr 1, 2019 · 3 comments

Comments

@ilyasmg
Copy link

ilyasmg commented Apr 1, 2019

I'm converting this dataset (https://www.di.ens.fr/willow/research/headdetection/) from xml to txt to use it in YOLO but I'm getting this error.
VOC Parsing Result : False, msg : ERROR : 'NoneType' object has no attribute 'text', moreInfo : <class 'AttributeError'> Format.py 258

this is line 258 in Format.py
tmp = {
"name": _object.find("name").text
}

Do you know how to solve it?

@7thstorm
Copy link

I think one or more of your XML files is missing the tag...

@fakturk
Copy link

fakturk commented Jun 22, 2019

you have to check your xml file and tags in that xml file.
For example I got my xml files from labelbox.com (as a voc format) and every object has instead of bndbox and x1,y1,x2,y2 instead of xmin,ymin,xmax,ymax.
So I chaged code from line 261 on Format.py as

                xml_bndbox = _object.find("polygon")
                bndbox = {
                    "xmin": float(xml_bndbox.find("x1").text), 
                    "ymin": float(xml_bndbox.find("y1").text), 
                    "xmax": float(xml_bndbox.find("x2").text),
                    "ymax": float(xml_bndbox.find("y2").text)
                }

@Alzheimancer
Copy link

I also got my xml file from labelbox as voc format but I have both bndbox and polygon. Moreover, some xml files have x1 x2 x3 x4 y1 y2 y3 y4. I dont know how todeal with it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants