Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.ip.flandmark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.ip.flandmark
Commits
fd98bfad
Commit
fd98bfad
authored
10 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Replace std::string with C-style string
parent
59288f02
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xbob/ip/flandmark/flandmark.cpp
+7
-3
7 additions, 3 deletions
xbob/ip/flandmark/flandmark.cpp
with
7 additions
and
3 deletions
xbob/ip/flandmark/flandmark.cpp
+
7
−
3
View file @
fd98bfad
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
#include
<boost/shared_ptr.hpp>
#include
<boost/shared_ptr.hpp>
#include
<boost/shared_array.hpp>
#include
<boost/shared_array.hpp>
#include
<cstring>
#include
"flandmark_detector.h"
#include
"flandmark_detector.h"
/******************************************
/******************************************
...
@@ -50,7 +52,7 @@ static auto s_class = xbob::extension::ClassDoc(
...
@@ -50,7 +52,7 @@ static auto s_class = xbob::extension::ClassDoc(
typedef
struct
{
typedef
struct
{
PyObject_HEAD
PyObject_HEAD
FLANDMARK_Model
*
flandmark
;
FLANDMARK_Model
*
flandmark
;
std
::
string
filename
;
char
*
filename
;
}
PyBobIpFlandmarkObject
;
}
PyBobIpFlandmarkObject
;
static
int
PyBobIpFlandmark_init
static
int
PyBobIpFlandmark_init
...
@@ -98,7 +100,7 @@ static int PyBobIpFlandmark_init
...
@@ -98,7 +100,7 @@ static int PyBobIpFlandmark_init
}
}
//flandmark is now initialized, set filename
//flandmark is now initialized, set filename
self
->
filename
=
c_filename
;
self
->
filename
=
strndup
(
c_filename
,
256
)
;
//all good, flandmark is ready
//all good, flandmark is ready
return
0
;
return
0
;
...
@@ -108,6 +110,8 @@ static int PyBobIpFlandmark_init
...
@@ -108,6 +110,8 @@ static int PyBobIpFlandmark_init
static
void
PyBobIpFlandmark_delete
(
PyBobIpFlandmarkObject
*
self
)
{
static
void
PyBobIpFlandmark_delete
(
PyBobIpFlandmarkObject
*
self
)
{
flandmark_free
(
self
->
flandmark
);
flandmark_free
(
self
->
flandmark
);
self
->
flandmark
=
0
;
self
->
flandmark
=
0
;
free
(
self
->
filename
);
self
->
filename
=
0
;
Py_TYPE
(
self
)
->
tp_free
((
PyObject
*
)
self
);
Py_TYPE
(
self
)
->
tp_free
((
PyObject
*
)
self
);
}
}
...
@@ -269,7 +273,7 @@ PyObject* PyBobIpFlandmark_Repr(PyBobIpFlandmarkObject* self) {
...
@@ -269,7 +273,7 @@ PyObject* PyBobIpFlandmark_Repr(PyBobIpFlandmarkObject* self) {
*/
*/
PyObject
*
retval
=
PyUnicode_FromFormat
(
"<%s(model='%s')>"
,
PyObject
*
retval
=
PyUnicode_FromFormat
(
"<%s(model='%s')>"
,
Py_TYPE
(
self
)
->
tp_name
,
self
->
filename
.
c_str
()
);
Py_TYPE
(
self
)
->
tp_name
,
self
->
filename
);
#if PYTHON_VERSION_HEX < 0x03000000
#if PYTHON_VERSION_HEX < 0x03000000
if
(
!
retval
)
return
0
;
if
(
!
retval
)
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment