def __init__(self):
self.run_recognition = rospy.get_param('/rgb_object_detection/run_recognition')
self.model_filename = rospy.get_param('/rgb_object_detection/model_file')
self.weights_filename = rospy.get_param('/rgb_object_detection/weights_file')
self.categories_filename = rospy.get_param('/rgb_object_detection/category_file')
self.verbose = rospy.get_param('/rgb_object_detection/verbose', False)
self.bridge = CvBridge()
self.image_sub = rospy.Subscriber('/camera/rgb/image_color', Image, self.img_cb)
self.patches_sub = rospy.Subscriber('/candidate_regions_depth', PolygonStamped, self.patches_cb)
self.detection_pub = rospy.Publisher('/detections', Detection, queue_size=1)
# you can read this value off of your sensor from the '/camera/depth_registered/camera_info' topic
self.P = np.array([[525.0, 0.0, 319.5, 0.0], [0.0, 525.0, 239.5, 0.0], [0.0, 0.0, 1.0, 0.0]])
if self.run_recognition:
self.cnn = CNN('', self.model_filename, self.weights_filename, self.categories_filename, '', 0, 0, self.verbose)
self.cnn.load_model()
评论列表
文章目录