From aa89fd93f0f3da5cf6b4d0a67b9adf54b7ff6e91 Mon Sep 17 00:00:00 2001 From: esimov Date: Thu, 17 Oct 2019 10:33:00 +0300 Subject: [PATCH] Small correction on epuploc examples --- examples/puploc/puploc.py | 6 +++--- examples/puploc_masquerade/puploc.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/puploc/puploc.py b/examples/puploc/puploc.py index e6cbf00..7a2b038 100644 --- a/examples/puploc/puploc.py +++ b/examples/puploc/puploc.py @@ -11,7 +11,7 @@ pigo = cdll.LoadLibrary('./puploc.so') os.system('rm puploc.so') MAX_NDETS = 2024 -ARRAY_DIM = 6 +ARRAY_DIM = 5 # define class GoPixelSlice to map to: # C type struct { void *data; GoInt len; GoInt cap; } @@ -36,7 +36,7 @@ def process_frame(pixs): if data_pointer : buffarr = ((c_longlong * ARRAY_DIM) * MAX_NDETS).from_address(addressof(data_pointer.contents)) - res = np.ndarray(buffer=buffarr, dtype=c_longlong, shape=(MAX_NDETS, 5,)) + res = np.ndarray(buffer=buffarr, dtype=c_longlong, shape=(MAX_NDETS, ARRAY_DIM,)) # The first value of the buffer aray represents the buffer length. dets_len = res[0][0] @@ -44,7 +44,7 @@ def process_frame(pixs): # We have to consider the pupil pair added into the list. # That's why we are multiplying the detection length with 3. - dets = list(res.reshape(-1, 5))[0:dets_len*3] + dets = list(res.reshape(-1, ARRAY_DIM))[0:dets_len*3] return dets # initialize the camera diff --git a/examples/puploc_masquerade/puploc.py b/examples/puploc_masquerade/puploc.py index a284bb2..d0ced55 100644 --- a/examples/puploc_masquerade/puploc.py +++ b/examples/puploc_masquerade/puploc.py @@ -11,7 +11,7 @@ pigo = cdll.LoadLibrary('./puploc.so') os.system('rm puploc.so') MAX_NDETS = 2024 -ARRAY_DIM = 6 +ARRAY_DIM = 5 px, py = None, None show_face = False @@ -50,7 +50,7 @@ def process_frame(pixs): if data_pointer : buffarr = ((c_longlong * ARRAY_DIM) * MAX_NDETS).from_address(addressof(data_pointer.contents)) - res = np.ndarray(buffer=buffarr, dtype=c_longlong, shape=(MAX_NDETS, 5,)) + res = np.ndarray(buffer=buffarr, dtype=c_longlong, shape=(MAX_NDETS, ARRAY_DIM,)) # The first value of the buffer aray represents the buffer length. dets_len = res[0][0] @@ -58,7 +58,7 @@ def process_frame(pixs): # We have to consider the pupil pair added into the list. # That's why we are multiplying the detection length with 3. - dets = list(res.reshape(-1, 5))[0:dets_len*3] + dets = list(res.reshape(-1, ARRAY_DIM))[0:dets_len*3] return dets # initialize the camera