-
 

hri_face_detect repository

Repository Summary

Checkout URI https://github.com/ros4hri/hri_face_detect.git
VCS Type git
VCS Version humble-devel
Last Updated 2024-10-11
Dev Status DEVELOPED
CI status No Continuous Integration
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Packages

Name Version
hri_face_detect 2.0.10

README

hri_face_detect

A ROS4HRI-compiant ROS node to perform fast face detection using YuNet face detector and Mediapipe Face Mesh. The former performs well at greater distances (depending on image resolution and image scaling applied) and extracts 5 keypoints. The latter works only at close distances and extracts all the ROS4HRI-defined landmarks.

Installing dependencies

If you are running this package outside PAL, first install all the dependencies:

pip install -r requirements.txt

ROS API

Parameters

All parameters are loaded in the lifecycle configuration transition.

  • processing_rate (int, default: 30): Image processing logic execution rate in Hertz.

  • face_mesh (bool, default: true): It enables the additional Mediapipe Face Mesh detection.

  • confidence_threshold (double, default: 0.75): Candidate face detections with confidence lower that this threshold are not published.

  • image_scale (double, default: 0.5): The YuNet face detector accepts input image of dynamic size. This parameter controls the rescale factor applied to the input image before running the YuNet face detector. Lower image scale results in less processing time required and lower detection confidences. The output data (e.g., RoI) is invariant with this parameter and always refers to the original input image size.

  • filtering_frame (string, default: “camera_color_optical_frame”): The reference frame the estimated face pose should be transformed to before performing the filtering operations. Due to the proximity between the camera frame and the detected faces, and considering that cameras can be mounted on frequently moving robot’s components (e.g., robot’s head), directly filtering a face pose expressed in camera optical frame might reduce the filtering quality.

  • deterministic_ids (bool, default: false): If true the face ids start from “f00000” and increases by one for each new face. If false it is a random five letters sequence.

  • debug (bool, default: false): If true opens a windows showing the input image with face detections overlayed.

Topics

This package follows the ROS4HRI conventions (REP-155). If the topic message type is not indicated, the ROS4HRI convention is implied.

Subscribed

Published

  • /humans/faces/<faceID>/roi
  • /humans/faces/<faceID>/landmarks
  • /humans/faces/<faceID>/cropped
  • /humans/faces/<faceID>/aligned
  • /humans/faces/tracked
  • /diagnostics (diagnostic_msgs/msg/DiagnosticArray)

Execution

ros2 launch hri_face_detect face_detect.launch rgb_camera:=<input camera namespace>

Example

For an example of usage, execute in different terminals:

  • USB camera:
    1. apt install ros-humble-usb-cam
    2. ros2 run usb_cam usb_cam_node_exe
  • HRI face detect:
    1. apt install ros-humble-hri-face-detect
    2. ros2 launch hri_face_detect face_detect.launch.py
  • RViz with HRI plugin:
    1. apt install ros-humble-rviz2
    2. apt install ros-humble-hri-rviz
    3. rviz2

In RViz, add the ‘Humans’ plugin to see the detected faces with the relative keypoints.

CONTRIBUTING

Contributing Guidelines

Thank you for your interest in contributing to this project Whether it’s a bug report, new feature, correction, or additional documentation, we greatly value feedback and contributions from our community.

Please read through this document before submitting any issues or pull requests to ensure we have all the necessary information to effectively respond to your bug report or contribution.

Reporting Bugs/Feature Requests

We welcome you to use the GitHub issue tracker to report bugs or suggest features.

When filing an issue, please check existing open issues, or recently closed, issues to make sure somebody else hasn’t already reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:

  • A reproducible test case or series of steps
  • The version of our code being used
  • Any modifications you’ve made relevant to the bug
  • Anything unusual about your environment or deployment

Contributing via Pull Requests

Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

  1. You are working against the latest source on the master branch.
  2. You check existing open, and recently merged, pull requests to make sure someone else hasn’t addressed the problem already.
  3. You open an issue to discuss any significant work - we would hate for your time to be wasted.

To send us a pull request, please:

  1. Fork the repository.
  2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
  3. Ensure local tests pass. (colcon test)
  4. Commit to your fork using clear commit messages.
  5. Send a pull request, answering any default questions in the pull request interface.
  6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

GitHub provides additional documentation on forking a repository and creating a pull request.

Licensing

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.