From 9c75ff43ba402c933bc3e7b8d82a3d49d68bf3b1 Mon Sep 17 00:00:00 2001 From: Philipp Wagner Date: Sat, 11 Aug 2012 22:36:35 +0200 Subject: [PATCH] Bug #2257: Adding a quick workaround for truncated labels on 64bit machines in the Python FaceRecognizer wrapper code. This is only a temporary bugfix, that will be fixed at a better point as soon as possible. --- samples/python2/facerec_demo.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/samples/python2/facerec_demo.py b/samples/python2/facerec_demo.py index 7367b68a9f..512dd30d7b 100644 --- a/samples/python2/facerec_demo.py +++ b/samples/python2/facerec_demo.py @@ -98,6 +98,12 @@ if __name__ == "__main__": sys.exit() # Now read in the image data. This must be a valid path! [X,y] = read_images(sys.argv[1]) + # Convert labels to 32bit integers. This is a workaround for 64bit machines, + # because the labels will truncated else. This will be fixed in code as + # soon as possible, so Python users don't need to know about this. + # Thanks to Leo Dirac for reporting: + y = np.asarray(y, dtype=np.int32) + # If a out_dir is given, set it: if len(sys.argv) == 3: out_dir = sys.argv[2] # Create the Eigenfaces model. We are going to use the default