Changes in facedetect test
This commit is contained in:
@@ -19,6 +19,7 @@ class NewOpenCVTests(unittest.TestCase):
|
||||
|
||||
# path to local repository folder containing 'samples' folder
|
||||
repoPath = None
|
||||
extraTestDataPath = None
|
||||
# github repository url
|
||||
repoUrl = 'https://raw.github.com/Itseez/opencv/master'
|
||||
|
||||
@@ -30,6 +31,11 @@ class NewOpenCVTests(unittest.TestCase):
|
||||
if os.path.isfile(candidate):
|
||||
with open(candidate, 'rb') as f:
|
||||
filedata = f.read()
|
||||
if NewOpenCVTests.extraTestDataPath is not None:
|
||||
candidate = NewOpenCVTests.extraTestDataPath + '/' + filename
|
||||
if os.path.isfile(candidate):
|
||||
with open(candidate, 'rb') as f:
|
||||
filedata = f.read()
|
||||
if filedata is None:
|
||||
filedata = urlopen(NewOpenCVTests.repoUrl + '/' + filename).read()
|
||||
self.image_cache[filename] = cv2.imdecode(np.fromstring(filedata, dtype=np.uint8), iscolor)
|
||||
|
Reference in New Issue
Block a user