simonMadec / Wheat-Ears-Detection-Dataset

Dataset from the Ear density estimation from high resolution RGB imagery using deep learning technique paper
22 stars 3 forks source link

some xml file are wrong? #2

Open junliang230 opened 4 years ago

junliang230 commented 4 years ago

when I use box coordinate labeled in the xml file to plot in the figure, such as 1011.xml, the visualization results look wrong, could you check it and update, thans your reply

code I use `

tree = ET.parse(xml_path) root = tree.getroot() size = root.find('size') width = int(size.find('width').text) height = int(size.find('height').text) for obj in root.findall('object'): name = obj.find('name').text label = '1' difficult = None bnd_box = obj.find('bndbox') bbox = [ int(bnd_box.find('xmin').text), int(bnd_box.find('ymin').text), int(bnd_box.find('xmax').text), int(bnd_box.find('ymax').text) ]

`

`

for bbox in bboxes: bbox_int = bbox.astype(np.float).astype(np.int32) left_top = (bbox_int[0], bbox_int[1]) right_bottom = (bbox_int[2], bbox_int[3]) cv2.rectangle(img, left_top, right_bottom, (0, 0, 255), thickness=2) # blue cv2.imwrite('./', img)

`

1011

QingyuanWang commented 4 years ago

I have the same problem, does anyone get a fix?