(self, y, t, calcrange=slice(0, None))
return np.array((self.labelMetric.get()[:, calcrange].mean(),
                         self.detectionMetric.get()[:, calcrange].mean()))
Returns a numpy array with the accuracy and the Smooth-L1 metrics.

        Args:
            y (Tensor or OpTree): Output of a model like Fast-RCNN model with 2 elements:
                                    1. class label: (# classes, # batchsize for ROIs)
                                    2. object bounding box (# classes * 4, # bacthsize for ROIs)
            t (Tensor or OpTree): True targets corresponding to y, with 2 elements:
                                    1. class labels: (# classes, # batchsize for ROIs)
                                        1.1 class labels
                                                    (# classes, # batchsize for ROIs)
                                        1.2 class labels mask
                                                    (# classes, # batchsize for ROIs)
                                    2. object bounding box and mask, where mask will indicate the
                                        real object to detect other than the background objects
                                        2.1 object bounding box
                                                    (# classes * 4, # bacthsize for ROIs)
                                        2.2 object bounding box mask
                                                    (# classes * 4, # bacthsize for ROIs)

        Returns:
            numpy ary : Returns the metrics in numpy array [Label Accuracy, Bounding Box Smooth-L1]
Returns a numpy array with the accuracy and the Smooth-L1 metrics.
Returns a numpy array with the accuracy and the Smooth - L1 metrics .
def __call__(self, y, t, calcrange=slice(0, None)):
        """
        Returns a numpy array with the accuracy and the Smooth-L1 metrics.

        Args:
            y (Tensor or OpTree): Output of a model like Fast-RCNN model with 2 elements:
                                    1. class label: (# classes, # batchsize for ROIs)
                                    2. object bounding box (# classes * 4, # bacthsize for ROIs)
            t (Tensor or OpTree): True targets corresponding to y, with 2 elements:
                                    1. class labels: (# classes, # batchsize for ROIs)
                                        1.1 class labels
                                                    (# classes, # batchsize for ROIs)
                                        1.2 class labels mask
                                                    (# classes, # batchsize for ROIs)
                                    2. object bounding box and mask, where mask will indicate the
                                        real object to detect other than the background objects
                                        2.1 object bounding box
                                                    (# classes * 4, # bacthsize for ROIs)
                                        2.2 object bounding box mask
                                                    (# classes * 4, # bacthsize for ROIs)

        Returns:
            numpy ary : Returns the metrics in numpy array [Label Accuracy, Bounding Box Smooth-L1]
        """
        t_bb = t[self.bbox_ind][0]
        t_bb_mask = t[self.bbox_ind][1]
        y_bb = y[self.bbox_ind]

        self.detectionMetric = self.be.empty((1, t_bb.shape[1]))
        self.detectionMetric[:] = self.be.sum(self.smoothL1(y_bb * t_bb_mask - t_bb), axis=0)

        if isinstance(t[self.label_ind], tuple):
            t_lbl = t[self.label_ind][0] * t[self.label_ind][1]
            y_lbl = y[self.label_ind] * t[self.label_ind][1]
        else:
            t_lbl = t[self.label_ind]
            y_lbl = y[self.label_ind]

        self.preds = self.be.empty((1, y_lbl.shape[1]))
        self.hyps = self.be.empty((1, t_lbl.shape[1]))
        self.labelMetric = self.be.empty((1, y_lbl.shape[1]))

        self.preds[:] = self.be.argmax(y_lbl, axis=0)
        self.hyps[:] = self.be.argmax(t_lbl, axis=0)
        self.labelMetric[:] = self.be.equal(self.preds, self.hyps)

        return np.array((self.labelMetric.get()[:, calcrange].mean(),
                         self.detectionMetric.get()[:, calcrange].mean()))
def __call__ ( self , y , t , calcrange = slice ( 0 , None ) ) : t_bb = t [ self . bbox_ind ] [ 0 ] t_bb_mask = t [ self . bbox_ind ] [ 1 ] y_bb = y [ self . bbox_ind ] self . detectionMetric = self . be . empty ( ( 1 , t_bb . shape [ 1 ] ) ) self . detectionMetric [ : ] = self . be . sum ( self . smoothL1 ( y_bb * t_bb_mask - t_bb ) , axis = 0 ) if isinstance ( t [ self . label_ind ] , tuple ) : t_lbl = t [ self . label_ind ] [ 0 ] * t [ self . label_ind ] [ 1 ] y_lbl = y [ self . label_ind ] * t [ self . label_ind ] [ 1 ] else : t_lbl = t [ self . label_ind ] y_lbl = y [ self . label_ind ] self . preds = self . be . empty ( ( 1 , y_lbl . shape [ 1 ] ) ) self . hyps = self . be . empty ( ( 1 , t_lbl . shape [ 1 ] ) ) self . labelMetric = self . be . empty ( ( 1 , y_lbl . shape [ 1 ] ) ) self . preds [ : ] = self . be . argmax ( y_lbl , axis = 0 ) self . hyps [ : ] = self . be . argmax ( t_lbl , axis = 0 ) self . labelMetric [ : ] = self . be . equal ( self . preds , self . hyps ) return np . array ( ( self . labelMetric . get ( ) [ : , calcrange ] . mean ( ) , self . detectionMetric . get ( ) [ : , calcrange ] . mean ( ) ) )