(self,id_setup, res_file)
Compute and display summary metrics for evaluation results.
        Note this functin can *only* be applied on the default parameter setting
Compute and display summary metrics for evaluation results.
        Note this functin can *only* be applied on the default parameter setting
Compute and display summary metrics for evaluation results . Note this functin can * only * be applied on the default parameter setting
def summarize(self,id_setup, res_file):
        '''
        Compute and display summary metrics for evaluation results.
        Note this functin can *only* be applied on the default parameter setting
        '''
        def _summarize(iouThr=None, maxDets=100 ):
            p = self.params
            iStr = ' {:<18} {} @ {:<18} [ IoU={:<9} | height={:>6s} | visibility={:>6s} ] = {:0.2f}%'
            titleStr = 'Average Miss Rate'
            typeStr = '(MR)'
            setupStr = p.SetupLbl[id_setup]
            iouStr = '{:0.2f}:{:0.2f}'.format(p.iouThrs[0], p.iouThrs[-1]) \
                if iouThr is None else '{:0.2f}'.format(iouThr)
            heightStr = '[{:0.0f}:{:0.0f}]'.format(p.HtRng[id_setup][0], p.HtRng[id_setup][1])
            occlStr = '[{:0.2f}:{:0.2f}]'.format(p.VisRng[id_setup][0], p.VisRng[id_setup][1])

            mind = [i for i, mDet in enumerate(p.maxDets) if mDet == maxDets]

            # dimension of precision: [TxRxKxAxM]
            s = self.eval['TP']
            # IoU
            if iouThr is not None:
                t = np.where(iouThr == p.iouThrs)[0]
                s = s[t]
            mrs = 1-s[:,:,:,mind]

            if len(mrs[mrs<2])==0:
                mean_s = -1
            else:
                mean_s = np.log(mrs[mrs<2])
                mean_s = np.mean(mean_s)
                mean_s = np.exp(mean_s)
            print(iStr.format(titleStr, typeStr,setupStr, iouStr, heightStr, occlStr, mean_s*100))
            # res_file.write(iStr.format(titleStr, typeStr,setupStr, iouStr, heightStr, occlStr, mean_s*100))
            res_file.write(str(mean_s * 100))
            res_file.write('\n')
            return mean_s

        if not self.eval:
            raise Exception('Please run accumulate() first')
        _summarize(iouThr=.5,maxDets=1000)
def summarize ( self , id_setup , res_file ) : def _summarize ( iouThr = None , maxDets = 100 ) : p = self . params iStr = ' {:<18} {} @ {:<18} [ IoU={:<9} | height={:>6s} | visibility={:>6s} ] = {:0.2f}%' titleStr = 'Average Miss Rate' typeStr = '(MR)' setupStr = p . SetupLbl [ id_setup ] iouStr = '{:0.2f}:{:0.2f}' . format ( p . iouThrs [ 0 ] , p . iouThrs [ - 1 ] ) if iouThr is None else '{:0.2f}' . format ( iouThr ) heightStr = '[{:0.0f}:{:0.0f}]' . format ( p . HtRng [ id_setup ] [ 0 ] , p . HtRng [ id_setup ] [ 1 ] ) occlStr = '[{:0.2f}:{:0.2f}]' . format ( p . VisRng [ id_setup ] [ 0 ] , p . VisRng [ id_setup ] [ 1 ] ) mind = [ i for i , mDet in enumerate ( p . maxDets ) if mDet == maxDets ] # dimension of precision: [TxRxKxAxM] s = self . eval [ 'TP' ] # IoU if iouThr is not None : t = np . where ( iouThr == p . iouThrs ) [ 0 ] s = s [ t ] mrs = 1 - s [ : , : , : , mind ] if len ( mrs [ mrs < 2 ] ) == 0 : mean_s = - 1 else : mean_s = np . log ( mrs [ mrs < 2 ] ) mean_s = np . mean ( mean_s ) mean_s = np . exp ( mean_s ) print ( iStr . format ( titleStr , typeStr , setupStr , iouStr , heightStr , occlStr , mean_s * 100 ) ) # res_file.write(iStr.format(titleStr, typeStr,setupStr, iouStr, heightStr, occlStr, mean_s*100)) res_file . write ( str ( mean_s * 100 ) ) res_file . write ( '\n' ) return mean_s if not self . eval : raise Exception ( 'Please run accumulate() first' ) _summarize ( iouThr = .5 , maxDets = 1000 )