pascal-voc-writer icon indicating copy to clipboard operation
pascal-voc-writer copied to clipboard

A python library for generating annotations in the PASCAL VOC format.

Results 6 pascal-voc-writer issues
Sort by recently updated
recently updated
newest added

``` import os import numpy as np from pascal_voc_writer import Writer bboxList = [(77, 238, 230, 458),(99, 298, 0, 48),(1, 2, 3, 4)] objectLabelList = ['left','right','front'] imageDirPathBuffer = '__Path__/name.jpg' anno_filename...

If name contains etc chars then generated XML is malformed. The solution might be to use `from xml.sax.saxutils import escape`

The problem usually occur when **name** have **&**, **** character in it. I solve the problem by adding few line of code.

[Python 3.7.0] The code snippet is: ``` for i in range(0,len(yhat['rois'])): ymin, xmin, ymax, xmax = yhat['rois'][i] writer.addObject(classids[yhat['class_ids'][i]],xmin,ymin,xmax,ymax) writer.save(‘path/to/img.xml’) ``` produces malformed PASCAL VOC xml files. Successive objects sections are...

- Added new function addObject3d - Added to "annotation.xml" support for z-coordinates

Change your __init.py__ from this: `def save(self, annotation_path): with open(annotation_path, 'w') as file: content = self.annotation_template.render(**self.template_parameters) file.write(content)` to this: `def save(self, annotation_path, encoding="UTF-8"): with open(annotation_path, 'w', encoding=encoding) as file: content...