Exemple #1
0
    def initOut(self):
        print '     Loading Data...'
        self.train_set = DatasetFromFolder(sequence_dir, 'MOT16/test/MOT16-%02d'%self.seq_index)

        detection_dir = self.out_dir +'res_training_det.txt'
        res_training = self.out_dir + 'res_training.txt'  # the result of the training data
        self.createTxt(detection_dir)
        self.createTxt(res_training)
        self.copyLines(self.seq_index, 1, detection_dir, self.tt, 1)

        self.evaluation(1, self.tt, detection_dir, res_training)
Exemple #2
0
    def initOut(self):
        print('     Loading Data...')
        self.train_set = DatasetFromFolder(sequence_dir, mot_dataset_dir + 'MOT16/test/MOT16-%02d' % self.seq_index,
                                           tau_conf_score)

        detection_dir = self.out_dir + 'res_det.txt'
        res_training = self.out_dir + 'res.txt'  # the tracking results
        self.createTxt(detection_dir)
        self.createTxt(res_training)
        self.copyLines(self.seq_index, 1, detection_dir, self.seq_len, 1)

        self.evaluation(1, self.seq_len, detection_dir, res_training)
Exemple #3
0
    def initOut(self):
        start = time.time()
        print '     Loading Data...'
        print '     Training'
        self.train_set = DatasetFromFolder(sequence_dir)

        gt_training = self.out_dir + 'gt_training.txt'  # the gt of the training data
        self.copyLines(self.seq_index, 1, gt_training, self.tt)

        detection_dir = self.out_dir + 'res_training_det.txt'
        res_training = self.out_dir + 'res_training.txt'  # the result of the training data
        self.createTxt(detection_dir)
        self.createTxt(res_training)
        self.copyLines(self.seq_index, 1, detection_dir, self.tt, 1)

        # Evaluating on the training data
        # motmetrics = open(metrics_dir, 'a')
        # print >> motmetrics, '*'*30, self.tt, '*'*30
        # print >> motmetrics, 'Training'
        self.evaluation(1, self.tt, detection_dir, res_training)
        print '     Time consuming:', (time.time() - start) / 60.0
        # cmd = 'python3 evaluation.py %s %s'%(gt_training, res_training)
        # (status, output) = commands.getstatusoutput(cmd)
        # print >> motmetrics, output
        # print >> motmetrics, 'The time consuming:{}\n\n'.format((time.time()-start)/60)
        # motmetrics.close()

        if self.tt < self.length:
            # Evaluating on the validation data
            start = time.time()
            print '     Validation'

            # The distant sequence
            head = self.length - self.tt + 1
            tail = self.length

            # The sequence nearby
            # head = self.tt
            # tail = 2*self.tt-1

            gt_valiadation = self.out_dir + 'gt_validation.txt'  # the gt of the validation data
            self.copyLines(self.seq_index, head, gt_valiadation, tail)

            detection_dir = self.out_dir + 'res_validation_det.txt'
            res_validation = self.out_dir + 'res_validation.txt'  # the result of the validation data
            self.createTxt(detection_dir)
            self.createTxt(res_validation)
            self.copyLines(self.seq_index, head, detection_dir, tail, 1)

            # motmetrics = open(metrics_dir, 'a')
            # print >> motmetrics, 'Validation'
            self.evaluation(head, tail, detection_dir, res_validation)
            print '     Time consuming:', (time.time() - start) / 60.0
            # cmd = 'python3 evaluation.py %s %s'%(gt_valiadation, res_validation)
            # (status, output) = commands.getstatusoutput(cmd)
            # print >> motmetrics, output
            # print >> motmetrics, 'The time consuming:{}\n\n'.format((time.time()-start)/60)
            # motmetrics.close()
        else:
            # Evaluating on the validation data
            for seq in seqs:
                if seq == self.seq_index:
                    continue
                print '     %02d_Validation' % seq
                start = time.time()
                seq_dir = 'MOT16/train/MOT%d-%02d' % (year, seq)
                self.train_set = DatasetFromFolder(seq_dir)
                gt_seq = self.out_dir + 'gt_%02d.txt' % seq
                seqL = self.copyLines(seq, 1, gt_seq)

                detection_dir = self.out_dir + 'res_%02d_det.txt' % seq
                c_validation = self.out_dir + 'res_%02d.txt' % seq
                self.createTxt(detection_dir)
                self.createTxt(c_validation)
                self.copyLines(seq, 1, detection_dir, tag=1)

                # motmetrics = open(metrics_dir, 'a')
                # print >> motmetrics, '%02d_validation'%seq
                self.evaluation(1, seqL, detection_dir, c_validation)
                print '     Time consuming:', (time.time() - start) / 60.0