Skip to content
Snippets Groups Projects
Commit db2ae8a9 authored by Laurent EL SHAFEY's avatar Laurent EL SHAFEY
Browse files

Merge pull request #3 from ties/fix/second_call_flow

apply earlier fixes to second control flow
parents 86fa0faf 9817f179
No related branches found
No related tags found
No related merge requests found
...@@ -120,7 +120,7 @@ class Localizer(_flandmark.Localizer): ...@@ -120,7 +120,7 @@ class Localizer(_flandmark.Localizer):
return super(Localizer, self).__call__(gray, b_y, b_x, b_height, b_width) return super(Localizer, self).__call__(gray, b_y, b_x, b_height, b_width)
elif image.ndim == 2: elif image.ndim == 2:
return super(Localizer, self).__call__(gray, b_y, b_x, b_height, b_width) return super(Localizer, self).__call__(image, b_y, b_x, b_height, b_width)
else: else:
raise TypeError, "Localizer accepts images as numpy.ndarray objects with either 2 or 3 dimensions" raise TypeError, "Localizer accepts images as numpy.ndarray objects with either 2 or 3 dimensions"
...@@ -139,16 +139,19 @@ class Localizer { ...@@ -139,16 +139,19 @@ class Localizer {
ipl_image->imageData = (char*)input.bz<uint8_t,2>().data(); ipl_image->imageData = (char*)input.bz<uint8_t,2>().data();
int bbox[4] = {b_x, b_y, b_x + b_width, b_y + b_height}; int bbox[4] = {b_x, b_y, b_x + b_width, b_y + b_height};
int flandmark_result;
{ {
bob::python::no_gil unlock; bob::python::no_gil unlock;
flandmark_detect(ipl_image.get(), bbox, m_flandmark.get(), flandmark_result = flandmark_detect(ipl_image.get(), bbox, m_flandmark.get(),
m_landmarks.get()); m_landmarks.get());
} }
list lmlist; ///< landmark list list lmlist; ///< landmark list
for (int i = 0; i < (2*m_flandmark->data.options.M); i += 2) { if (flandmark_result == NO_ERR) {
lmlist.append(make_tuple(m_landmarks[i], m_landmarks[i+1])); for (int i = 0; i < (2*m_flandmark->data.options.M); i += 2) {
lmlist.append(make_tuple(m_landmarks[i], m_landmarks[i+1]));
}
} }
return object(lmlist); return object(lmlist);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment