Main Page
Namespaces
Classes
Files
File List
File Members
scripts
evaluate_box_segmentation_by_gt_box.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
3
from
jsk_recognition_msgs.msg
import
Accuracy
4
from
jsk_recognition_msgs.msg
import
BoundingBox
5
import
jsk_recognition_utils
6
import
rospy
7
from
jsk_topic_tools
import
ConnectionBasedTransport
8
9
10
class
EvaluateBoxSegmentationByGTBox
(ConnectionBasedTransport):
11
12
def
__init__
(self):
13
super(EvaluateBoxSegmentationByGTBox, self).
__init__
()
14
self.
box_gt
=
None
15
self.
pub
= self.advertise(
'~output'
, Accuracy, queue_size=1)
16
self.
sub_box_gt
= rospy.Subscriber(
17
'~input/box_gt'
, BoundingBox, self.
_cb_box_gt
)
18
19
def
subscribe
(self):
20
self.
sub_voxels
= rospy.Subscriber(
21
'~input/box'
, BoundingBox, self.
_cb_box
)
22
23
def
unsubscribe
(self):
24
self.sub_voxels.unregister()
25
26
def
_cb_box_gt
(self, box_msg):
27
self.
box_gt
=
jsk_recognition_utils.bounding_box_msg_to_aabb
(box_msg)
28
29
def
_cb_box
(self, box_msg):
30
if
self.
box_gt
is
None
:
31
rospy.logwarn(
'GT. box is not set, skipping.'
)
32
return
33
box =
jsk_recognition_utils.bounding_box_msg_to_aabb
(box_msg)
34
iu =
jsk_recognition_utils.get_overlap_of_aabb
(self.
box_gt
, box)
35
36
out_msg = Accuracy(header=box_msg.header, accuracy=iu)
37
self.pub.publish(out_msg)
38
39
40
if
__name__ ==
'__main__'
:
41
rospy.init_node(
'evaluate_box_segmentation_by_gt_box'
)
42
EvaluateBoxSegmentationByGTBox
()
43
rospy.spin()
jsk_recognition_utils::get_overlap_of_aabb
get_overlap_of_aabb
evaluate_box_segmentation_by_gt_box.EvaluateBoxSegmentationByGTBox.sub_voxels
sub_voxels
Definition:
evaluate_box_segmentation_by_gt_box.py:20
evaluate_box_segmentation_by_gt_box.EvaluateBoxSegmentationByGTBox.sub_box_gt
sub_box_gt
Definition:
evaluate_box_segmentation_by_gt_box.py:16
evaluate_box_segmentation_by_gt_box.EvaluateBoxSegmentationByGTBox.unsubscribe
def unsubscribe(self)
Definition:
evaluate_box_segmentation_by_gt_box.py:23
evaluate_box_segmentation_by_gt_box.EvaluateBoxSegmentationByGTBox.pub
pub
Definition:
evaluate_box_segmentation_by_gt_box.py:15
evaluate_box_segmentation_by_gt_box.EvaluateBoxSegmentationByGTBox
Definition:
evaluate_box_segmentation_by_gt_box.py:10
evaluate_box_segmentation_by_gt_box.EvaluateBoxSegmentationByGTBox._cb_box_gt
def _cb_box_gt(self, box_msg)
Definition:
evaluate_box_segmentation_by_gt_box.py:26
evaluate_box_segmentation_by_gt_box.EvaluateBoxSegmentationByGTBox.box_gt
box_gt
Definition:
evaluate_box_segmentation_by_gt_box.py:14
evaluate_box_segmentation_by_gt_box.EvaluateBoxSegmentationByGTBox.__init__
def __init__(self)
Definition:
evaluate_box_segmentation_by_gt_box.py:12
evaluate_box_segmentation_by_gt_box.EvaluateBoxSegmentationByGTBox.subscribe
def subscribe(self)
Definition:
evaluate_box_segmentation_by_gt_box.py:19
evaluate_box_segmentation_by_gt_box.EvaluateBoxSegmentationByGTBox._cb_box
def _cb_box(self, box_msg)
Definition:
evaluate_box_segmentation_by_gt_box.py:29
jsk_recognition_utils::bounding_box_msg_to_aabb
bounding_box_msg_to_aabb
jsk_pcl_ros_utils
Author(s): Yohei Kakiuchi
autogenerated on Mon May 3 2021 03:03:15