Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
0db8713a
"git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "8228d166cef443cd23bad141537101c5acf20080"
Commit
0db8713a
authored
Mar 31, 2018
by
visionworkz
Committed by
Davis E. King
Mar 31, 2018
Browse files
Fixed reference count issue (#1222)
parent
d36c6619
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
tools/python/src/numpy_returns.cpp
tools/python/src/numpy_returns.cpp
+3
-4
No files found.
tools/python/src/numpy_returns.cpp
View file @
0db8713a
...
@@ -44,7 +44,7 @@ py::list get_jitter_images(py::object img, size_t num_jitters = 1, bool disturb_
...
@@ -44,7 +44,7 @@ py::list get_jitter_images(py::object img, size_t num_jitters = 1, bool disturb_
npy_uint8
*
outdata
=
(
npy_uint8
*
)
PyArray_DATA
((
PyArrayObject
*
)
arr
);
npy_uint8
*
outdata
=
(
npy_uint8
*
)
PyArray_DATA
((
PyArrayObject
*
)
arr
);
memcpy
(
outdata
,
image_data
(
crop
),
rows
*
width_step
(
crop
));
memcpy
(
outdata
,
image_data
(
crop
),
rows
*
width_step
(
crop
));
py
::
handle
handle
(
arr
)
;
py
::
handle
handle
=
arr
;
// Append image to jittered image list
// Append image to jittered image list
jitter_list
.
append
(
handle
);
jitter_list
.
append
(
handle
);
}
}
...
@@ -87,7 +87,7 @@ py::list get_face_chips (
...
@@ -87,7 +87,7 @@ py::list get_face_chips (
PyObject
*
arr
=
PyArray_SimpleNew
(
3
,
dims
,
NPY_UINT8
);
PyObject
*
arr
=
PyArray_SimpleNew
(
3
,
dims
,
NPY_UINT8
);
npy_uint8
*
outdata
=
(
npy_uint8
*
)
PyArray_DATA
((
PyArrayObject
*
)
arr
);
npy_uint8
*
outdata
=
(
npy_uint8
*
)
PyArray_DATA
((
PyArrayObject
*
)
arr
);
memcpy
(
outdata
,
image_data
(
chip
),
rows
*
width_step
(
chip
));
memcpy
(
outdata
,
image_data
(
chip
),
rows
*
width_step
(
chip
));
py
::
handle
handle
(
arr
)
;
py
::
handle
handle
=
arr
;
// Append image to chips list
// Append image to chips list
chips_list
.
append
(
handle
);
chips_list
.
append
(
handle
);
...
@@ -114,8 +114,7 @@ py::object get_face_chip (
...
@@ -114,8 +114,7 @@ py::object get_face_chip (
PyObject
*
arr
=
PyArray_SimpleNew
(
3
,
dims
,
NPY_UINT8
);
PyObject
*
arr
=
PyArray_SimpleNew
(
3
,
dims
,
NPY_UINT8
);
npy_uint8
*
outdata
=
(
npy_uint8
*
)
PyArray_DATA
((
PyArrayObject
*
)
arr
);
npy_uint8
*
outdata
=
(
npy_uint8
*
)
PyArray_DATA
((
PyArrayObject
*
)
arr
);
memcpy
(
outdata
,
image_data
(
chip
),
num_rows
(
chip
)
*
width_step
(
chip
));
memcpy
(
outdata
,
image_data
(
chip
),
num_rows
(
chip
)
*
width_step
(
chip
));
py
::
handle
handle
(
arr
);
return
py
::
reinterpret_steal
<
py
::
object
>
(
arr
);
return
handle
.
cast
<
py
::
object
>
();
}
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment