From bb23ed01ad34d25675ac583c24e6520dfd5ccb5c Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Thu, 7 Mar 2019 19:29:44 +0200 Subject: [PATCH] Fix cascade converter script Windows bug. * Using open "w" instead of "wb" causes the script to fail on Windows. --- ml/haarcascade/cascade_convert.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ml/haarcascade/cascade_convert.py b/ml/haarcascade/cascade_convert.py index cf718543f..00705090e 100755 --- a/ml/haarcascade/cascade_convert.py +++ b/ml/haarcascade/cascade_convert.py @@ -143,7 +143,7 @@ def cascade_binary(path, n_stages, name): # open output file with the specified name or xml file name if not name: name = os.path.basename(path).split('.')[0] - fout = open(name+".cascade", "w") + fout = open(name+".cascade", "wb") n_rectangles = 0 for f in feature: @@ -242,7 +242,7 @@ def cascade_binary_old(path, n_stages, name): # open output file with the specified name or xml file name if not name: name = os.path.basename(path).split('.')[0] - fout = open(name+".cascade", "w") + fout = open(name+".cascade", "wb") n_rectangles = 0 for f in feature: