rm opencv module

This commit is contained in:
tzutalin 2016-09-06 17:24:47 +08:00
parent ab5e4db242
commit 4a3a47a7c7

View File

@ -1,10 +1,13 @@
import json # Copyright (c) 2016 Tzutalin
import os.path # Create by TzuTaLin <tzu.ta.lin@gmail.com>
import numpy
import cv2 from PyQt4.QtGui import QImage
import sys
from pascal_voc_io import PascalVocWriter
from base64 import b64encode, b64decode from base64 import b64encode, b64decode
from pascal_voc_io import PascalVocWriter
import json
import numpy
import os.path
import sys
class LabelFileError(Exception): class LabelFileError(Exception):
pass pass
@ -58,9 +61,11 @@ class LabelFile(object):
imgFolderName = os.path.split(imgFolderPath)[-1] imgFolderName = os.path.split(imgFolderPath)[-1]
imgFileName = os.path.basename(imagePath) imgFileName = os.path.basename(imagePath)
imgFileNameWithoutExt = os.path.splitext(imgFileName)[0] imgFileNameWithoutExt = os.path.splitext(imgFileName)[0]
# Read from file path because self.imageData might be empty if saving to
img = cv2.imread(imagePath) # Pascal format
imageShape = img.shape image = QImage()
image.load(imagePath)
imageShape = [image.height(), image.width(), 1 if image.isGrayscale() else 3]
writer = PascalVocWriter(imgFolderName, imgFileNameWithoutExt,\ writer = PascalVocWriter(imgFolderName, imgFileNameWithoutExt,\
imageShape, localImgPath=imagePath) imageShape, localImgPath=imagePath)
bSave = False bSave = False