def savePascalVocFormat(self, filename, shapes, imagePath, imageData, lineColor=None, fillColor=None, databaseSrc=None):
    imgFolderPath = os.path.dirname(imagePath)
    imgFolderName = os.path.split(imgFolderPath)[(- 1)]
    imgFileName = os.path.basename(imagePath)
    image = QImage()
    image.load(imagePath)
    imageShape = [image.height(), image.width(), (1 if image.isGrayscale() else 3)]
    writer = PascalVocWriter(imgFolderName, imgFileName, imageShape, localImgPath=imagePath)
    writer.verified = self.verified
    for shape in shapes:
        points = shape['points']
        label = shape['label']
        difficult = int(shape['difficult'])
        bndbox = LabelFile.convertPoints2BndBox(points)
        writer.addBndBox(bndbox[0], bndbox[1], bndbox[2], bndbox[3], label, difficult)
    writer.save(targetFile=filename)
    return
def savePascalVocFormat(self, filename, shapes, imagePath, imageData, lineColor=None, fillColor=None, databaseSrc=None):
    imgFolderPath = os.path.dirname(imagePath)
    imgFolderName = os.path.split(imgFolderPath)[(- 1)]
    imgFileName = os.path.basename(imagePath)
    image = QImage()
    image.load(imagePath)
    imageShape = [image.height(), image.width(), (1 if image.isGrayscale() else 3)]
    writer = PascalVocWriter(imgFolderName, imgFileName, imageShape, localImgPath=imagePath)
    writer.verified = self.verified
    for shape in shapes:
        points = shape['points']
        label = shape['label']
        difficult = int(shape['difficult'])
        bndbox = LabelFile.convertPoints2BndBox(points)
        writer.addBndBox(bndbox[0], bndbox[1], bndbox[2], bndbox[3], label, difficult)
    writer.save(targetFile=filename)
    return