skhadem / 3D-BoundingBox

PyTorch implementation for 3D Bounding Box Estimation Using Deep Learning and Geometry
MIT License
435 stars 96 forks source link

How to get the score (confidence) of a 3D Bounding Box? #22

Open RobeSafe-UAH opened 3 years ago

RobeSafe-UAH commented 3 years ago

Hi folks,

I have observed this part of the source code:

""" det.type in self.classes and det.score > self.score_thres):

            intrinsics = ros_intrinsics(self.camera_info.P)
            input_tensor,theta_ray = preprocessing(image,det,intrinsics)
            [orient, conf, dim] = self.model(input_tensor) #Apply the model to get the estimation
            orient = orient.cpu().data.numpy()[0, :, :]
            conf = conf.cpu().data.numpy()[0, :]
            dim = dim.cpu().data.numpy()[0, :]
            # print("Conf:{}".format(conf))
            dim += self.averages.get_item(det.type)

            argmax = np.argmax(conf)
            orient = orient[argmax, :]
            cos = orient[0]
            sin = orient[1]
            alpha = np.arctan2(sin, cos)
            alpha += self.angle_bins[argmax]
            alpha -= np.pi

"""

But that conf is a tuple of two numbers, which is used to determine the best orientation, like this:

""" Conf:[ 6.3896847 -6.5501723] Conf:[ 6.496025 -6.7066655] Conf:[ 5.410366 -5.5474744] Conf:[ 7.092432 -7.3124714] Conf:[ 9.061753 -9.251386] Conf:[ 7.587371 -7.831802] Conf:[ 2.149212 -2.1235662] Conf:[-0.84504336 0.89392436] Conf:[ 4.436549 -4.5268965] Conf:[ 1.2938225 -1.4327605] """

How can I get the score of the final 3D Bounding Box? (0 to 1 value, like in every 2D or 3D object detector)

Thanks in advance.

zsnihao commented 3 years ago

you solve it? @RobeSafe-UAH

jamesheatonrdm commented 1 year ago

Why don't you normalize the confidence array?