Read via QImageReader (#650)
* Now read via QImageReader * Remove comment-out unused lines
This commit is contained in:
+10
-4
@@ -43,8 +43,11 @@ class LabelFile(object):
|
||||
#imgFileNameWithoutExt = os.path.splitext(imgFileName)[0]
|
||||
# Read from file path because self.imageData might be empty if saving to
|
||||
# Pascal format
|
||||
image = QImage()
|
||||
image.load(imagePath)
|
||||
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,
|
||||
@@ -70,8 +73,11 @@ class LabelFile(object):
|
||||
#imgFileNameWithoutExt = os.path.splitext(imgFileName)[0]
|
||||
# Read from file path because self.imageData might be empty if saving to
|
||||
# Pascal format
|
||||
image = QImage()
|
||||
image.load(imagePath)
|
||||
if isinstance(imageData, QImage):
|
||||
image = imageData
|
||||
else:
|
||||
image = QImage()
|
||||
image.load(imagePath)
|
||||
imageShape = [image.height(), image.width(),
|
||||
1 if image.isGrayscale() else 3]
|
||||
writer = YOLOWriter(imgFolderName, imgFileName,
|
||||
|
||||
Reference in New Issue
Block a user