Fixed several issues with Fast-RCNN scenario on windows and also make sure that notebook runs on linux
This commit is contained in:
Родитель
bd1305cfa2
Коммит
1faeb71033
|
@ -30,8 +30,8 @@ def download_grocery_data():
|
|||
with zipfile.ZipFile(filename) as myzip:
|
||||
myzip.extractall(dataset_folder)
|
||||
if platform != "win32":
|
||||
testfile = os.path.join(dataset_folder, "grocery", "test.txt")
|
||||
unixfile = os.path.join(dataset_folder, "grocery", "test_unix.txt")
|
||||
testfile = os.path.join(dataset_folder, "Grocery", "test.txt")
|
||||
unixfile = os.path.join(dataset_folder, "Grocery", "test_unix.txt")
|
||||
out = open(unixfile, 'w')
|
||||
with open(testfile) as f:
|
||||
for line in f:
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -755,12 +755,20 @@ def ptClip(pt, maxWidth, maxHeight):
|
|||
pt[1] = min(pt[1], maxHeight)
|
||||
return pt
|
||||
|
||||
def drawText(img, pt, text, textWidth=None, color = (255,255,255), colorBackground = None, font = ImageFont.truetype("arial.ttf", 16)):
|
||||
def drawText(img, pt, text, textWidth=None, color = (255,255,255), colorBackground = None, font = None):
|
||||
# loading default value in function call so the script won't cause errors in system where
|
||||
# "arial.ttf" cannot be found
|
||||
if font == None:
|
||||
font = ImageFont.truetype("arial.ttf", 16)
|
||||
pilImg = imconvertCv2Pil(img)
|
||||
pilImg = pilDrawText(pilImg, pt, text, textWidth, color, colorBackground, font)
|
||||
return imconvertPil2Cv(pilImg)
|
||||
|
||||
def pilDrawText(pilImg, pt, text, textWidth=None, color = (255,255,255), colorBackground = None, font = ImageFont.truetype("arial.ttf", 16)):
|
||||
def pilDrawText(pilImg, pt, text, textWidth=None, color = (255,255,255), colorBackground = None, font = None):
|
||||
# loading default value in function call so the script won't cause errors in system where
|
||||
# "arial.ttf" cannot be found
|
||||
if font == None:
|
||||
font = ImageFont.truetype("arial.ttf", 16)
|
||||
textY = pt[1]
|
||||
draw = ImageDraw.Draw(pilImg)
|
||||
if textWidth == None:
|
||||
|
|
|
@ -17,6 +17,7 @@ dependencies:
|
|||
- setuptools=27.2.0=py34_0
|
||||
- six=1.10.0=py34_0
|
||||
- wheel=0.29.0=py34_0
|
||||
- opencv=3.1.0
|
||||
- pip:
|
||||
- pytest==3.0.3
|
||||
- sphinx==1.4.8
|
||||
|
|
|
@ -17,6 +17,7 @@ dependencies:
|
|||
- setuptools=27.2.0=py35_0
|
||||
- six=1.10.0=py35_0
|
||||
- wheel=0.29.0=py35_0
|
||||
- opencv=3.1.0
|
||||
- pip:
|
||||
- pytest==3.0.3
|
||||
- sphinx==1.4.8
|
||||
|
|
|
@ -18,6 +18,10 @@ notebook_timeoutSeconds = 1200
|
|||
# Skipping test for python 2.7 since Fast-RCNN implementation does not support 2.7 at the moment
|
||||
@pytest.mark.skipif(sys.version_info < (3,4),
|
||||
reason="requires python 3.4")
|
||||
@pytest.mark.skipif(sys.version_info > (3,4),
|
||||
reason="requires python 3.4")
|
||||
@pytest.mark.skipif(sys.platform == 'win32',
|
||||
reason="does not currently run on windows")
|
||||
def test_cntk_fastrcnn_eval_noErrors(nb):
|
||||
errors = [output for cell in nb.cells if 'outputs' in cell
|
||||
for output in cell['outputs'] if output.output_type == "error"]
|
||||
|
@ -27,6 +31,10 @@ def test_cntk_fastrcnn_eval_noErrors(nb):
|
|||
# Skipping test for python 2.7 since Fast-RCNN implementation does not support 2.7 at the moment
|
||||
@pytest.mark.skipif(sys.version_info < (3,4),
|
||||
reason="requires python 3.4")
|
||||
@pytest.mark.skipif(sys.version_info > (3,4),
|
||||
reason="requires python 3.4")
|
||||
@pytest.mark.skipif(sys.platform == 'win32',
|
||||
reason="does not currently run on windows")
|
||||
def test_cntk_fastrcnn_eval_evalCorrect(nb):
|
||||
testCells = [cell for cell in nb.cells
|
||||
if cell.cell_type == 'code' and
|
||||
|
|
Загрузка…
Ссылка в новой задаче