Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aws face update #2744

Merged
merged 16 commits into from
Nov 10, 2023
Merged

Aws face update #2744

merged 16 commits into from
Nov 10, 2023

Conversation

k-okada
Copy link
Member

@k-okada k-okada commented Nov 12, 2022

  • set always_publish to false, to publish results only when face is detected
  • publish ~image topic. If you set always_publish to false, this topic is always expecetd to contain face images, home this is useful for robot memory

This would be equivalent as using small script such as


import rospy
import message_filters

from sensor_msgs.msg import CompressedImage
from jsk_recognition_msgs.msg import ClassificationResult

rospy.init_node('publihs_valid_attributes')

def callback(msg_attr, msg_img):
    print("hoge",len(msg_attr.probabilities))
    if len(msg_attr.probabilities) > 0:
        pub_attr.publish(msg_attr)
        pub_image.publish(msg_img)

pub_attr = rospy.Publisher('/aws_detect_faces/attributes/valid', ClassificationResult,queue_size=1)
pub_image = rospy.Publisher('/aws_detect_faces/image/compressed', CompressedImage, queue_size=1)
sub_attr = message_filters.Subscriber('/aws_detect_faces/attributes', ClassificationResult)
sub_image = message_filters.Subscriber('/camera/rgb/image_raw/compressed', CompressedImage)

#ts = message_filters.ApproximateTimeSynchronizer([sub_attr, sub_image], 10, 0.5)
ts = message_filters.TimeSynchronizer([sub_attr, sub_image], 10)
ts.registerCallback(callback)
rospy.spin()

cc: @mqcmd196 @a-ichikura

if you update your jsk_perception repository, you can remove

  <!-- REDEFINE!!! save only valid date : roslaunch make_memory after lifelog.launch -->
  <node pkg="jsk_spot_startup" type="publish_valid_attributes.py"
        name="publish_valid_attributes" />

from your make_memory.launch

to save face image, add following launch to make_memory.launch

      <node name="rgb_image_logger"
            pkg="nodelet" type="nodelet"
            args="load jsk_robot_lifelog/LightweightLogger /mongodb_record_nodelet_manager"
            respawn="true">
        <remap from="~input" to="rgb/$(arg rgb_topic)$(arg rgb_suffix)" />
        <rosparam subst_value="true">
          enable_monitor: false
          monitor_topic: /aws_detect_faces/image/compressed
          vital_check: true
        </rosparam>
      </node>

@k-okada
Copy link
Member Author

k-okada commented Nov 23, 2022

@tkmtnt7000 fix sample_aws_auto_checkin_app.launch with use_usb_cam:=true.

@k-okada k-okada merged commit d20db07 into jsk-ros-pkg:master Nov 10, 2023
11 checks passed
@k-okada k-okada deleted the aws_face_update branch November 10, 2023 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant