Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Soft Biometrics Estimation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Spring
WP4_Behavior
Soft Biometrics Estimation
Commits
b4549957
Commit
b4549957
authored
2 years ago
by
Francesco Tonini
Browse files
Options
Downloads
Patches
Plain Diff
Refactor publisher initialization
parent
e1eb7a85
Branches
Branches containing commit
No related tags found
1 merge request
!4
Update submodules and add timestamp
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/soft_biometrics_estimation.py
+15
-14
15 additions, 14 deletions
src/soft_biometrics_estimation.py
with
15 additions
and
14 deletions
src/soft_biometrics_estimation.py
+
15
−
14
View file @
b4549957
...
...
@@ -99,6 +99,15 @@ class SoftBiometricsEstimation:
self
.
_cropped_image_callback
,
id
,
)
self
.
faces
[
id
][
"
topics
"
][
"
softbio
"
]
=
rospy
.
Publisher
(
self
.
topic_name_softbio
(
id
),
SoftBiometrics
,
queue_size
=
10
,
latch
=
True
,
)
self
.
faces
[
id
][
"
data
"
][
"
age
"
]
=
deque
([],
maxlen
=
15
)
self
.
faces
[
id
][
"
data
"
][
"
gender
"
]
=
deque
([],
maxlen
=
15
)
elif
id
not
in
face_ids
and
id
in
subscribed_ids
:
self
.
_unsubscribe_face
(
id
)
...
...
@@ -128,21 +137,9 @@ class SoftBiometricsEstimation:
# Pop embeddings and create the message
embeddings
=
softbio_estimations
.
pop
(
"
encoded
"
)
# Get topics and data for this
# Get topics and data for this
face
this_id_topics
=
self
.
faces
[
id
][
"
topics
"
]
this_id_data
=
self
.
faces
[
id
][
"
data
"
]
if
"
softbio
"
not
in
this_id_topics
.
keys
():
softbio_pub
=
rospy
.
Publisher
(
self
.
topic_name_softbio
(
id
),
SoftBiometrics
,
queue_size
=
10
,
latch
=
True
,
)
self
.
faces
[
id
][
"
topics
"
][
"
softbio
"
]
=
softbio_pub
self
.
faces
[
id
][
"
data
"
][
"
age
"
]
=
deque
([],
maxlen
=
15
)
self
.
faces
[
id
][
"
data
"
][
"
gender
"
]
=
deque
([],
maxlen
=
15
)
softbio_pub
=
this_id_topics
[
"
softbio
"
]
mov_avg_estimates
=
{
"
age
"
:
this_id_data
[
"
age
"
],
...
...
@@ -324,8 +321,12 @@ class SoftBiometricsEstimation:
continue
age
=
this_face_data
[
"
age
"
]
age
=
round
(
sum
(
age
)
/
len
(
age
))
gender
=
this_face_data
[
"
gender
"
]
if
len
(
age
)
==
0
or
len
(
gender
)
==
0
:
continue
age
=
round
(
sum
(
age
)
/
len
(
age
))
gender
=
round
(
sum
(
gender
)
/
len
(
gender
))
gender_value
=
KeyValue
(
...
...
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