def evaluate_ocsort(
        self,
        model,
        distributed=False,
        half=False,
        trt_file=None,
        decoder=None,
        test_size=None,
        result_folder=None
    ):
        """
        COCO average precision (AP) Evaluation. Iterate inference on the test dataset
        and the results are evaluated by COCO API.

        NOTE: This function will change training mode to False, please save states if needed.

        Args:
            model : model to evaluate.

        Returns:
            ap50_95 (float) : COCO AP of IoU=50:95
            ap50 (float) : COCO AP of IoU=50
            summary (sr): summary info of evaluation.
        """
        # TODO half to amp_test
        tensor_type = torch.cuda.HalfTensor if half else torch.cuda.FloatTensor
        model = model.eval()
        if half:
            model = model.half()
        ids = []
        data_list = []
        seq_data_list = dict()
        results = []
        video_names = defaultdict()
        progress_bar = tqdm if is_main_process() else iter

        inference_time = 0
        track_time = 0
        n_samples = len(self.dataloader) - 1

        if trt_file is not None:
            from torch2trt import TRTModule

            model_trt = TRTModule()
            model_trt.load_state_dict(torch.load(trt_file))

            x = torch.ones(1, 3, test_size[0], test_size[1]).cuda()
            model(x)
            model = model_trt
            
        tracker = OCSort(det_thresh = self.args.track_thresh, iou_threshold=self.args.iou_thresh,
            asso_func=self.args.asso, delta_t=self.args.deltat, inertia=self.args.inertia)
        ori_thresh = self.args.track_thresh

        public_dets = dict()

        for cur_iter, (imgs, _, info_imgs, ids) in enumerate(
            progress_bar(self.dataloader)
        ):
            # import pdb; pdb.set_trace()
            with torch.no_grad():
                # init tracker
                frame_id = info_imgs[2].item()
                video_id = info_imgs[3].item()
                img_file_name = info_imgs[4]
                video_name = img_file_name[0].split('/')[0]
                img_id = int(img_file_name[0].split('/')[-1].split(".")[0])

                if video_name not in public_dets:
                    det_path = "datasets/mot/train/{}/det/det.txt".format(video_name)
                    seq_dets = np.loadtxt(det_path, delimiter=",")
                    # seq_dets[:, 4:6] += seq_dets[:, 2:4]
                    public_dets[video_name] = seq_dets
                
                seq_dets = public_dets[video_name].copy()
                frame_dets = seq_dets[np.where(seq_dets[:,0]==img_id)]
                dets = frame_dets[:, 2:6]
                dets[:, 0] += dets[:, 2] / 2.0 
                dets[:, 1] += dets[:, 3] / 2.0
                scores = frame_dets[:, 6][:, np.newaxis]
                padded = np.ones(scores.shape)
                # cls_ = np.zeros(scores.shape)
                outputs_public = np.concatenate([dets, padded, scores], axis=1)
                outputs_public = torch.Tensor(outputs_public)
                outputs_public = outputs_public.unsqueeze(0)
                outputs = postprocess(outputs_public, self.num_classes, self.confthre, self.nmsthre)
                img_name = img_file_name[0].split("/")[2]

                if video_name not in video_names:
                    video_names[video_id] = video_name
                if frame_id == 1:
                    tracker = OCSort(det_thresh = self.args.track_thresh, iou_threshold=self.args.iou_thresh,
                            asso_func=self.args.asso, delta_t=self.args.deltat, inertia=self.args.inertia)
                    if len(results) != 0:
                        try:
                            result_filename = os.path.join(result_folder, '{}.txt'.format(video_names[video_id - 1]))
                        except:
                            import pdb; pdb.set_trace()
                        write_results_no_score(result_filename, results)
                        results = []
                
                """
                """
                is_time_record = cur_iter < len(self.dataloader) - 1
                if is_time_record:
                    start = time.time()

                if is_time_record:
                    infer_end = time_synchronized()
                    inference_time += infer_end - start

            output_results = self.convert_to_coco_format(outputs, info_imgs, ids)
            # import pdb; pdb.set_trace()

            if video_name not in seq_data_list:
                seq_data_list[video_name] = []
            seq_data_list[video_name].extend(output_results)
            data_list.extend(output_results)

            # run tracking
            if outputs[0] is not None:
                online_targets = tracker.update(outputs[0], info_imgs, self.img_size)
                online_tlwhs = []
                online_ids = []
                for t in online_targets:
                    tlwh = [t[0], t[1], t[2] - t[0], t[3] - t[1]]
                    tid = t[4]
                    vertical = tlwh[2] / tlwh[3] > 1.6
                    if tlwh[2] * tlwh[3] > self.args.min_box_area and not vertical:
                        online_tlwhs.append(tlwh)
                        online_ids.append(tid)
                # save results
                results.append((frame_id, online_tlwhs, online_ids))

            if is_time_record:
                track_end = time_synchronized()
                track_time += track_end - infer_end
            
            if cur_iter == len(self.dataloader) - 1:
                result_filename = os.path.join(result_folder, '{}.txt'.format(video_names[video_id]))
                write_results_no_score(result_filename, results)

        statistics = torch.cuda.FloatTensor([inference_time, track_time, n_samples])
        if distributed:
            data_list = gather(data_list, dst=0)
            data_list = list(itertools.chain(*data_list))
            torch.distributed.reduce(statistics, dst=0)
        
        for video_name in seq_data_list.keys():
            self.save_detection_result(seq_data_list[video_name], result_folder, video_name)

        eval_results = self.evaluate_prediction(data_list, statistics)
        synchronize()
        return eval_results

        COCO average precision (AP) Evaluation. Iterate inference on the test dataset
        and the results are evaluated by COCO API.

        NOTE: This function will change training mode to False, please save states if needed.

        Args:
            model : model to evaluate.

        Returns:
            ap50_95 (float) : COCO AP of IoU=50:95
            ap50 (float) : COCO AP of IoU=50
            summary (sr): summary info of evaluation.
        
yolox/evaluators/mot_evaluator_public.py