people_recognition_2d.people_recognizer_2d

Classes

PeopleRecognizer2D

Functions

_get_and_wait_for_service(srv_name, srv_class)

Function to start and wait for dependent service

_get_service_response(srv, args)

Method to get service response with checks

Module Contents

people_recognition_2d.people_recognizer_2d._get_and_wait_for_service(srv_name, srv_class)[source]

Function to start and wait for dependent service

Param:

srv_name: Service name

Param:

srv_class: Service class

Returns:

started ServiceProxy object

people_recognition_2d.people_recognizer_2d._get_service_response(srv, args)[source]

Method to get service response with checks

Param:

srv: service

Param:

args: Input arguments of the service request

Returns:

response

class people_recognition_2d.people_recognizer_2d.PeopleRecognizer2D(pose_estimation_srv_name, face_recognition_srv_name, face_properties_srv_name, color_extractor_srv_name, enable_age_gender_detection, enable_shirt_color_extraction)[source]

Bases: object

_pose_estimation_srv
_face_recognition_srv
_enable_age_gender_detection
_enable_shirt_color_extraction
_bridge
static _get_recognitions_with_label(label, recognitions)[source]
static _get_face_rois_ids_pose_estimation(recognitions)[source]

Get ROIs of faces from pose estimation using the nose, left ear and right ear

Param:

recognitions from pose estimation

static _get_body_parts_pose_estimation(group_id, recognitions)[source]

Get a list of all bodyparts associated with a particular group ID

Param:

group_id: The group ID of the bodyparts to be fetched

Param:

recognitions: All bodyparts received from pose estimation

Returns:

List of body_parts

static _get_container_recognition(roi, recognitions, padding_factor=0.1)[source]

Associate pose estimation ROI with best pose estimation face ROI

Param:

roi: pose estimation face roi

Param:

recognitions: face recognitions

static _get_best_label_from_categorical_distribution(c)[source]
static _image_from_roi(image, roi)[source]
static _get_best_label(recognition)[source]
static _face_properties_to_label(face_properties)[source]
static _shirt_colors_to_label(shirt_colors)[source]

Convert shirt colors array to label string

Param:

shirt_colors: Array to colors

Returns:

string label

static _shirt_roi_from_face_roi(face_roi, image_shape)[source]

Given a ROI for a face, shift the ROI to the person’s shirt. Assuming the person is upright :/

Parameters:
  • face_roi – RegionOfInterest

  • image_shape – tuple of the image shape

Returns:

RegionOfInterest

recognize(image_msg)[source]