(self)
if self.kitti_infos is not None:
            t = time.time()
            gt_annos = [info["annos"] for info in self.kitti_infos]
            self.message(get_official_eval_result(gt_annos, dt_annos, 0))
            self.message(f"eval use time: {time.time() - t:.4f}")
if self.kitti_infos is not None:
            t = time.time()
            gt_annos = [info["annos"] for info in self.kitti_infos]
            self.message(get_official_eval_result(gt_annos, dt_annos, 0))
            self.message(f"eval use time: {time.time() - t:.4f}")
if self . kitti_infos is not None : t = time . time () gt_annos = [ info [ annos ] for info in self . kitti_infos ] self . message ( get_official_eval_result ( gt_annos dt_annos 0 )) self . message ( f eval use time : { time . time () - t : . 4f } )
def on_loadDetPressed(self):
        det_path = self.w_det_path.text()
        if Path(det_path).is_file():
            with open(det_path, "rb") as f:
                dt_annos = pickle.load(f)
        else:
            dt_annos = kitti.get_label_annos(det_path)
        if len(dt_annos) == 0:
            self.warning("detection path contain nothing.")
            return
        self.detection_annos = dt_annos
        self.info(f"load {len(dt_annos)} detections.")
        self.json_setting.set("latest_det_path", det_path)
        annos = kitti.filter_empty_annos(self.detection_annos)
        self.dt_image_idxes = [anno["image_idx"][0] for anno in annos]
        # get class in dt
        available_cls = []
        for anno in self.detection_annos:
            for name in anno["name"]:
                if name not in available_cls:
                    available_cls.append(name)

        self.dt_combobox.clear()
        self.dt_combobox.addItem("All")
        for cls_name in available_cls:
            self.dt_combobox.addItem(cls_name)

        current_class = self.dt_combobox.currentText()
        if current_class == "All":
            self._current_dt_cls_ids = self.dt_image_idxes
        else:
            self._current_dt_cls_ids = [
                anno["image_idx"][0] for anno in annos
                if anno["name"] == current_class
            ]
        self._current_dt_cls_idx = 0
        """
        if self.kitti_infos is not None:
            t = time.time()
            gt_annos = [info["annos"] for info in self.kitti_infos]
            self.message(get_official_eval_result(gt_annos, dt_annos, 0))
            self.message(f"eval use time: {time.time() - t:.4f}")
        """
def on_loadDetPressed ( self ) : det_path = self . w_det_path . text ( ) if Path ( det_path ) . is_file ( ) : with open ( det_path , "rb" ) as f : dt_annos = pickle . load ( f ) else : dt_annos = kitti . get_label_annos ( det_path ) if len ( dt_annos ) == 0 : self . warning ( "detection path contain nothing." ) return self . detection_annos = dt_annos self . info ( f"load {len(dt_annos)} detections." ) self . json_setting . set ( "latest_det_path" , det_path ) annos = kitti . filter_empty_annos ( self . detection_annos ) self . dt_image_idxes = [ anno [ "image_idx" ] [ 0 ] for anno in annos ] # get class in dt available_cls = [ ] for anno in self . detection_annos : for name in anno [ "name" ] : if name not in available_cls : available_cls . append ( name ) self . dt_combobox . clear ( ) self . dt_combobox . addItem ( "All" ) for cls_name in available_cls : self . dt_combobox . addItem ( cls_name ) current_class = self . dt_combobox . currentText ( ) if current_class == "All" : self . _current_dt_cls_ids = self . dt_image_idxes else : self . _current_dt_cls_ids = [ anno [ "image_idx" ] [ 0 ] for anno in annos if anno [ "name" ] == current_class ] self . _current_dt_cls_idx = 0