// Read from file path because self.imageData might be empty if saving to
// Pascal format
image = QImage()
image.load(imagePath)
imageShape = [image.height(), image.width(),
1 if image.isGrayscale() else 3]
writer = PascalVocWriter(imgFolderName, imgFileName,
imageShape, localImgPath=imagePath)
After Change
//imgFileNameWithoutExt = os.path.splitext(imgFileName)[0]
// Read from file path because self.imageData might be empty if saving to
// Pascal format
if isinstance(imageData, QImage):
image = imageData
else:
image = QImage()
image.load(imagePath)
imageShape = [image.height(), image.width(),
1 if image.isGrayscale() else 3]
writer = PascalVocWriter(imgFolderName, imgFileName,
imageShape, localImgPath=imagePath)