Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
0db8713a
Commit
0db8713a
authored
Mar 31, 2018
by
visionworkz
Committed by
Davis E. King
Mar 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed reference count issue (#1222)
parent
d36c6619
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
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