src/tools/benchmark_tool/benchmark_tool/metric/kitti_3d_object_detection_metric.py
def _compute_precision(self, precision_file_line):
        """
        Compute the precision score given the 41 values in the kitti sdk output file.

        @param precision_file_line: A string line with 41 values space separated
        @type  precision_file_line: str
        @return: int -1 on Failure, >=0 on successfully computed metric
        """
        # Precision results are 41 values separated by spaces
        values = precision_file_line.rstrip(" \n").split(" ")

        if len(values) < 41:
            error(self.node, "Expected 41 values for precision.")
            return -1

        # Cast values to float
        values = [float(i) for i in values]

        # Kitti sdk declares in the README.txt file that:
        # from 8.10.2019 we compute the average precision not like in the
        # PASCAL VOC protocol, but as follows:
        # ======================
        # sum = 0;
        # for (i=1; i<=40; i++)
        #   sum += vals[i];
        # average = sum/40.0;
        # ======================
        #
        # So we do the same in Python
        precision = sum(values[1::]) / 40.0

        return precision

        Compute the precision score given the 41 values in the kitti sdk output file.

        @param precision_file_line: A string line with 41 values space separated
        @type  precision_file_line: str
        @return: int -1 on Failure, >=0 on successfully computed metric
        
Compute the precision score given the 41 values in the kitti sdk output file.
Compute the precision score given the 41 values in the kitti sdk output file .
def _compute_precision(self, precision_file_line):
        values = precision_file_line.rstrip(" \n").split(" ")
        if len(values) < 41:
            error(self.node, "Expected 41 values for precision.")
            return -1
        values = [float(i) for i in values]
         So we do the same in Python
        precision = sum(values[1::]) / 40.0
        return precision
def _compute_precision ( self , precision_file_line ) : values = precision_file_line . rstrip ( " \n" ) . split ( " " ) if len ( values ) < 41 : error ( self . node , "Expected 41 values for precision." ) return - 1 values = [ float ( i ) for i in values ] precision = sum ( values [ 1 : : ] ) / 40.0 return precision
Compute the precision score given the 41 values in the kitti sdk output file.
Compute the precision score given the 41 values in the kitti sdk output file .
"""
        Compute the precision score given the 41 values in the kitti sdk output file.

        @param precision_file_line: A string line with 41 values space separated
        @type  precision_file_line: str
        @return: int -1 on Failure, >=0 on successfully computed metric
        """ # Precision results are 41 values separated by spaces # Cast values to float # Kitti sdk declares in the README.txt file that: # from 8.10.2019 we compute the average precision not like in the # PASCAL VOC protocol, but as follows: # ====================== # sum = 0; # for (i=1; i<=40; i++) #   sum += vals[i]; # average = sum/40.0; # ====================== # # So we do the same in Python
1 on Failure, >=0 on successfully computed metric
1 on Failure > = 0 on successfully computed metric
self
precision_file_line
A string line with 41 values space separated
A string line with 41 values space separated