Ejemplo n.º 1
0
def _transforms(name, scale, mean, std, gray_probability, blur_probability, sigma):
    # standard size: (1333, 800)
    if name == 'basic_train':
        return data.BasicPairTransforms(train=True, scale=scale, mean=mean, std=std)
    elif name == 'basic_test': 
        return data.BasicPairTransforms(train=False, scale=scale, mean=mean, std=std)
    elif name == 'extra_partial': 
        return data.ExtraPairTransforms(
        with_photometric=True,
        with_expand=False,
        with_crop=False)
    elif name == 'extra_full': 
        return data.ExtraPairTransforms()
    elif name == 'extra_partial_boost':
        return data.ExtraPairTransforms(
        with_photometric=True,
        with_expand=False,
        with_crop=False,
        with_grayscale=True,
        with_blur=True,
        gray_probability=gray_probability,
        sigma=sigma,
        blur_probability=blur_probability
        )
    elif name == 'extra_full_boost':
        return data.ExtraPairTransforms(
        with_grayscale=True,
        with_blur=True,
        gray_probability=gray_probability,
        sigma=sigma,
        blur_probability=blur_probability
        )
    else:
        raise KeyError('Unknown transform:', name)
Ejemplo n.º 2
0
def _transforms(name):
    # standard size: (1333, 800)
    if name == 'basic_train':
        return data.BasicPairTransforms(train=True)
    elif name == 'basic_test':
        return data.BasicPairTransforms(train=False)
    elif name == 'extra_partial':
        return data.ExtraPairTransforms(with_photometric=True,
                                        with_expand=False,
                                        with_crop=False)
    elif name == 'extra_full':
        return data.ExtraPairTransforms()
    else:
        raise KeyError('Unknown transform:', name)
Ejemplo n.º 3
0
 def Golbal_Track_init(self, image, init_box):
     cfg_file = os.path.join(base_path, 'DiMP_LTMU/Global_Track/configs/qg_rcnn_r50_fpn.py')
     ckp_file = os.path.join(base_path, 'DiMP_LTMU/Global_Track/checkpoints/qg_rcnn_r50_fpn_coco_got10k_lasot.pth')
     transforms = data.BasicPairTransforms(train=False)
     self.Global_Tracker = GlobalTrack(
         cfg_file, ckp_file, transforms,
         name_suffix='qg_rcnn_r50_fpn')
     self.Global_Tracker.init(image, init_box)
Ejemplo n.º 4
0
 def Golbal_Track_init(self, image, init_box):
     init_box = [
         init_box[0], init_box[1], init_box[0] + init_box[2],
         init_box[1] + init_box[3]
     ]
     cfg_file = 'Global_Track/configs/qg_rcnn_r50_fpn.py'
     ckp_file = 'Global_Track/checkpoints/qg_rcnn_r50_fpn_coco_got10k_lasot.pth'
     transforms = data.BasicPairTransforms(train=False)
     self.Global_Tracker = GlobalTrack(cfg_file,
                                       ckp_file,
                                       transforms,
                                       name_suffix='qg_rcnn_r50_fpn')
     self.Global_Tracker.init(image, init_box)
Ejemplo n.º 5
0
    def test_global_track(self):
        # settings
        cfg_files = [
            'configs/qg_rpn_r50_fpn.py',
            'configs/qg_rcnn_r50_fpn.py',
            'configs/qg_rpn_r18_fpn.py']
        ckp_files = [
            'checkpoints/qg_rpn_r50_fpn_coco_got10k_lasot.pth',
            'checkpoints/qg_rcnn_r50_fpn_coco_got10k_lasot.pth',
            'work_dirs/qg_rpn_r18_fpn/epoch_12.pth']
        transforms = data.BasicPairTransforms(train=False)

        # run evaluation over different settings
        for cfg_file, ckp_file in zip(cfg_files, ckp_files):
            tracker = GlobalTrack(cfg_file, ckp_file, transforms)
            self.evaluator.run(tracker, visualize=self.visualize)
            self.evaluator.report(tracker.name)
Ejemplo n.º 6
0
 def test_mmdet_transforms(self):
     for transforms in [
             data.BasicPairTransforms(),
             data.ExtraPairTransforms()
     ]:
         dataset = data.Seq2Pair(self.seqs, transforms=transforms)
         indices = np.random.choice(len(dataset), 10)
         for i in indices:
             item = dataset[i]
             img_z = ops.stretch_color(item['img_z'].permute(1, 2,
                                                             0).numpy())
             img_x = ops.stretch_color(item['img_x'].permute(1, 2,
                                                             0).numpy())
             bboxes_z = item['gt_bboxes_z'][0].numpy()
             bboxes_x = item['gt_bboxes_x'][0].numpy()
             if self.visualize:
                 ops.show_image(img_z, bboxes_z, fig=1, delay=1)
                 ops.show_image(img_x, bboxes_x, fig=2, delay=0)
Ejemplo n.º 7
0
import _init_paths
import neuron.data as data
from trackers import *
from mmcv import Config

if __name__ == '__main__':
    cfg_file = 'configs/dmtrackGS_dla34_fpn.py'
    cfg = Config.fromfile(cfg_file)
    ckp_file = 'work_dirs/dmtrack_dla34_fpn/dmtrackGS.pth'
    transforms = data.BasicPairTransforms(scale=cfg.data.test['scale'],
                                          train=cfg.data.test['train'])
    tracker = DMTrack(cfg_file,
                      ckp_file,
                      transforms,
                      name_suffix='dmtrack_dla34_fpn')
    evaluators = [
        data.EvaluatorLaSOT(frame_stride=10),
    ]
    for e in evaluators:
        e.run(tracker, visualize=False, return_all=False)
        e.report(tracker.name, return_all=False)
Ejemplo n.º 8
0
import _init_paths
import neuron.data as data
from trackers import *

if __name__ == '__main__':
    cfg_file = 'configs/qg_rcnn_r50_fpn.py'
    ckp_file = 'checkpoints/qg_rcnn_r50_fpn_coco_got10k_lasot.pth'
    transforms = data.BasicPairTransforms(train=False)
    tracker = GlobalTrack(cfg_file,
                          ckp_file,
                          transforms,
                          name_suffix='qg_rcnn_r50_fpn')
    evaluators = [
        # data.EvaluatorOTB(version=2015, root_dir="/disk/xuxiang/GlobalTrack/data/OTB100"),
        # data.EvaluatorLaSOT(frame_stride=10, root_dir="/disk/xuxiang/GlobalTrack/data/LaSOTBenchmark"),
        # data.EvaluatorGOT10k(subset='test', root_dir="/disk/xuxiang/GlobalTrack/data/GOT-10k"),
        data.EvaluatorTLP(root_dir="/disk/xuxiang/GlobalTrack/data/TLP")
    ]
    for e in evaluators:
        e.run(tracker, visualize=False)
        e.report(tracker.name)