Showing preview only (5,675K chars total). Download the full file or copy to clipboard to get everything.
Repository: MIV-XJTU/ARTrack
Branch: main
Commit: 5931f4af8dd3
Files: 756
Total size: 5.3 MB
Directory structure:
gitextract_o26t4wgy/
├── ARTrack_env_cuda113.yaml
├── LICENSE
├── README.md
├── artrackv2_mindspore/
│ ├── .gitignore
│ ├── README.md
│ ├── experiments/
│ │ └── ostrack/
│ │ ├── 2stage_256_got.yaml
│ │ ├── best_384.yaml
│ │ ├── finetune.yaml
│ │ ├── finetune_384.yaml
│ │ ├── finetune_384_got.yaml
│ │ ├── vitb_256_mae_32x4_ep300.yaml
│ │ ├── vitb_256_mae_ce_32x4_ep300.yaml
│ │ ├── vitb_256_mae_ce_32x4_got10k_ep100.yaml
│ │ ├── vitb_384_mae_32x4_ep300.yaml
│ │ ├── vitb_384_mae_ce_32x4_ep300.yaml
│ │ └── vitb_384_mae_ce_32x4_got10k_ep100.yaml
│ ├── external/
│ │ ├── AR/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── ltr/
│ │ │ │ ├── README.md
│ │ │ │ ├── __init__.py
│ │ │ │ ├── actors/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── base_actor.py
│ │ │ │ │ ├── bbreg.py
│ │ │ │ │ └── tracking.py
│ │ │ │ ├── admin/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── environment.py
│ │ │ │ │ ├── loading.py
│ │ │ │ │ ├── model_constructor.py
│ │ │ │ │ ├── multigpu.py
│ │ │ │ │ ├── settings.py
│ │ │ │ │ ├── stats.py
│ │ │ │ │ └── tensorboard.py
│ │ │ │ ├── data/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── bounding_box_utils.py
│ │ │ │ │ ├── image_loader.py
│ │ │ │ │ ├── loader.py
│ │ │ │ │ ├── processing.py
│ │ │ │ │ ├── processing_utils.py
│ │ │ │ │ ├── processing_utils_SE.py
│ │ │ │ │ ├── sampler.py
│ │ │ │ │ └── transforms.py
│ │ │ │ ├── dataset/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── base_image_dataset.py
│ │ │ │ │ ├── base_video_dataset.py
│ │ │ │ │ ├── coco.py
│ │ │ │ │ ├── coco_seq.py
│ │ │ │ │ ├── davis.py
│ │ │ │ │ ├── ecssd.py
│ │ │ │ │ ├── got10k.py
│ │ │ │ │ ├── hku_is.py
│ │ │ │ │ ├── imagenetvid.py
│ │ │ │ │ ├── lasot.py
│ │ │ │ │ ├── lvis.py
│ │ │ │ │ ├── msra10k.py
│ │ │ │ │ ├── sbd.py
│ │ │ │ │ ├── synthetic_video.py
│ │ │ │ │ ├── synthetic_video_blend.py
│ │ │ │ │ ├── tracking_net.py
│ │ │ │ │ ├── vos_base.py
│ │ │ │ │ └── youtubevos.py
│ │ │ │ ├── external/
│ │ │ │ │ └── PreciseRoIPooling/
│ │ │ │ │ ├── .gitignore
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── pytorch/
│ │ │ │ │ │ ├── prroi_pool/
│ │ │ │ │ │ │ ├── .gitignore
│ │ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ │ ├── functional.py
│ │ │ │ │ │ │ ├── prroi_pool.py
│ │ │ │ │ │ │ └── src/
│ │ │ │ │ │ │ ├── prroi_pooling_gpu.c
│ │ │ │ │ │ │ ├── prroi_pooling_gpu.h
│ │ │ │ │ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ │ │ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ │ │ │ │ └── tests/
│ │ │ │ │ │ └── test_prroi_pooling2d.py
│ │ │ │ │ └── src/
│ │ │ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ │ │ ├── models/
│ │ │ │ │ ├── AR_seg_mask/
│ │ │ │ │ │ ├── AR_seg_mask.py
│ │ │ │ │ │ └── __init__.py
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── backbone/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── base.py
│ │ │ │ │ │ ├── resnet.py
│ │ │ │ │ │ ├── resnet18_vggm.py
│ │ │ │ │ │ └── resnet_seg.py
│ │ │ │ │ ├── bbreg/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── atom.py
│ │ │ │ │ │ └── atom_iou_net.py
│ │ │ │ │ ├── head/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── seg_network.py
│ │ │ │ │ │ └── utils.py
│ │ │ │ │ ├── layers/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── activation.py
│ │ │ │ │ │ ├── blocks.py
│ │ │ │ │ │ ├── distance.py
│ │ │ │ │ │ ├── filter.py
│ │ │ │ │ │ ├── normalization.py
│ │ │ │ │ │ └── transform.py
│ │ │ │ │ ├── loss/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── kl_regression.py
│ │ │ │ │ │ └── target_classification.py
│ │ │ │ │ ├── meta/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ └── steepestdescent.py
│ │ │ │ │ ├── neck/
│ │ │ │ │ │ ├── CorrNL.py
│ │ │ │ │ │ └── neck_utils.py
│ │ │ │ │ ├── target_classifier/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── features.py
│ │ │ │ │ │ ├── initializer.py
│ │ │ │ │ │ ├── linear_filter.py
│ │ │ │ │ │ ├── optimizer.py
│ │ │ │ │ │ └── residual_modules.py
│ │ │ │ │ └── tracking/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── dimpnet.py
│ │ │ │ ├── run_training.py
│ │ │ │ ├── train_settings/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── bbreg/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── atom.py
│ │ │ │ │ │ ├── atom_gmm_sampl.py
│ │ │ │ │ │ ├── atom_paper.py
│ │ │ │ │ │ └── atom_prob_ml.py
│ │ │ │ │ └── dimp/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── dimp18.py
│ │ │ │ │ ├── dimp50.py
│ │ │ │ │ ├── prdimp18.py
│ │ │ │ │ ├── prdimp50.py
│ │ │ │ │ └── super_dimp.py
│ │ │ │ └── trainers/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base_trainer.py
│ │ │ │ └── ltr_trainer.py
│ │ │ └── pytracking/
│ │ │ ├── ARcm_seg.py
│ │ │ ├── VOT/
│ │ │ │ ├── tracker_DiMP.m
│ │ │ │ ├── trackers.ini
│ │ │ │ └── vot.py
│ │ │ ├── VOT2020_super_only_mask_384_HP/
│ │ │ │ ├── dimp_alpha_065.py
│ │ │ │ ├── dimp_alpha_seg_class.py
│ │ │ │ ├── mixformer_alpha_seg_class.py
│ │ │ │ ├── mixformer_large_alpha_seg_class.py
│ │ │ │ └── vot.py
│ │ │ ├── __init__.py
│ │ │ ├── analysis/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── evaluate_vos.py
│ │ │ │ ├── extract_results.py
│ │ │ │ ├── playback_results.py
│ │ │ │ ├── plot_results.py
│ │ │ │ └── vos_utils.py
│ │ │ ├── evaluation/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── data.py
│ │ │ │ ├── datasets.py
│ │ │ │ ├── environment.py
│ │ │ │ ├── got10kdataset.py
│ │ │ │ ├── lasotdataset.py
│ │ │ │ ├── mobifacedataset.py
│ │ │ │ ├── multi_object_wrapper.py
│ │ │ │ ├── nfsdataset.py
│ │ │ │ ├── otbdataset.py
│ │ │ │ ├── running.py
│ │ │ │ ├── tpldataset.py
│ │ │ │ ├── tracker.py
│ │ │ │ ├── trackingnetdataset.py
│ │ │ │ ├── uavdataset.py
│ │ │ │ ├── vot.py
│ │ │ │ ├── vot2020.py
│ │ │ │ └── votdataset.py
│ │ │ ├── experiments/
│ │ │ │ ├── __init__.py
│ │ │ │ └── myexperiments.py
│ │ │ ├── features/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── augmentation.py
│ │ │ │ ├── color.py
│ │ │ │ ├── deep.py
│ │ │ │ ├── extractor.py
│ │ │ │ ├── featurebase.py
│ │ │ │ ├── net_wrappers.py
│ │ │ │ ├── preprocessing.py
│ │ │ │ └── util.py
│ │ │ ├── libs/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── complex.py
│ │ │ │ ├── dcf.py
│ │ │ │ ├── fourier.py
│ │ │ │ ├── operation.py
│ │ │ │ ├── optimization.py
│ │ │ │ ├── tensordict.py
│ │ │ │ └── tensorlist.py
│ │ │ ├── parameter/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── atom/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── atom_gmm_sampl.py
│ │ │ │ │ ├── atom_prob_ml.py
│ │ │ │ │ ├── default.py
│ │ │ │ │ ├── default_vot.py
│ │ │ │ │ └── multiscale_no_iounet.py
│ │ │ │ ├── dimp/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── dimp18.py
│ │ │ │ │ ├── dimp18_vot.py
│ │ │ │ │ ├── dimp50.py
│ │ │ │ │ ├── dimp50_vot.py
│ │ │ │ │ ├── dimp50_vot19.py
│ │ │ │ │ ├── prdimp18.py
│ │ │ │ │ ├── prdimp50.py
│ │ │ │ │ └── super_dimp.py
│ │ │ │ └── eco/
│ │ │ │ ├── __init__.py
│ │ │ │ └── default.py
│ │ │ ├── tracker/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── atom/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── atom.py
│ │ │ │ │ └── optim.py
│ │ │ │ ├── base/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── basetracker.py
│ │ │ │ ├── dimp/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── dimp.py
│ │ │ │ └── eco/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── eco.py
│ │ │ │ └── optim.py
│ │ │ ├── util_scripts/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── download_results.py
│ │ │ │ ├── pack_got10k_results.py
│ │ │ │ └── pack_trackingnet_results.py
│ │ │ ├── utils/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── convert_vot_anno_to_rect.py
│ │ │ │ ├── load_text.py
│ │ │ │ ├── loading.py
│ │ │ │ ├── params.py
│ │ │ │ ├── plotting.py
│ │ │ │ └── visdom.py
│ │ │ └── vot20_utils.py
│ │ ├── PreciseRoIPooling/
│ │ │ ├── .gitignore
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── pytorch/
│ │ │ │ ├── prroi_pool/
│ │ │ │ │ ├── .gitignore
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── functional.py
│ │ │ │ │ ├── prroi_pool.py
│ │ │ │ │ └── src/
│ │ │ │ │ ├── prroi_pooling_gpu.c
│ │ │ │ │ ├── prroi_pooling_gpu.h
│ │ │ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ │ │ └── tests/
│ │ │ │ └── test_prroi_pooling2d.py
│ │ │ └── src/
│ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ └── vot20/
│ │ └── cttrack/
│ │ ├── config.yaml
│ │ └── trackers.ini
│ ├── lib/
│ │ ├── __init__.py
│ │ ├── config/
│ │ │ ├── __init__.py
│ │ │ └── ostrack/
│ │ │ └── config.py
│ │ ├── models/
│ │ │ ├── __init__.py
│ │ │ ├── component/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── attention.py
│ │ │ │ ├── block.py
│ │ │ │ ├── drop.py
│ │ │ │ ├── mlp.py
│ │ │ │ ├── norm.py
│ │ │ │ ├── patch_embed.py
│ │ │ │ ├── pos_embed.py
│ │ │ │ └── weight_init.py
│ │ │ ├── layers/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── attn.py
│ │ │ │ ├── attn_blocks.py
│ │ │ │ ├── head.py
│ │ │ │ ├── mask_decoder.py
│ │ │ │ ├── patch_embed.py
│ │ │ │ ├── rpe.py
│ │ │ │ └── self_practice.py
│ │ │ ├── ostrack/
│ │ │ │ ├── Vit_model_test.py
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base_backbone.py
│ │ │ │ ├── load_parameter_test.py
│ │ │ │ ├── ostrack.py
│ │ │ │ ├── ostrack_test.py
│ │ │ │ ├── utils.py
│ │ │ │ ├── vit.py
│ │ │ │ └── vit_ce.py
│ │ │ └── timm.py
│ │ ├── train/
│ │ │ ├── __init__.py
│ │ │ ├── _init_paths.py
│ │ │ ├── actors/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base_actor.py
│ │ │ │ └── ostrack.py
│ │ │ ├── admin/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── environment.py
│ │ │ │ ├── local.py
│ │ │ │ ├── settings.py
│ │ │ │ ├── stats.py
│ │ │ │ └── tensorboard.py
│ │ │ ├── base_functions.py
│ │ │ ├── data/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── bounding_box_utils.py
│ │ │ │ ├── image_loader.py
│ │ │ │ ├── loader.py
│ │ │ │ ├── processing.py
│ │ │ │ ├── processing_utils.py
│ │ │ │ ├── sampler.py
│ │ │ │ ├── sequence_sampler.py
│ │ │ │ ├── transforms.py
│ │ │ │ └── wandb_logger.py
│ │ │ ├── data_specs/
│ │ │ │ ├── README.md
│ │ │ │ ├── got10k_train_full_split.txt
│ │ │ │ ├── got10k_train_split.txt
│ │ │ │ ├── got10k_val_split.txt
│ │ │ │ ├── got10k_vot_exclude.txt
│ │ │ │ ├── got10k_vot_train_split.txt
│ │ │ │ ├── got10k_vot_val_split.txt
│ │ │ │ ├── lasot_train_split.txt
│ │ │ │ └── trackingnet_classmap.txt
│ │ │ ├── dataset/
│ │ │ │ ├── COCO_tool.py
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base_image_dataset.py
│ │ │ │ ├── base_video_dataset.py
│ │ │ │ ├── coco.py
│ │ │ │ ├── coco_seq.py
│ │ │ │ ├── coco_seq_lmdb.py
│ │ │ │ ├── got10k.py
│ │ │ │ ├── got10k_lmdb.py
│ │ │ │ ├── imagenetvid.py
│ │ │ │ ├── imagenetvid_lmdb.py
│ │ │ │ ├── lasot.py
│ │ │ │ ├── lasot_lmdb.py
│ │ │ │ ├── tracking_net.py
│ │ │ │ └── tracking_net_lmdb.py
│ │ │ ├── run_training.py
│ │ │ ├── train_script.py
│ │ │ ├── train_script_distill.py
│ │ │ └── trainers/
│ │ │ ├── __init__.py
│ │ │ ├── base_trainer.py
│ │ │ └── ltr_trainer.py
│ │ ├── utils/
│ │ │ ├── __init__.py
│ │ │ ├── box_ops.py
│ │ │ ├── ce_utils.py
│ │ │ ├── focal_loss.py
│ │ │ ├── heapmap_utils.py
│ │ │ ├── image.py
│ │ │ ├── lmdb_utils.py
│ │ │ ├── merge.py
│ │ │ ├── misc.py
│ │ │ ├── tensor.py
│ │ │ └── variable_hook.py
│ │ └── vis/
│ │ ├── __init__.py
│ │ ├── plotting.py
│ │ └── utils.py
│ └── tracking/
│ ├── _init_paths.py
│ ├── analysis_results.ipynb
│ ├── analysis_results.py
│ ├── analysis_results_ITP.py
│ ├── convert_transt.py
│ ├── create_default_local_file.py
│ ├── download_pytracking_results.py
│ ├── pre_read_datasets.py
│ ├── profile_model.py
│ ├── test.py
│ ├── test_exp.py
│ ├── train.py
│ ├── video_demo.py
│ └── vis_results.py
├── experiments/
│ ├── artrack/
│ │ ├── artrack_256_full.yaml
│ │ ├── artrack_256_got.yaml
│ │ ├── artrack_384_full.yaml
│ │ └── artrack_large_384_full.yaml
│ ├── artrack_seq/
│ │ ├── artrack_seq_256_full.yaml
│ │ ├── artrack_seq_256_got.yaml
│ │ ├── artrack_seq_384_full.yaml
│ │ └── artrack_seq_large_384_full.yaml
│ ├── artrackv2/
│ │ ├── artrackv2_256_full.yaml
│ │ ├── artrackv2_256_got.yaml
│ │ └── artrackv2_large_384_got.yaml
│ └── artrackv2_seq/
│ ├── artrackv2_seq_256_full.yaml
│ ├── artrackv2_seq_256_got.yaml
│ └── artrackv2_seq_large_384_got.yaml
├── external/
│ ├── AR/
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── ltr/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── actors/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base_actor.py
│ │ │ │ ├── bbreg.py
│ │ │ │ └── tracking.py
│ │ │ ├── admin/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── environment.py
│ │ │ │ ├── loading.py
│ │ │ │ ├── model_constructor.py
│ │ │ │ ├── multigpu.py
│ │ │ │ ├── settings.py
│ │ │ │ ├── stats.py
│ │ │ │ └── tensorboard.py
│ │ │ ├── data/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── bounding_box_utils.py
│ │ │ │ ├── image_loader.py
│ │ │ │ ├── loader.py
│ │ │ │ ├── processing.py
│ │ │ │ ├── processing_utils.py
│ │ │ │ ├── processing_utils_SE.py
│ │ │ │ ├── sampler.py
│ │ │ │ └── transforms.py
│ │ │ ├── dataset/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base_image_dataset.py
│ │ │ │ ├── base_video_dataset.py
│ │ │ │ ├── coco.py
│ │ │ │ ├── coco_seq.py
│ │ │ │ ├── davis.py
│ │ │ │ ├── ecssd.py
│ │ │ │ ├── got10k.py
│ │ │ │ ├── hku_is.py
│ │ │ │ ├── imagenetvid.py
│ │ │ │ ├── lasot.py
│ │ │ │ ├── lvis.py
│ │ │ │ ├── msra10k.py
│ │ │ │ ├── sbd.py
│ │ │ │ ├── synthetic_video.py
│ │ │ │ ├── synthetic_video_blend.py
│ │ │ │ ├── tracking_net.py
│ │ │ │ ├── vos_base.py
│ │ │ │ └── youtubevos.py
│ │ │ ├── external/
│ │ │ │ └── PreciseRoIPooling/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── LICENSE
│ │ │ │ ├── README.md
│ │ │ │ ├── pytorch/
│ │ │ │ │ ├── prroi_pool/
│ │ │ │ │ │ ├── .gitignore
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── functional.py
│ │ │ │ │ │ ├── prroi_pool.py
│ │ │ │ │ │ └── src/
│ │ │ │ │ │ ├── prroi_pooling_gpu.c
│ │ │ │ │ │ ├── prroi_pooling_gpu.h
│ │ │ │ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ │ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ │ │ │ └── tests/
│ │ │ │ │ └── test_prroi_pooling2d.py
│ │ │ │ └── src/
│ │ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ │ ├── models/
│ │ │ │ ├── AR_seg_mask/
│ │ │ │ │ ├── AR_seg_mask.py
│ │ │ │ │ └── __init__.py
│ │ │ │ ├── __init__.py
│ │ │ │ ├── backbone/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── base.py
│ │ │ │ │ ├── resnet.py
│ │ │ │ │ ├── resnet18_vggm.py
│ │ │ │ │ └── resnet_seg.py
│ │ │ │ ├── bbreg/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── atom.py
│ │ │ │ │ └── atom_iou_net.py
│ │ │ │ ├── head/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── seg_network.py
│ │ │ │ │ └── utils.py
│ │ │ │ ├── layers/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── activation.py
│ │ │ │ │ ├── blocks.py
│ │ │ │ │ ├── distance.py
│ │ │ │ │ ├── filter.py
│ │ │ │ │ ├── normalization.py
│ │ │ │ │ └── transform.py
│ │ │ │ ├── loss/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── kl_regression.py
│ │ │ │ │ └── target_classification.py
│ │ │ │ ├── meta/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── steepestdescent.py
│ │ │ │ ├── neck/
│ │ │ │ │ ├── CorrNL.py
│ │ │ │ │ └── neck_utils.py
│ │ │ │ ├── target_classifier/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── features.py
│ │ │ │ │ ├── initializer.py
│ │ │ │ │ ├── linear_filter.py
│ │ │ │ │ ├── optimizer.py
│ │ │ │ │ └── residual_modules.py
│ │ │ │ └── tracking/
│ │ │ │ ├── __init__.py
│ │ │ │ └── dimpnet.py
│ │ │ ├── run_training.py
│ │ │ ├── train_settings/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── bbreg/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── atom.py
│ │ │ │ │ ├── atom_gmm_sampl.py
│ │ │ │ │ ├── atom_paper.py
│ │ │ │ │ └── atom_prob_ml.py
│ │ │ │ └── dimp/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── dimp18.py
│ │ │ │ ├── dimp50.py
│ │ │ │ ├── prdimp18.py
│ │ │ │ ├── prdimp50.py
│ │ │ │ └── super_dimp.py
│ │ │ └── trainers/
│ │ │ ├── __init__.py
│ │ │ ├── base_trainer.py
│ │ │ └── ltr_trainer.py
│ │ └── pytracking/
│ │ ├── ARcm_seg.py
│ │ ├── VOT/
│ │ │ ├── tracker_DiMP.m
│ │ │ ├── trackers.ini
│ │ │ └── vot.py
│ │ ├── VOT2020_super_only_mask_384_HP/
│ │ │ ├── dimp_alpha_065.py
│ │ │ ├── dimp_alpha_seg_class.py
│ │ │ ├── mixformer_alpha_seg_class.py
│ │ │ ├── mixformer_large_alpha_seg_class.py
│ │ │ └── vot.py
│ │ ├── __init__.py
│ │ ├── analysis/
│ │ │ ├── __init__.py
│ │ │ ├── evaluate_vos.py
│ │ │ ├── extract_results.py
│ │ │ ├── playback_results.py
│ │ │ ├── plot_results.py
│ │ │ └── vos_utils.py
│ │ ├── evaluation/
│ │ │ ├── __init__.py
│ │ │ ├── data.py
│ │ │ ├── datasets.py
│ │ │ ├── environment.py
│ │ │ ├── got10kdataset.py
│ │ │ ├── lasotdataset.py
│ │ │ ├── mobifacedataset.py
│ │ │ ├── multi_object_wrapper.py
│ │ │ ├── nfsdataset.py
│ │ │ ├── otbdataset.py
│ │ │ ├── running.py
│ │ │ ├── tpldataset.py
│ │ │ ├── tracker.py
│ │ │ ├── trackingnetdataset.py
│ │ │ ├── uavdataset.py
│ │ │ ├── vot.py
│ │ │ ├── vot2020.py
│ │ │ └── votdataset.py
│ │ ├── experiments/
│ │ │ ├── __init__.py
│ │ │ └── myexperiments.py
│ │ ├── features/
│ │ │ ├── __init__.py
│ │ │ ├── augmentation.py
│ │ │ ├── color.py
│ │ │ ├── deep.py
│ │ │ ├── extractor.py
│ │ │ ├── featurebase.py
│ │ │ ├── net_wrappers.py
│ │ │ ├── preprocessing.py
│ │ │ └── util.py
│ │ ├── libs/
│ │ │ ├── __init__.py
│ │ │ ├── complex.py
│ │ │ ├── dcf.py
│ │ │ ├── fourier.py
│ │ │ ├── operation.py
│ │ │ ├── optimization.py
│ │ │ ├── tensordict.py
│ │ │ └── tensorlist.py
│ │ ├── parameter/
│ │ │ ├── __init__.py
│ │ │ ├── atom/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── atom_gmm_sampl.py
│ │ │ │ ├── atom_prob_ml.py
│ │ │ │ ├── default.py
│ │ │ │ ├── default_vot.py
│ │ │ │ └── multiscale_no_iounet.py
│ │ │ ├── dimp/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── dimp18.py
│ │ │ │ ├── dimp18_vot.py
│ │ │ │ ├── dimp50.py
│ │ │ │ ├── dimp50_vot.py
│ │ │ │ ├── dimp50_vot19.py
│ │ │ │ ├── prdimp18.py
│ │ │ │ ├── prdimp50.py
│ │ │ │ └── super_dimp.py
│ │ │ └── eco/
│ │ │ ├── __init__.py
│ │ │ └── default.py
│ │ ├── tracker/
│ │ │ ├── __init__.py
│ │ │ ├── atom/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── atom.py
│ │ │ │ └── optim.py
│ │ │ ├── base/
│ │ │ │ ├── __init__.py
│ │ │ │ └── basetracker.py
│ │ │ ├── dimp/
│ │ │ │ ├── __init__.py
│ │ │ │ └── dimp.py
│ │ │ └── eco/
│ │ │ ├── __init__.py
│ │ │ ├── eco.py
│ │ │ └── optim.py
│ │ ├── util_scripts/
│ │ │ ├── __init__.py
│ │ │ ├── download_results.py
│ │ │ ├── pack_got10k_results.py
│ │ │ └── pack_trackingnet_results.py
│ │ ├── utils/
│ │ │ ├── __init__.py
│ │ │ ├── convert_vot_anno_to_rect.py
│ │ │ ├── load_text.py
│ │ │ ├── loading.py
│ │ │ ├── params.py
│ │ │ ├── plotting.py
│ │ │ └── visdom.py
│ │ └── vot20_utils.py
│ ├── PreciseRoIPooling/
│ │ ├── .gitignore
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── pytorch/
│ │ │ ├── prroi_pool/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── __init__.py
│ │ │ │ ├── functional.py
│ │ │ │ ├── prroi_pool.py
│ │ │ │ └── src/
│ │ │ │ ├── prroi_pooling_gpu.c
│ │ │ │ ├── prroi_pooling_gpu.h
│ │ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ │ └── tests/
│ │ │ └── test_prroi_pooling2d.py
│ │ └── src/
│ │ ├── prroi_pooling_gpu_impl.cu
│ │ └── prroi_pooling_gpu_impl.cuh
│ └── vot20/
│ └── cttrack/
│ ├── config.yaml
│ └── trackers.ini
├── lib/
│ ├── __init__.py
│ ├── config/
│ │ ├── __init__.py
│ │ ├── artrack/
│ │ │ └── config.py
│ │ ├── artrack_seq/
│ │ │ └── config.py
│ │ ├── artrackv2/
│ │ │ └── config.py
│ │ └── artrackv2_seq/
│ │ └── config.py
│ ├── models/
│ │ ├── __init__.py
│ │ ├── artrack/
│ │ │ ├── __init__.py
│ │ │ ├── artrack.py
│ │ │ ├── base_backbone.py
│ │ │ ├── utils.py
│ │ │ ├── vit.py
│ │ │ └── vit_ce.py
│ │ ├── artrack_seq/
│ │ │ ├── __init__.py
│ │ │ ├── artrack_seq.py
│ │ │ ├── base_backbone.py
│ │ │ ├── utils.py
│ │ │ ├── vit.py
│ │ │ └── vit_ce.py
│ │ ├── artrackv2/
│ │ │ ├── __init__.py
│ │ │ ├── artrackv2.py
│ │ │ ├── base_backbone.py
│ │ │ ├── utils.py
│ │ │ └── vit.py
│ │ ├── artrackv2_seq/
│ │ │ ├── __init__.py
│ │ │ ├── artrackv2_seq.py
│ │ │ ├── base_backbone.py
│ │ │ ├── utils.py
│ │ │ └── vit.py
│ │ ├── layers/
│ │ │ ├── __init__.py
│ │ │ ├── attn.py
│ │ │ ├── attn_blocks.py
│ │ │ ├── frozen_bn.py
│ │ │ ├── head.py
│ │ │ ├── head_seq.py
│ │ │ ├── mask_decoder.py
│ │ │ ├── patch_embed.py
│ │ │ └── rpe.py
│ │ └── mask_decoder/
│ │ ├── __init__.py
│ │ ├── attention.py
│ │ ├── block.py
│ │ ├── drop.py
│ │ ├── mlp.py
│ │ ├── norm.py
│ │ ├── patch_embed.py
│ │ ├── pos_embed.py
│ │ └── weight_init.py
│ ├── test/
│ │ ├── __init__.py
│ │ ├── analysis/
│ │ │ ├── __init__.py
│ │ │ ├── extract_results.py
│ │ │ └── plot_results.py
│ │ ├── evaluation/
│ │ │ ├── __init__.py
│ │ │ ├── data.py
│ │ │ ├── datasets.py
│ │ │ ├── environment.py
│ │ │ ├── got10kdataset.py
│ │ │ ├── itbdataset.py
│ │ │ ├── lasot_lmdbdataset.py
│ │ │ ├── lasotdataset.py
│ │ │ ├── lasotextensionsubsetdataset.py
│ │ │ ├── local.py
│ │ │ ├── nfsdataset.py
│ │ │ ├── otbdataset.py
│ │ │ ├── running.py
│ │ │ ├── tc128cedataset.py
│ │ │ ├── tc128dataset.py
│ │ │ ├── tnl2kdataset.py
│ │ │ ├── tracker.py
│ │ │ ├── trackingnetdataset.py
│ │ │ ├── uavdataset.py
│ │ │ └── votdataset.py
│ │ ├── parameter/
│ │ │ ├── __init__.py
│ │ │ ├── artrack.py
│ │ │ ├── artrack_seq.py
│ │ │ ├── artrackv2.py
│ │ │ └── artrackv2_seq.py
│ │ ├── tracker/
│ │ │ ├── __init__.py
│ │ │ ├── artrack.py
│ │ │ ├── artrack_seq.py
│ │ │ ├── artrackv2.py
│ │ │ ├── artrackv2_seq.py
│ │ │ ├── basetracker.py
│ │ │ ├── data_utils.py
│ │ │ └── vis_utils.py
│ │ └── utils/
│ │ ├── __init__.py
│ │ ├── _init_paths.py
│ │ ├── hann.py
│ │ ├── load_text.py
│ │ ├── params.py
│ │ ├── transform_got10k.py
│ │ └── transform_trackingnet.py
│ ├── train/
│ │ ├── __init__.py
│ │ ├── _init_paths.py
│ │ ├── actors/
│ │ │ ├── __init__.py
│ │ │ ├── artrack.py
│ │ │ ├── artrack_seq.py
│ │ │ ├── artrackv2.py
│ │ │ ├── artrackv2_seq.py
│ │ │ └── base_actor.py
│ │ ├── admin/
│ │ │ ├── __init__.py
│ │ │ ├── environment.py
│ │ │ ├── local.py
│ │ │ ├── multigpu.py
│ │ │ ├── settings.py
│ │ │ ├── stats.py
│ │ │ └── tensorboard.py
│ │ ├── base_functions.py
│ │ ├── data/
│ │ │ ├── __init__.py
│ │ │ ├── bounding_box_utils.py
│ │ │ ├── image_loader.py
│ │ │ ├── loader.py
│ │ │ ├── processing.py
│ │ │ ├── processing_utils.py
│ │ │ ├── sampler.py
│ │ │ ├── sequence_sampler.py
│ │ │ ├── sequence_sampler_v2.py
│ │ │ ├── transforms.py
│ │ │ └── wandb_logger.py
│ │ ├── data_specs/
│ │ │ ├── README.md
│ │ │ ├── got10k_train_full_split.txt
│ │ │ ├── got10k_train_split.txt
│ │ │ ├── got10k_val_split.txt
│ │ │ ├── got10k_vot_exclude.txt
│ │ │ ├── got10k_vot_train_split.txt
│ │ │ ├── got10k_vot_val_split.txt
│ │ │ ├── lasot_train_split.txt
│ │ │ └── trackingnet_classmap.txt
│ │ ├── dataset/
│ │ │ ├── COCO_tool.py
│ │ │ ├── __init__.py
│ │ │ ├── base_image_dataset.py
│ │ │ ├── base_video_dataset.py
│ │ │ ├── coco.py
│ │ │ ├── coco_seq.py
│ │ │ ├── coco_seq_lmdb.py
│ │ │ ├── got10k.py
│ │ │ ├── got10k_lmdb.py
│ │ │ ├── imagenetvid.py
│ │ │ ├── imagenetvid_lmdb.py
│ │ │ ├── lasot.py
│ │ │ ├── lasot_lmdb.py
│ │ │ ├── tracking_net.py
│ │ │ └── tracking_net_lmdb.py
│ │ ├── run_training.py
│ │ ├── train_script.py
│ │ ├── train_script_distill.py
│ │ └── trainers/
│ │ ├── __init__.py
│ │ ├── base_trainer.py
│ │ ├── ltr_seq_trainer.py
│ │ ├── ltr_seq_trainer_v2.py
│ │ └── ltr_trainer.py
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── box_ops.py
│ │ ├── ce_utils.py
│ │ ├── focal_loss.py
│ │ ├── heapmap_utils.py
│ │ ├── image.py
│ │ ├── lmdb_utils.py
│ │ ├── merge.py
│ │ ├── misc.py
│ │ ├── tensor.py
│ │ └── variable_hook.py
│ └── vis/
│ ├── __init__.py
│ ├── plotting.py
│ ├── utils.py
│ └── visdom_cus.py
└── tracking/
├── _init_paths.py
├── analysis_results.py
├── analysis_results_ITP.py
├── convert_transt.py
├── create_default_local_file.py
├── download_pytracking_results.py
├── pre_read_datasets.py
├── test.py
├── test_exp.py
└── train.py
================================================
FILE CONTENTS
================================================
================================================
FILE: ARTrack_env_cuda113.yaml
================================================
name: artrack
channels:
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- defaults
dependencies:
- ca-certificates=2021.10.8=ha878542_0
- certifi=2021.10.8=py39hf3d152e_2
- fvcore=0.1.5.post20220305=pyhd8ed1ab_0
- portalocker=2.4.0=py39hf3d152e_0
- python_abi=3.9=2_cp39
- tabulate=0.8.9=pyhd8ed1ab_0
- termcolor=1.1.0=py_2
- yacs=0.1.8=pyhd8ed1ab_0
- ffmpeg=4.3=hf484d3e_0
- pytorch=1.11.0=py3.9_cuda11.3_cudnn8.2.0_0
- pytorch-mutex=1.0=cuda
- torchvision=0.12.0=py39_cu113
- _anaconda_depends=2021.11=py39_0
- _libgcc_mutex=0.1=main
- _openmp_mutex=4.5=1_gnu
- alabaster=0.7.12=pyhd3eb1b0_0
- anaconda-client=1.9.0=py39h06a4308_0
- anaconda=custom=py39_1
- anaconda-project=0.10.2=pyhd3eb1b0_0
- anyio=3.5.0=py39h06a4308_0
- appdirs=1.4.4=pyhd3eb1b0_0
- argh=0.26.2=py39h06a4308_0
- argon2-cffi=21.3.0=pyhd3eb1b0_0
- argon2-cffi-bindings=21.2.0=py39h7f8727e_0
- arrow=0.13.1=py39h06a4308_0
- asn1crypto=1.4.0=py_0
- astroid=2.6.6=py39h06a4308_0
- astropy=5.0.3=py39hce1f21e_0
- asttokens=2.0.5=pyhd3eb1b0_0
- async_generator=1.10=pyhd3eb1b0_0
- atomicwrites=1.4.0=py_0
- attrs=21.4.0=pyhd3eb1b0_0
- autopep8=1.6.0=pyhd3eb1b0_0
- babel=2.9.1=pyhd3eb1b0_0
- backcall=0.2.0=pyhd3eb1b0_0
- backports=1.1=pyhd3eb1b0_0
- backports.shutil_get_terminal_size=1.0.0=pyhd3eb1b0_3
- beautifulsoup4=4.10.0=pyh06a4308_0
- binaryornot=0.4.4=pyhd3eb1b0_1
- bitarray=2.4.1=py39h7f8727e_0
- bkcharts=0.2=py39h06a4308_0
- black=19.10b0=py_0
- blas=1.0=mkl
- bleach=4.1.0=pyhd3eb1b0_0
- blosc=1.21.0=h8c45485_0
- bokeh=2.4.2=py39h06a4308_0
- boto=2.49.0=py39h06a4308_0
- bottleneck=1.3.4=py39hce1f21e_0
- brotli=1.0.9=he6710b0_2
- brotlipy=0.7.0=py39h27cfd23_1003
- brunsli=0.1=h2531618_0
- bzip2=1.0.8=h7b6447c_0
- c-ares=1.18.1=h7f8727e_0
- cached-property=1.5.2=py_0
- cairo=1.16.0=hf32fb01_1
- cffi=1.15.0=py39hd667e15_1
- cfitsio=3.470=hf0d0db6_6
- chardet=4.0.0=py39h06a4308_1003
- charls=2.2.0=h2531618_0
- charset-normalizer=2.0.4=pyhd3eb1b0_0
- click=8.0.4=py39h06a4308_0
- cloudpickle=2.0.0=pyhd3eb1b0_0
- clyent=1.2.2=py39h06a4308_1
- colorama=0.4.4=pyhd3eb1b0_0
- conda=4.12.0=py39h06a4308_0
- conda-content-trust=0.1.1=pyhd3eb1b0_0
- conda-pack=0.6.0=pyhd3eb1b0_0
- conda-package-handling=1.8.0=py39h7f8727e_0
- conda-token=0.3.0=pyhd3eb1b0_0
- contextlib2=0.6.0.post1=pyhd3eb1b0_0
- cookiecutter=1.7.2=pyhd3eb1b0_0
- cryptography=36.0.0=py39h9ce1e76_0
- cudatoolkit=11.3.1=h2bc3f7f_2
- curl=7.80.0=h7f8727e_0
- cycler=0.11.0=pyhd3eb1b0_0
- cython=0.29.28=py39h295c915_0
- cytoolz=0.11.0=py39h27cfd23_0
- daal4py=2021.5.0=py39h78b71dc_0
- dal=2021.5.1=h06a4308_803
- dask=2022.2.1=pyhd3eb1b0_0
- dask-core=2022.2.1=pyhd3eb1b0_0
- dataclasses=0.8=pyh6d0b6a4_7
- dbus=1.13.18=hb2f20db_0
- debugpy=1.5.1=py39h295c915_0
- decorator=5.1.1=pyhd3eb1b0_0
- defusedxml=0.7.1=pyhd3eb1b0_0
- diff-match-patch=20200713=pyhd3eb1b0_0
- distributed=2022.2.1=pyhd3eb1b0_0
- docutils=0.17.1=py39h06a4308_1
- entrypoints=0.3=py39h06a4308_0
- et_xmlfile=1.1.0=py39h06a4308_0
- executing=0.8.3=pyhd3eb1b0_0
- expat=2.4.4=h295c915_0
- fastcache=1.1.0=py39he8ac12f_0
- filelock=3.6.0=pyhd3eb1b0_0
- flake8=3.9.2=pyhd3eb1b0_0
- flask=1.1.2=pyhd3eb1b0_0
- fontconfig=2.13.1=h6c09931_0
- fonttools=4.25.0=pyhd3eb1b0_0
- freetype=2.11.0=h70c0345_0
- fribidi=1.0.10=h7b6447c_0
- fsspec=2022.2.0=pyhd3eb1b0_0
- get_terminal_size=1.0.0=haa9412d_0
- gevent=21.8.0=py39h7f8727e_1
- giflib=5.2.1=h7b6447c_0
- glib=2.69.1=h4ff587b_1
- glob2=0.7=pyhd3eb1b0_0
- gmp=6.2.1=h2531618_2
- gmpy2=2.1.2=py39heeb90bb_0
- gnutls=3.6.15=he1e5248_0
- graphite2=1.3.14=h23475e2_0
- greenlet=1.1.1=py39h295c915_0
- gst-plugins-base=1.14.0=h8213a91_2
- gstreamer=1.14.0=h28cd5cc_2
- h5py=3.6.0=py39ha0f2276_0
- harfbuzz=2.8.1=h6f93f22_0
- hdf5=1.10.6=hb1b8bf9_0
- heapdict=1.0.1=pyhd3eb1b0_0
- html5lib=1.1=pyhd3eb1b0_0
- icu=58.2=he6710b0_3
- idna=3.3=pyhd3eb1b0_0
- imagecodecs=2021.8.26=py39h4cda21f_0
- imageio=2.9.0=pyhd3eb1b0_0
- imagesize=1.3.0=pyhd3eb1b0_0
- importlib-metadata=4.11.3=py39h06a4308_0
- importlib_metadata=4.11.3=hd3eb1b0_0
- inflection=0.5.1=py39h06a4308_0
- iniconfig=1.1.1=pyhd3eb1b0_0
- intel-openmp=2021.4.0=h06a4308_3561
- intervaltree=3.1.0=pyhd3eb1b0_0
- ipykernel=6.9.1=py39h06a4308_0
- ipython=8.1.1=py39h06a4308_0
- ipython_genutils=0.2.0=pyhd3eb1b0_1
- ipywidgets=7.6.5=pyhd3eb1b0_1
- isort=5.9.3=pyhd3eb1b0_0
- itsdangerous=2.0.1=pyhd3eb1b0_0
- jbig=2.1=hdba287a_0
- jdcal=1.4.1=pyhd3eb1b0_0
- jedi=0.18.1=py39h06a4308_1
- jeepney=0.7.1=pyhd3eb1b0_0
- jinja2=2.11.3=pyhd3eb1b0_0
- jinja2-time=0.2.0=pyhd3eb1b0_2
- joblib=1.1.0=pyhd3eb1b0_0
- jpeg=9d=h7f8727e_0
- json5=0.9.6=pyhd3eb1b0_0
- jsonschema=3.2.0=pyhd3eb1b0_2
- jupyter=1.0.0=py39h06a4308_7
- jupyter_client=6.1.12=pyhd3eb1b0_0
- jupyter_console=6.4.0=pyhd3eb1b0_0
- jupyter_core=4.9.2=py39h06a4308_0
- jupyter_server=1.13.5=pyhd3eb1b0_0
- jupyterlab=3.3.2=pyhd3eb1b0_0
- jupyterlab_pygments=0.1.2=py_0
- jupyterlab_server=2.10.3=pyhd3eb1b0_1
- jupyterlab_widgets=1.0.0=pyhd3eb1b0_1
- jxrlib=1.1=h7b6447c_2
- keyring=23.4.0=py39h06a4308_0
- kiwisolver=1.3.2=py39h295c915_0
- krb5=1.19.2=hac12032_0
- lame=3.100=h7b6447c_0
- lazy-object-proxy=1.6.0=py39h27cfd23_0
- lcms2=2.12=h3be6417_0
- ld_impl_linux-64=2.35.1=h7274673_9
- lerc=3.0=h295c915_0
- libaec=1.0.4=he6710b0_1
- libarchive=3.4.2=h62408e4_0
- libcurl=7.80.0=h0b77cf5_0
- libdeflate=1.8=h7f8727e_5
- libedit=3.1.20210910=h7f8727e_0
- libev=4.33=h7f8727e_1
- libffi=3.3=he6710b0_2
- libgcc-ng=9.3.0=h5101ec6_17
- libgfortran-ng=7.5.0=ha8ba4b0_17
- libgfortran4=7.5.0=ha8ba4b0_17
- libgomp=9.3.0=h5101ec6_17
- libiconv=1.15=h63c8f33_5
- libidn2=2.3.2=h7f8727e_0
- liblief=0.11.5=h295c915_1
- libllvm11=11.1.0=h3826bc1_1
- libnghttp2=1.46.0=hce63b2e_0
- libpng=1.6.37=hbc83047_0
- libsodium=1.0.18=h7b6447c_0
- libspatialindex=1.9.3=h2531618_0
- libssh2=1.9.0=h1ba5d50_1
- libstdcxx-ng=9.3.0=hd4cf53a_17
- libtasn1=4.16.0=h27cfd23_0
- libtiff=4.2.0=h85742a9_0
- libtool=2.4.6=h295c915_1008
- libunistring=0.9.10=h27cfd23_0
- libuuid=1.0.3=h7f8727e_2
- libuv=1.40.0=h7b6447c_0
- libwebp=1.2.2=h55f646e_0
- libwebp-base=1.2.2=h7f8727e_0
- libxcb=1.14=h7b6447c_0
- libxml2=2.9.12=h03d6c58_0
- libxslt=1.1.34=hc22bd24_0
- libzopfli=1.0.3=he6710b0_0
- llvmlite=0.38.0=py39h4ff587b_0
- locket=0.2.1=py39h06a4308_2
- lxml=4.8.0=py39h1f438cf_0
- lz4-c=1.9.3=h295c915_1
- lzo=2.10=h7b6447c_2
- markupsafe=1.1.1=py39h27cfd23_0
- matplotlib=3.5.1=py39h06a4308_1
- matplotlib-base=3.5.1=py39ha18d171_1
- matplotlib-inline=0.1.2=pyhd3eb1b0_2
- mccabe=0.6.1=py39h06a4308_1
- mistune=0.8.4=py39h27cfd23_1000
- mkl=2021.4.0=h06a4308_640
- mkl-service=2.4.0=py39h7f8727e_0
- mkl_fft=1.3.1=py39hd3c417c_0
- mkl_random=1.2.2=py39h51133e4_0
- mock=4.0.3=pyhd3eb1b0_0
- more-itertools=8.12.0=pyhd3eb1b0_0
- mpc=1.1.0=h10f8cd9_1
- mpfr=4.0.2=hb69a4c5_1
- mpi=1.0=mpich
- mpich=3.3.2=hc856adb_0
- mpmath=1.2.1=py39h06a4308_0
- msgpack-python=1.0.2=py39hff7bd54_1
- multipledispatch=0.6.0=py39h06a4308_0
- munkres=1.1.4=py_0
- mypy_extensions=0.4.3=py39h06a4308_1
- nbclassic=0.3.5=pyhd3eb1b0_0
- nbclient=0.5.11=pyhd3eb1b0_0
- nbconvert=6.3.0=py39h06a4308_0
- nbformat=5.1.3=pyhd3eb1b0_0
- ncurses=6.3=h7f8727e_2
- nest-asyncio=1.5.1=pyhd3eb1b0_0
- nettle=3.7.3=hbbd107a_1
- networkx=2.7.1=pyhd3eb1b0_0
- nltk=3.7=pyhd3eb1b0_0
- nose=1.3.7=pyhd3eb1b0_1008
- notebook=6.4.8=py39h06a4308_0
- numba=0.55.1=py39h51133e4_0
- numexpr=2.8.1=py39h6abb31d_0
- numpy=1.21.2=py39h20f2e39_0
- numpy-base=1.21.2=py39h79a1101_0
- numpydoc=1.2=pyhd3eb1b0_0
- olefile=0.46=pyhd3eb1b0_0
- openh264=2.1.1=h4ff587b_0
- openjpeg=2.4.0=h3ad879b_0
- openpyxl=3.0.9=pyhd3eb1b0_0
- openssl=1.1.1n=h7f8727e_0
- packaging=21.3=pyhd3eb1b0_0
- pandas=1.4.1=py39h295c915_1
- pandocfilters=1.5.0=pyhd3eb1b0_0
- pango=1.45.3=hd140c19_0
- parso=0.8.3=pyhd3eb1b0_0
- partd=1.2.0=pyhd3eb1b0_1
- patchelf=0.13=h295c915_0
- path=16.2.0=pyhd3eb1b0_0
- path.py=12.5.0=hd3eb1b0_0
- pathlib2=2.3.6=py39h06a4308_2
- pathspec=0.7.0=py_0
- patsy=0.5.2=py39h06a4308_1
- pcre=8.45=h295c915_0
- pep8=1.7.1=py39h06a4308_0
- pexpect=4.8.0=pyhd3eb1b0_3
- pickleshare=0.7.5=pyhd3eb1b0_1003
- pillow=9.0.1=py39h22f2fdc_0
- pip=21.2.4=py39h06a4308_0
- pixman=0.40.0=h7f8727e_1
- pkginfo=1.8.2=pyhd3eb1b0_0
- pluggy=1.0.0=py39h06a4308_1
- ply=3.11=py39h06a4308_0
- poyo=0.5.0=pyhd3eb1b0_0
- prometheus_client=0.13.1=pyhd3eb1b0_0
- prompt-toolkit=3.0.20=pyhd3eb1b0_0
- prompt_toolkit=3.0.20=hd3eb1b0_0
- psutil=5.8.0=py39h27cfd23_1
- ptyprocess=0.7.0=pyhd3eb1b0_2
- pure_eval=0.2.2=pyhd3eb1b0_0
- py=1.11.0=pyhd3eb1b0_0
- py-lief=0.11.5=py39h295c915_1
- pycodestyle=2.7.0=pyhd3eb1b0_0
- pycosat=0.6.3=py39h27cfd23_0
- pycparser=2.21=pyhd3eb1b0_0
- pycurl=7.44.1=py39h8f2d780_1
- pydocstyle=6.1.1=pyhd3eb1b0_0
- pyerfa=2.0.0=py39h27cfd23_0
- pyflakes=2.3.1=pyhd3eb1b0_0
- pygments=2.11.2=pyhd3eb1b0_0
- pylint=2.9.6=py39h06a4308_1
- pyls-spyder=0.4.0=pyhd3eb1b0_0
- pyodbc=4.0.32=py39h295c915_1
- pyopenssl=22.0.0=pyhd3eb1b0_0
- pyparsing=3.0.4=pyhd3eb1b0_0
- pyqt=5.9.2=py39h2531618_6
- pyrsistent=0.18.0=py39heee7806_0
- pysocks=1.7.1=py39h06a4308_0
- pytables=3.6.1=py39h77479fe_1
- pytest=6.2.5=py39h06a4308_2
- python=3.9.7=h12debd9_1
- python-dateutil=2.8.2=pyhd3eb1b0_0
- python-libarchive-c=2.9=pyhd3eb1b0_1
- python-lsp-black=1.0.0=pyhd3eb1b0_0
- python-lsp-jsonrpc=1.0.0=pyhd3eb1b0_0
- python-lsp-server=1.2.4=pyhd3eb1b0_0
- python-slugify=5.0.2=pyhd3eb1b0_0
- pytz=2021.3=pyhd3eb1b0_0
- pywavelets=1.3.0=py39h7f8727e_0
- pyxdg=0.27=pyhd3eb1b0_0
- pyyaml=6.0=py39h7f8727e_1
- pyzmq=22.3.0=py39h295c915_2
- qdarkstyle=3.0.2=pyhd3eb1b0_0
- qstylizer=0.1.10=pyhd3eb1b0_0
- qt=5.9.7=h5867ecd_1
- qtawesome=1.0.3=pyhd3eb1b0_0
- qtconsole=5.2.2=pyhd3eb1b0_0
- qtpy=1.11.2=pyhd3eb1b0_0
- readline=8.1.2=h7f8727e_1
- regex=2022.3.15=py39h7f8727e_0
- requests=2.27.1=pyhd3eb1b0_0
- ripgrep=12.1.1=0
- rope=0.22.0=pyhd3eb1b0_0
- rtree=0.9.7=py39h06a4308_1
- ruamel_yaml=0.15.100=py39h27cfd23_0
- scikit-image=0.19.2=py39h51133e4_0
- scikit-learn=1.0.2=py39h51133e4_1
- scikit-learn-intelex=2021.5.0=py39h06a4308_0
- scipy=1.7.3=py39hc147768_0
- seaborn=0.11.2=pyhd3eb1b0_0
- secretstorage=3.3.1=py39h06a4308_0
- send2trash=1.8.0=pyhd3eb1b0_1
- setuptools=58.0.4=py39h06a4308_0
- simplegeneric=0.8.1=py39h06a4308_2
- singledispatch=3.7.0=pyhd3eb1b0_1001
- sip=4.19.13=py39h295c915_0
- six=1.16.0=pyhd3eb1b0_1
- snappy=1.1.8=he6710b0_0
- sniffio=1.2.0=py39h06a4308_1
- snowballstemmer=2.2.0=pyhd3eb1b0_0
- sortedcollections=2.1.0=pyhd3eb1b0_0
- sortedcontainers=2.4.0=pyhd3eb1b0_0
- soupsieve=2.3.1=pyhd3eb1b0_0
- sphinx=4.4.0=pyhd3eb1b0_0
- sphinxcontrib=1.0=py39h06a4308_1
- sphinxcontrib-applehelp=1.0.2=pyhd3eb1b0_0
- sphinxcontrib-devhelp=1.0.2=pyhd3eb1b0_0
- sphinxcontrib-htmlhelp=2.0.0=pyhd3eb1b0_0
- sphinxcontrib-jsmath=1.0.1=pyhd3eb1b0_0
- sphinxcontrib-qthelp=1.0.3=pyhd3eb1b0_0
- sphinxcontrib-serializinghtml=1.1.5=pyhd3eb1b0_0
- sphinxcontrib-websupport=1.2.4=py_0
- spyder=5.1.5=py39h06a4308_1
- spyder-kernels=2.1.3=py39h06a4308_0
- sqlalchemy=1.4.32=py39h7f8727e_0
- sqlite=3.38.2=hc218d9a_0
- stack_data=0.2.0=pyhd3eb1b0_0
- statsmodels=0.13.2=py39h7f8727e_0
- sympy=1.10.1=py39h06a4308_0
- tbb=2021.5.0=hd09550d_0
- tbb4py=2021.5.0=py39hd09550d_0
- tblib=1.7.0=pyhd3eb1b0_0
- terminado=0.13.1=py39h06a4308_0
- testpath=0.5.0=pyhd3eb1b0_0
- text-unidecode=1.3=pyhd3eb1b0_0
- textdistance=4.2.1=pyhd3eb1b0_0
- threadpoolctl=2.2.0=pyh0d69192_0
- three-merge=0.1.1=pyhd3eb1b0_0
- tifffile=2021.7.2=pyhd3eb1b0_2
- tinycss=0.4=pyhd3eb1b0_1002
- tk=8.6.11=h1ccaba5_0
- toml=0.10.2=pyhd3eb1b0_0
- toolz=0.11.2=pyhd3eb1b0_0
- tornado=6.1=py39h27cfd23_0
- tqdm=4.63.0=pyhd3eb1b0_0
- traitlets=5.1.1=pyhd3eb1b0_0
- typed-ast=1.4.3=py39h7f8727e_1
- typing-extensions=4.1.1=hd3eb1b0_0
- typing_extensions=4.1.1=pyh06a4308_0
- tzdata=2022a=hda174b7_0
- ujson=5.1.0=py39h295c915_0
- unicodecsv=0.14.1=py39h06a4308_0
- unidecode=1.2.0=pyhd3eb1b0_0
- unixodbc=2.3.9=h7b6447c_0
- urllib3=1.26.8=pyhd3eb1b0_0
- watchdog=2.1.6=py39h06a4308_0
- wcwidth=0.2.5=pyhd3eb1b0_0
- webencodings=0.5.1=py39h06a4308_1
- websocket-client=0.58.0=py39h06a4308_4
- werkzeug=2.0.3=pyhd3eb1b0_0
- wheel=0.37.1=pyhd3eb1b0_0
- whichcraft=0.6.1=pyhd3eb1b0_0
- widgetsnbextension=3.5.2=py39h06a4308_0
- wrapt=1.12.1=py39he8ac12f_1
- wurlitzer=3.0.2=py39h06a4308_0
- xlrd=2.0.1=pyhd3eb1b0_0
- xlsxwriter=3.0.2=pyhd3eb1b0_0
- xlwt=1.3.0=py39h06a4308_0
- xz=5.2.5=h7b6447c_0
- yaml=0.2.5=h7b6447c_0
- yapf=0.31.0=pyhd3eb1b0_0
- zeromq=4.3.4=h2531618_0
- zfp=0.5.5=h295c915_6
- zict=2.0.0=pyhd3eb1b0_0
- zipp=3.7.0=pyhd3eb1b0_0
- zlib=1.2.11=h7f8727e_4
- zope=1.0=py39h06a4308_1
- zope.event=4.5.0=py39h06a4308_0
- zope.interface=5.4.0=py39h7f8727e_0
- zstd=1.4.9=haebb681_0
- pip:
- astor==0.8.1
- configparser==5.2.0
- data==0.4
- docker-pycreds==0.4.0
- easydict==1.9
- einops==0.4.1
- formulaic==0.5.2
- funcsigs==1.0.2
- future==0.18.2
- gitdb==4.0.9
- gitpython==3.1.27
- interface-meta==1.3.0
- iopath==0.1.9
- jpeg4py==0.1.4
- jsonpatch==1.32
- jsonpointer==2.3
- latex==0.7.0
- libarchive-c==2.9
- linearmodels==4.29
- lmdb==1.3.0
- loguru==0.6.0
- mat73==0.59
- memory-profiler==0.60.0
- msgpack==1.0.2
- ninja==1.11.1
- opencv-python==4.5.5.64
- pathtools==0.1.2
- promise==2.3
- property-cached==1.6.4
- protobuf==3.20.0
- pycocotools==2.0.4
- pyhdfe==0.1.2
- ruamel-yaml-conda==0.15.100
- sentry-sdk==1.5.8
- setproctitle==1.2.2
- setuptools-scm==7.1.0
- shapely==1.8.1.post1
- shortuuid==1.0.8
- shutilwhich==1.1.0
- smmap==5.0.0
- tables==3.6.1
- tempdir==0.7.1
- tensorboardx==2.5.1
- thop==0.1.0.post2207010342
- tikzplotlib==0.10.1
- timm==0.5.4
- tomli==2.0.1
- torch==1.11.0
- torchfile==0.1.0
- visdom==0.1.8.9
- wandb==0.12.11
- webcolors==1.12
- yaspin==2.1.0
prefix: /public/baiyifan/conda_envs/artrack
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
# ARTrack
[](https://paperswithcode.com/sota/visual-object-tracking-on-got-10k?p=artrackv2-prompting-autoregressive-tracker)
[](https://paperswithcode.com/sota/visual-object-tracking-on-lasot?p=artrackv2-prompting-autoregressive-tracker)
[](https://paperswithcode.com/sota/visual-object-tracking-on-trackingnet?p=artrackv2-prompting-autoregressive-tracker)
[](https://paperswithcode.com/sota/visual-object-tracking-on-needforspeed?p=artrackv2-prompting-autoregressive-tracker)
[](https://paperswithcode.com/sota/visual-object-tracking-on-tnl2k?p=artrackv2-prompting-autoregressive-tracker)
[](https://paperswithcode.com/sota/visual-object-tracking-on-lasot-ext?p=artrackv2-prompting-autoregressive-tracker)
[](https://paperswithcode.com/sota/visual-object-tracking-on-uav123?p=artrackv2-prompting-autoregressive-tracker)
The official PyTorch implementation of our **CVPR 2023 Highlight** and **CVPR 2024 Poster** paper:
**Autoregressive Visual Tracking**
**ARTrackV2: Prompting Autoregressive Tracker Where to Look and How to Describe**
GitHub maintainer: [Yifan Bai](https://github.com/AlexDotHam)
[[CVPR2023](https://openaccess.thecvf.com/content/CVPR2023/papers/Wei_Autoregressive_Visual_Tracking_CVPR_2023_paper.pdf)]
[[CVPR2024](https://artrackv2.github.io/)]
### :bookmark: Update List:
- [ ] Fastitnp
- [ ] VastTrack and More Datasets
### :bookmark: Checkpoints in Baidu Pan
[[Baidu Pan](https://pan.baidu.com/s/1bpdLdwO39kHD5iH06aGIzg?pwd=g06j)] passwd: g06j
Google Drive:
[ARTrackV2-B-256](https://drive.google.com/file/d/1tGaY5jQxZOTzJDWXgOgoHtBwc5l4NLQ2/view?usp=drive_link) | [ARTrackV2-B-256-GOT](https://drive.google.com/file/d/1RqsjHqTBsIN5ivD-C5tXDyhZlGZjJN88/view?usp=drive_link) | [ARTrackV2-L-384-GOT](https://drive.google.com/file/d/1KJ-TXFSn6K_OhchoRE29ePZbSm9sBHVS/view?usp=drive_link) |
### :bookmark:Our ARTrackV2 is accepted by CVPR2024!!!
[[Deprecated Code](https://drive.google.com/file/d/15PHRN9utPfm1L4djr7U6MLHWIkx90EVD/view?usp=sharing)]
[[Raw Result](https://drive.google.com/drive/folders/1Kd6IA60OQStfYCgsi42I20VRDTB7VcWl?usp=sharing)]
We have released the training code for ARTrackV2 and merged it into this repository. You can adjust the config to use the corresponding ARTrackV2-marked modules. The training process remains the same as V1.
| Variant | [ARTrackV2-B-256](https://drive.google.com/file/d/1tGaY5jQxZOTzJDWXgOgoHtBwc5l4NLQ2/view?usp=drive_link) | [ARTrackV2-B-256-GOT](https://drive.google.com/file/d/1RqsjHqTBsIN5ivD-C5tXDyhZlGZjJN88/view?usp=drive_link) | [ARTrackV2-L-384-GOT](https://drive.google.com/file/d/1KJ-TXFSn6K_OhchoRE29ePZbSm9sBHVS/view?usp=drive_link) |
|:-------------------------------:|:-----------------------:|:-----------------------:|:-----------------------:|
| Model Config | ViT-B, 256^2 resolution | ViT-B, 256^2 resolution | ViT-L, 384^2 resolution |
| GOT-10k (AO / SR 0.5 / SR 0.75) | - / - / - | 76.1 / 85.5 / 72.9 | 79.6 / 88.0 / 78.7 |
| LaSOT (AUC / Norm P / P) | 71.5 / 80.3 / 77.5 | - / - / - | - / - / - |
| TrackingNet (AUC / Norm P / P) | 84.3 / 89.1 / 83.6 | - / - / - | - / - / - |
| LaSOT_ext (AUC / Norm P / P) | 51.1 / 58.4 / 61.5 | - / - / - | - / - / - |
## Highlight

### :bookmark:Brief Introduction
We present **ARTrack**, an autoregressive framework for visual object tracking. ARTrack tackles tracking as a coordinate sequence interpretation task that estimates object trajectories progressively, where the current estimate is induced by previous states and in turn affects subsequences. This time-autoregressive approach models the sequential evolution of trajectories to keep tracing the object **across frames**, making it superior to existing template matching based trackers that only consider the **per-frame** localization accuracy. ARTrack is simple and direct, eliminating customized localization heads and post-processings. Despite its simplicity, ARTrack achieves state-of-the-art performance on prevailing benchmark datasets.
### :bookmark:Strong Performance
| Variant | ARTrack-256 | ARTrack-384 | ARTrack-L-384 |
|:-------------------------------:|:-----------------------:|:-----------------------:|:-----------------------:|
| Model Config | ViT-B, 256^2 resolution | ViT-B, 384^2 resolution | ViT-L, 384^2 resolution |
| GOT-10k (AO / SR 0.5 / SR 0.75) | 73.5 / 82.2 / 70.9 | 75.5 / 84.3 / 74.3 | 78.5 / 87.4 / 77.8 |
| LaSOT (AUC / Norm P / P) | 70.4 / 79.5 / 76.6 | 72.6 / 81.7 / 79.1 | 73.1 / 82.2 / 80.3 |
| TrackingNet (AUC / Norm P / P) | 84.2 / 88.7 / 83.5 | 85.1 / 89.1 / 84.8 | 85.6 / 89.6 / 84.8 |
| LaSOT_ext (AUC / Norm P / P) | 46.4 / 56.5 / 52.3 | 51.9 / 62.0 / 58.5 | 52.8 / 62.9 / 59.7 |
| TNL-2K (AUC) | 57.5 | 59.8 | 60.3 |
| NfS30 (AUC) | 64.3 | 66.8 | 67.9 |
| UAV123 (AUC) | 67.7 | 70.5 | 71.2 |
### :bookmark:Inference Speed
Our baseline model (backbone: ViT-B, resolution: 256x256) can run at **26 fps** (frames per second) on a single NVIDIA GeForce RTX 3090, our alter decoder version can run at **45 fps** on a single NVIDIA GeForce RTX 3090.
## Bug of array of inhomogeneous shape
Thanks to [MrtXue](https://github.com/MrtXue), if you meet the "ValueError: setting an array element with a sequence." when you train in the second stage, you can try to reduce your numpy version to 1.23.
## Update for checkpoint(ARTrack_large_384_full):
You can download the model weights from [Google Drive](https://drive.google.com/drive/folders/1KsH_MIZIdgjZpUZBmR4P88yeYDqM8yNW?usp=sharing)
| Variant | ARTrack-L-384 |
|:-------------------------------:|:-----------------------:|
| Model Config | ViT-L, 384^2 resolution |
| GOT-10k (AO / SR 0.5 / SR 0.75) | 80.0 / 88.5 / 80.0 |
| LaSOT (AUC / Norm P / P) | 73.5 / 82.4 / 80.6 |
| TrackingNet (AUC / Norm P / P) | 85.5 / 90.1 / 85.9 |
| LaSOT_ext (AUC / Norm P / P) | 51.8 / 62.3 / 58.8 |
## Update for checkpoint and raw_result(ARTrack_base_256_full):
You can download the model weights and raw_result from [Google Drive](https://drive.google.com/drive/folders/1KsH_MIZIdgjZpUZBmR4P88yeYDqM8yNW?usp=sharing)
| Variant | ARTrack-256 | ARTrack-256-got |
|:-------------------------------:|:-----------------------:|:-----------------------:|
| Model Config | ViT-B, 256^2 resolution | ViT-B, 256^2 resolution |
| GOT-10k (AO / SR 0.5 / SR 0.75) | 76.7 / 85.7 / 74.8 | 74.1 / 83.1 / 70.0 |
| LaSOT (AUC / Norm P / P) | 70.8 / 79.6 / 76.3 | - / - / - |
| TrackingNet (AUC / Norm P / P) | 84.3 / 88.7 / 83.4 | - / - / - |
| LaSOT_ext (AUC / Norm P / P) | 48.4 / 57.7 / 53.7 | - / - / - |
## Install the environment
Use the Anaconda (CUDA 11.3)
```
conda env create -f ARTrack_env_cuda113.yaml
```
## Set project paths
Run the following command to set paths for this project
```
python tracking/create_default_local_file.py --workspace_dir . --data_dir ./data --save_dir ./output
```
After running this command, you can also modify paths by editing these two files
```
lib/train/admin/local.py # paths about training
lib/test/evaluation/local.py # paths about testing
```
## Data Preparation
Put the tracking datasets in ./data. It should look like this:
```
${PROJECT_ROOT}
-- data
-- lasot
|-- airplane
|-- basketball
|-- bear
...
-- got10k
|-- test
|-- train
|-- val
-- coco
|-- annotations
|-- images
-- trackingnet
|-- TRAIN_0
|-- TRAIN_1
...
|-- TRAIN_11
|-- TEST
```
## Training
Download pre-trained [MAE ViT-Base weights](https://dl.fbaipublicfiles.com/mae/pretrain/mae_pretrain_vit_base.pth) and put it under `$PROJECT_ROOT$/pretrained_models` (different pretrained models can also be used, see [MAE](https://github.com/facebookresearch/mae) for more details).
### One-stage pair-level training
Since sequence-level training requires video input, and the COCO dataset contains only images, traditional training methods were first used to train the model so that it could be fairly compared to other trackers.
```
python tracking/train.py --script artrack --config artrack_256_full --save_dir ./output --mode multiple --nproc_per_node 4 --use_wandb 0
```
Replace `--config` with the desired model config under `experiments/artrack`. We use [wandb](https://github.com/wandb/client) to record detailed training logs, in case you don't want to use wandb, set `--use_wandb 0`.
### Two-stage sequence-level training
To enable sequence-level training, replace 'experience/artrack_seq/*.yaml' PRETRAIN_PTH in the yaml configuration file with the path to your pretrained checkpoint, such as './output/artrack_256_full/checkpoints/train/artrack/artrack_256_full/ARTrack_ep0240.pth.tar'.
```
python tracking/train.py --script artrack_seq --config artrack_seq_256_full --save_dir ./output --mode multiple --nproc_per_node 4 --use_wandb 0
```
## Evaluation
Change the corresponding values of `lib/test/evaluation/local.py` to the actual benchmark saving paths
Some testing examples:
- LaSOT or other off-line evaluated benchmarks (modify `--dataset` correspondingly)
```
python tracking/test.py artrack_seq artrack_seq_256_full --dataset lasot --threads 16 --num_gpus 4
python tracking/analysis_results.py # need to modify tracker configs and names
```
- GOT10K-test
```
python tracking/test.py artrack_seq artrack_seq_256_full --dataset got10k_test --threads 16 --num_gpus 4
python lib/test/utils/transform_got10k.py --tracker_name ostrack --cfg_name vitb_384_mae_ce_32x4_got10k_ep100
```
- TrackingNet
```
python tracking/test.py artrack_seq artrack_seq_256_full --dataset trackingnet --threads 16 --num_gpus 4
python lib/test/utils/transform_trackingnet.py --tracker_name ostrack --cfg_name vitb_384_mae_ce_32x4_ep300
```
## Acknowledgement
:heart::heart::heart:Our idea is implemented base on the following projects. We really appreciate their excellent open-source works!
- [SIoU](https://github.com/AlexDotHam/SIoU-loss) [[related paper](https://arxiv.org/abs/2205.12740)]
- [OSTrack](https://github.com/botaoye/OSTrack) [[related paper](https://arxiv.org/abs/2203.11991)]
- [PyTracking](https://github.com/visionml/pytracking) [[related paper](https://arxiv.org/abs/2208.06888)]
:heart::heart::heart:This project is not for commercial use. For commercial use, please contact the author.
:heart::heart::heart:This project is not for commercial use. For commercial use, please contact the author.
:heart::heart::heart:This project is not for commercial use. For commercial use, please contact the author.
## Citation
If any parts of our paper and code help your research, please consider citing us and giving a star to our repository.
```
@InProceedings{Wei_2023_CVPR,
author = {Wei, Xing and Bai, Yifan and Zheng, Yongchao and Shi, Dahu and Gong, Yihong},
title = {Autoregressive Visual Tracking},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2023},
pages = {9697-9706}
}
@InProceedings{Bai_2024_CVPR,
author = {Bai, Yifan and Zhao, Zeyang and Gong, Yihong and Wei, Xing},
title = {ARTrackV2: Prompting Autoregressive Tracker Where to Look and How to Describe},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2024}
}
```
## Contact
If you have any questions or concerns, feel free to open issues or directly contact me through the ways on my GitHub homepage **provide below paper's title**.
================================================
FILE: artrackv2_mindspore/.gitignore
================================================
test/
lib/models/__pycache__/
lib/config/__pycache__/
lib/test/tracker/__pycache__/
lib/models/__pycache__/
lib/config/ostrack/__pycache__/
lib/config/ostrack/__pycache__/
================================================
FILE: artrackv2_mindspore/README.md
================================================
# ARTrackV2
## Evaluation
Make sure you have installed the GPU version of MindSpore according to [link](https://www.mindspore.cn/install/en).
Change the corresponding values of `lib/test/evaluation/local.py` to the actual benchmark saving paths
Some testing examples:
- GOT10K-test
```python
cd tracking
python test.py ostrack 2stage_256_got --dataset got10k_test --thread 0 --num_gpus 1
```
================================================
FILE: artrackv2_mindspore/experiments/ostrack/2stage_256_got.yaml
================================================
DATA:
MAX_SAMPLE_INTERVAL: 200
MEAN:
- 0.485
- 0.456
- 0.406
SEARCH:
CENTER_JITTER: 3
FACTOR: 4.0
SCALE_JITTER: 0.25
SIZE: 256
NUMBER: 14
STD:
- 0.229
- 0.224
- 0.225
TEMPLATE:
CENTER_JITTER: 0
FACTOR: 2.0
SCALE_JITTER: 0
SIZE: 128
NUMBER: 2
TRAIN:
DATASETS_NAME:
#- LASOT
- GOT10K_train_full
#- TRACKINGNET
DATASETS_RATIO:
#- 1
- 1
#- 1
SAMPLE_PER_EPOCH: 1000
VAL:
DATASETS_NAME:
- GOT10K_official_val
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 10000
MODEL:
PRETRAIN_FILE: "../checkpoint1.ckpt"
EXTRA_MERGER: False
RETURN_INTER: False
DECODER:
TYPE: "mask"
MASK_RATIO: 0.75
EMBEDDIM: 512
DEPTH: 8
NUMHEADS: 16
MLPRATIO: 4
BACKBONE:
TYPE: vit_base_patch16_224
STRIDE: 16
HEAD:
TYPE: PIX
NUM_CHANNELS: 768
TRAIN:
BACKBONE_MULTIPLIER: 0.1
DROP_PATH_RATE: 0.1
BATCH_SIZE: 8
EPOCH: 120
GIOU_WEIGHT: 2.0
L1_WEIGHT: 0.0
GRAD_CLIP_NORM: 0.1
LR: 0.00008
LR_DROP_EPOCH: 90
NUM_WORKER: 6
OPTIMIZER: ADAMW
PRINT_INTERVAL: 1
SCHEDULER:
TYPE: step
DECAY_RATE: 0.05
VAL_EPOCH_INTERVAL: 10
WEIGHT_DECAY: 0.05
AMP: False
TEST:
EPOCH: 300
SEARCH_FACTOR: 3.95
SEARCH_SIZE: 256
TEMPLATE_FACTOR: 2.0
TEMPLATE_SIZE: 128
================================================
FILE: artrackv2_mindspore/experiments/ostrack/best_384.yaml
================================================
DATA:
MAX_SAMPLE_INTERVAL: 200
MEAN:
- 0.485
- 0.456
- 0.406
SEARCH:
CENTER_JITTER: 4.5
FACTOR: 5.0
SCALE_JITTER: 0.5
SIZE: 384
STD:
- 0.229
- 0.224
- 0.225
TEMPLATE:
CENTER_JITTER: 0
FACTOR: 2.0
SCALE_JITTER: 0
SIZE: 192
TRAIN:
DATASETS_NAME:
- LASOT
- GOT10K_vottrain
- COCO17
- TRACKINGNET
DATASETS_RATIO:
- 1
- 1
- 1
- 1
SAMPLE_PER_EPOCH: 60000
VAL:
DATASETS_NAME:
- GOT10K_votval
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 10240
MODEL:
PRETRAIN_FILE: "mae_pretrain_vit_base.pth"
EXTRA_MERGER: False
RETURN_INTER: False
BACKBONE:
TYPE: vit_base_patch16_224
STRIDE: 16
HEAD:
TYPE: PIX
NUM_CHANNELS: 768
TRAIN:
BACKBONE_MULTIPLIER: 0.1
DROP_PATH_RATE: 0.1
BATCH_SIZE: 16
EPOCH: 500
GIOU_WEIGHT: 2.0
L1_WEIGHT: 0.0
GRAD_CLIP_NORM: 0.1
LR: 0.00008
LR_DROP_EPOCH: 400
NUM_WORKER: 16
OPTIMIZER: ADAMW
PRINT_INTERVAL: 10
SCHEDULER:
TYPE: step
DECAY_RATE: 0.1
VAL_EPOCH_INTERVAL: 10
WEIGHT_DECAY: 0.0001
AMP: False
TEST:
EPOCH: 500
SEARCH_FACTOR: 5.0
SEARCH_SIZE: 384
TEMPLATE_FACTOR: 2.0
TEMPLATE_SIZE: 192
================================================
FILE: artrackv2_mindspore/experiments/ostrack/finetune.yaml
================================================
DATA:
MAX_SAMPLE_INTERVAL: 200
MEAN:
- 0.485
- 0.456
- 0.406
SEARCH:
CENTER_JITTER: 3
FACTOR: 4.0
SCALE_JITTER: 0.25
SIZE: 256
NUMBER: 8
STD:
- 0.229
- 0.224
- 0.225
TEMPLATE:
CENTER_JITTER: 0
FACTOR: 2.0
SCALE_JITTER: 0
SIZE: 128
TRAIN:
DATASETS_NAME:
- LASOT
- GOT10K_vottrain
- TRACKINGNET
DATASETS_RATIO:
- 1
- 1
- 1
SAMPLE_PER_EPOCH: 960
VAL:
DATASETS_NAME:
- GOT10K_official_val
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 10000
MODEL:
PRETRAIN_FILE: "mae_pretrain_vit_base.pth"
EXTRA_MERGER: False
RETURN_INTER: False
BACKBONE:
TYPE: vit_base_patch16_224
STRIDE: 16
HEAD:
TYPE: PIX
NUM_CHANNELS: 768
TRAIN:
BACKBONE_MULTIPLIER: 0.1
DROP_PATH_RATE: 0.1
BATCH_SIZE: 8
EPOCH: 120
GIOU_WEIGHT: 2.0
L1_WEIGHT: 0.0
GRAD_CLIP_NORM: 0.1
LR: 0.000004
LR_DROP_EPOCH: 400
NUM_WORKER: 8
OPTIMIZER: ADAMW
PRINT_INTERVAL: 1
SCHEDULER:
TYPE: step
DECAY_RATE: 0.1
VAL_EPOCH_INTERVAL: 10
WEIGHT_DECAY: 0.05
AMP: False
TEST:
EPOCH: 30
SEARCH_FACTOR: 4.0
SEARCH_SIZE: 256
TEMPLATE_FACTOR: 2.0
TEMPLATE_SIZE: 128
================================================
FILE: artrackv2_mindspore/experiments/ostrack/finetune_384.yaml
================================================
DATA:
MAX_SAMPLE_INTERVAL: 200
MEAN:
- 0.485
- 0.456
- 0.406
SEARCH:
CENTER_JITTER: 4.5
FACTOR: 5.0
SCALE_JITTER: 0.5
SIZE: 384
NUMBER: 12
STD:
- 0.229
- 0.224
- 0.225
TEMPLATE:
CENTER_JITTER: 0
FACTOR: 2.0
SCALE_JITTER: 0
SIZE: 192
TRAIN:
DATASETS_NAME:
- LASOT
- GOT10K_vottrain
- TRACKINGNET
DATASETS_RATIO:
- 1
- 1
- 1
SAMPLE_PER_EPOCH: 960
VAL:
DATASETS_NAME:
- GOT10K_official_val
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 10000
MODEL:
PRETRAIN_FILE: "mae_pretrain_vit_large.pth"
EXTRA_MERGER: False
RETURN_INTER: False
DECODER:
TYPE: "mask"
MASK_RATIO: 0.75
EMBEDDIM: 512
DEPTH: 8
NUMHEADS: 16
MLPRATIO: 4
BACKBONE:
TYPE: vit_large_patch16_224
STRIDE: 16
EMBEDDIM: 1024
HEAD:
TYPE: PIX
NUM_CHANNELS: 1024
TRAIN:
BACKBONE_MULTIPLIER: 0.1
DROP_PATH_RATE: 0.1
BATCH_SIZE: 4
EPOCH: 120
GIOU_WEIGHT: 2.0
L1_WEIGHT: 0.0
GRAD_CLIP_NORM: 0.1
LR: 0.00008
LR_DROP_EPOCH: 400
NUM_WORKER: 8
OPTIMIZER: ADAMW
PRINT_INTERVAL: 1
SCHEDULER:
TYPE: step
DECAY_RATE: 0.1
VAL_EPOCH_INTERVAL: 10
WEIGHT_DECAY: 0.05
AMP: False
TEST:
EPOCH: 500
SEARCH_FACTOR: 5.0
SEARCH_SIZE: 384
TEMPLATE_FACTOR: 2.0
TEMPLATE_SIZE: 192
================================================
FILE: artrackv2_mindspore/experiments/ostrack/finetune_384_got.yaml
================================================
DATA:
MAX_SAMPLE_INTERVAL: 200
MEAN:
- 0.485
- 0.456
- 0.406
SEARCH:
CENTER_JITTER: 4.5
FACTOR: 5.0
SCALE_JITTER: 0.5
SIZE: 384
NUMBER: 17
STD:
- 0.229
- 0.224
- 0.225
TEMPLATE:
CENTER_JITTER: 0
FACTOR: 2.0
SCALE_JITTER: 0
SIZE: 192
TRAIN:
DATASETS_NAME:
- GOT10K_train_full
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 960
VAL:
DATASETS_NAME:
- GOT10K_official_val
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 10000
MODEL:
PRETRAIN_FILE: "mae_pretrain_vit_base.pth"
EXTRA_MERGER: False
RETURN_INTER: False
BACKBONE:
TYPE: vit_base_patch16_224
STRIDE: 16
HEAD:
TYPE: PIX
NUM_CHANNELS: 768
TRAIN:
BACKBONE_MULTIPLIER: 0.1
DROP_PATH_RATE: 0.1
BATCH_SIZE: 4
EPOCH: 120
GIOU_WEIGHT: 2.0
L1_WEIGHT: 0.0
GRAD_CLIP_NORM: 0.1
LR: 0.000004
LR_DROP_EPOCH: 400
NUM_WORKER: 4
OPTIMIZER: ADAMW
PRINT_INTERVAL: 1
SCHEDULER:
TYPE: step
DECAY_RATE: 0.1
VAL_EPOCH_INTERVAL: 10
WEIGHT_DECAY: 0.05
AMP: False
TEST:
EPOCH: 500
SEARCH_FACTOR: 5.0
SEARCH_SIZE: 384
TEMPLATE_FACTOR: 2.0
TEMPLATE_SIZE: 192
================================================
FILE: artrackv2_mindspore/experiments/ostrack/vitb_256_mae_32x4_ep300.yaml
================================================
DATA:
MAX_SAMPLE_INTERVAL: 200
MEAN:
- 0.485
- 0.456
- 0.406
SEARCH:
CENTER_JITTER: 3
FACTOR: 4.0
SCALE_JITTER: 0.25
SIZE: 256
NUMBER: 1
STD:
- 0.229
- 0.224
- 0.225
TEMPLATE:
CENTER_JITTER: 0
FACTOR: 2.0
SCALE_JITTER: 0
SIZE: 128
TRAIN:
DATASETS_NAME:
- GOT10K_train_full
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 60000
# TRAIN:
# DATASETS_NAME:
# - LASOT
# - GOT10K_vottrain
# - COCO17
# - TRACKINGNET
# DATASETS_RATIO:
# - 1
# - 1
# - 1
# - 1
# SAMPLE_PER_EPOCH: 60000
VAL:
DATASETS_NAME:
- GOT10K_votval
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 10000
MODEL:
PRETRAIN_FILE: "mae_pretrain_vit_base.pth"
EXTRA_MERGER: False
RETURN_INTER: False
BACKBONE:
TYPE: vit_base_patch16_224
STRIDE: 16
HEAD:
TYPE: CENTER
NUM_CHANNELS: 256
TRAIN:
BACKBONE_MULTIPLIER: 0.1
DROP_PATH_RATE: 0.1
BATCH_SIZE: 32
EPOCH: 300
GIOU_WEIGHT: 2.0
L1_WEIGHT: 5.0
GRAD_CLIP_NORM: 0.1
LR: 0.0004
LR_DROP_EPOCH: 240
NUM_WORKER: 10
OPTIMIZER: ADAMW
PRINT_INTERVAL: 50
SCHEDULER:
TYPE: step
DECAY_RATE: 0.1
VAL_EPOCH_INTERVAL: 20
WEIGHT_DECAY: 0.0001
AMP: False
TEST:
EPOCH: 300
SEARCH_FACTOR: 4.0
SEARCH_SIZE: 256
TEMPLATE_FACTOR: 2.0
TEMPLATE_SIZE: 128
================================================
FILE: artrackv2_mindspore/experiments/ostrack/vitb_256_mae_ce_32x4_ep300.yaml
================================================
DATA:
MAX_SAMPLE_INTERVAL: 200
MEAN:
- 0.485
- 0.456
- 0.406
SEARCH:
CENTER_JITTER: 3
FACTOR: 4.0
SCALE_JITTER: 0.25
SIZE: 256
NUMBER: 1
STD:
- 0.229
- 0.224
- 0.225
TEMPLATE:
CENTER_JITTER: 0
FACTOR: 2.0
SCALE_JITTER: 0
SIZE: 128
# TRAIN:
# DATASETS_NAME:
# - GOT10K_train_full
# DATASETS_RATIO:
# - 1
# SAMPLE_PER_EPOCH: 60000
TRAIN:
DATASETS_NAME:
- LASOT
- GOT10K_vottrain
- COCO17
- TRACKINGNET
DATASETS_RATIO:
- 1
- 1
- 1
- 1
SAMPLE_PER_EPOCH: 60000
VAL:
DATASETS_NAME:
- GOT10K_votval
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 10000
MODEL:
PRETRAIN_FILE: "mae_pretrain_vit_base.pth"
EXTRA_MERGER: False
RETURN_INTER: False
BACKBONE:
TYPE: vit_base_patch16_224
STRIDE: 16
HEAD:
TYPE: PIX
NUM_CHANNELS: 768
TRAIN:
BACKBONE_MULTIPLIER: 0.1
DROP_PATH_RATE: 0.1
CE_START_EPOCH: 600 # candidate elimination start epoch
CE_WARM_EPOCH: 560 # candidate elimination warm up epoch
BATCH_SIZE: 48
EPOCH: 500
GIOU_WEIGHT: 2.0
L1_WEIGHT: 0.0
GRAD_CLIP_NORM: 0.1
LR: 0.00008
LR_DROP_EPOCH: 400
NUM_WORKER: 8
OPTIMIZER: ADAMW
PRINT_INTERVAL: 10
SCHEDULER:
TYPE: step
DECAY_RATE: 0.1
VAL_EPOCH_INTERVAL: 20
WEIGHT_DECAY: 0.0001
AMP: False
TEST:
EPOCH: 500
SEARCH_FACTOR: 4.0
SEARCH_SIZE: 256
TEMPLATE_FACTOR: 2.0
TEMPLATE_SIZE: 128
================================================
FILE: artrackv2_mindspore/experiments/ostrack/vitb_256_mae_ce_32x4_got10k_ep100.yaml
================================================
DATA:
MAX_SAMPLE_INTERVAL: 200
MEAN:
- 0.485
- 0.456
- 0.406
SEARCH:
CENTER_JITTER: 3
FACTOR: 4.0
SCALE_JITTER: 0.25
SIZE: 256
NUMBER: 24
STD:
- 0.229
- 0.224
- 0.225
TEMPLATE:
CENTER_JITTER: 0
FACTOR: 2.0
SCALE_JITTER: 0
SIZE: 128
TRAIN:
DATASETS_NAME:
- LASOT
- GOT10K_vottrain
- TRACKINGNET
DATASETS_RATIO:
- 1
- 1
- 1
SAMPLE_PER_EPOCH: 1000
VAL:
DATASETS_NAME:
- GOT10K_official_val
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 10000
MODEL:
PRETRAIN_FILE: "mae_pretrain_vit_base.pth"
EXTRA_MERGER: False
RETURN_INTER: False
BACKBONE:
TYPE: vit_base_patch16_224
STRIDE: 16
HEAD:
TYPE: PIX
NUM_CHANNELS: 768
TRAIN:
BACKBONE_MULTIPLIER: 0.1
DROP_PATH_RATE: 0.1
BATCH_SIZE: 8
EPOCH: 120
GIOU_WEIGHT: 2.0
L1_WEIGHT: 0.0
GRAD_CLIP_NORM: 0.1
LR: 0.000001
LR_DROP_EPOCH: 400
NUM_WORKER: 4
OPTIMIZER: ADAMW
PRINT_INTERVAL: 1
SCHEDULER:
TYPE: step
DECAY_RATE: 0.1
VAL_EPOCH_INTERVAL: 10
WEIGHT_DECAY: 0.0001
AMP: False
TEST:
EPOCH: 30
SEARCH_FACTOR: 4.2
SEARCH_SIZE: 256
TEMPLATE_FACTOR: 2.0
TEMPLATE_SIZE: 128
================================================
FILE: artrackv2_mindspore/experiments/ostrack/vitb_384_mae_32x4_ep300.yaml
================================================
DATA:
MAX_SAMPLE_INTERVAL: 200
MEAN:
- 0.485
- 0.456
- 0.406
SEARCH:
CENTER_JITTER: 4.5
FACTOR: 5.0
SCALE_JITTER: 0.5
SIZE: 384
STD:
- 0.229
- 0.224
- 0.225
TEMPLATE:
CENTER_JITTER: 0
FACTOR: 2.0
SCALE_JITTER: 0
SIZE: 192
# TRAIN:
# DATASETS_NAME:
# - GOT10K_train_full
# DATASETS_RATIO:
# - 1
# SAMPLE_PER_EPOCH: 60000
TRAIN:
DATASETS_NAME:
- LASOT
- GOT10K_vottrain
- COCO17
- TRACKINGNET
DATASETS_RATIO:
- 1
- 1
- 1
- 1
SAMPLE_PER_EPOCH: 60000
VAL:
DATASETS_NAME:
- GOT10K_votval
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 10000
MODEL:
PRETRAIN_FILE: "mae_pretrain_vit_base.pth"
EXTRA_MERGER: False
RETURN_INTER: False
BACKBONE:
TYPE: vit_base_patch16_224
STRIDE: 16
HEAD:
TYPE: CENTER
NUM_CHANNELS: 256
TRAIN:
BACKBONE_MULTIPLIER: 0.1
DROP_PATH_RATE: 0.1
BATCH_SIZE: 32
EPOCH: 300
GIOU_WEIGHT: 2.0
L1_WEIGHT: 5.0
GRAD_CLIP_NORM: 0.1
LR: 0.0004
LR_DROP_EPOCH: 240
NUM_WORKER: 10
OPTIMIZER: ADAMW
PRINT_INTERVAL: 50
SCHEDULER:
TYPE: step
DECAY_RATE: 0.1
VAL_EPOCH_INTERVAL: 20
WEIGHT_DECAY: 0.0001
AMP: False
TEST:
EPOCH: 300
SEARCH_FACTOR: 5.0
SEARCH_SIZE: 384
TEMPLATE_FACTOR: 2.0
TEMPLATE_SIZE: 192
================================================
FILE: artrackv2_mindspore/experiments/ostrack/vitb_384_mae_ce_32x4_ep300.yaml
================================================
DATA:
MAX_SAMPLE_INTERVAL: 200
MEAN:
- 0.485
- 0.456
- 0.406
SEARCH:
CENTER_JITTER: 4.5
FACTOR: 5.0
SCALE_JITTER: 0.5
SIZE: 384
STD:
- 0.229
- 0.224
- 0.225
TEMPLATE:
CENTER_JITTER: 0
FACTOR: 2.0
SCALE_JITTER: 0
SIZE: 192
# TRAIN:
# DATASETS_NAME:
# - GOT10K_train_full
# DATASETS_RATIO:
# - 1
# SAMPLE_PER_EPOCH: 60000
TRAIN:
DATASETS_NAME:
- LASOT
- GOT10K_vottrain
- COCO17
- TRACKINGNET
DATASETS_RATIO:
- 1
- 1
- 1
- 1
SAMPLE_PER_EPOCH: 60000
VAL:
DATASETS_NAME:
- GOT10K_votval
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 10000
MODEL:
PRETRAIN_FILE: "mae_pretrain_vit_base.pth"
EXTRA_MERGER: False
RETURN_INTER: False
BACKBONE:
TYPE: vit_base_patch16_224_ce
STRIDE: 16
CE_LOC: [3, 6, 9]
CE_KEEP_RATIO: [0.7, 0.7, 0.7]
CE_TEMPLATE_RANGE: 'CTR_POINT' # choose between ALL, CTR_POINT, CTR_REC, GT_BOX
HEAD:
TYPE: CENTER
NUM_CHANNELS: 256
TRAIN:
BACKBONE_MULTIPLIER: 0.1
DROP_PATH_RATE: 0.1
BATCH_SIZE: 32
EPOCH: 300
GIOU_WEIGHT: 2.0
L1_WEIGHT: 5.0
GRAD_CLIP_NORM: 0.1
LR: 0.0004
LR_DROP_EPOCH: 240
NUM_WORKER: 10
OPTIMIZER: ADAMW
PRINT_INTERVAL: 50
SCHEDULER:
TYPE: step
DECAY_RATE: 0.1
VAL_EPOCH_INTERVAL: 20
WEIGHT_DECAY: 0.0001
AMP: False
TEST:
EPOCH: 300
SEARCH_FACTOR: 5.0
SEARCH_SIZE: 384
TEMPLATE_FACTOR: 2.0
TEMPLATE_SIZE: 192
================================================
FILE: artrackv2_mindspore/experiments/ostrack/vitb_384_mae_ce_32x4_got10k_ep100.yaml
================================================
DATA:
MAX_SAMPLE_INTERVAL: 200
MEAN:
- 0.485
- 0.456
- 0.406
SEARCH:
CENTER_JITTER: 4.5
FACTOR: 5.0
SCALE_JITTER: 0.5
SIZE: 384
STD:
- 0.229
- 0.224
- 0.225
TEMPLATE:
CENTER_JITTER: 0
FACTOR: 2.0
SCALE_JITTER: 0
SIZE: 192
TRAIN:
DATASETS_NAME:
- GOT10K_train_full
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 60000
VAL:
DATASETS_NAME:
- GOT10K_official_val
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 10000
MODEL:
PRETRAIN_FILE: "mae_pretrain_vit_base.pth"
EXTRA_MERGER: False
RETURN_INTER: False
BACKBONE:
TYPE: vit_base_patch16_224_ce
STRIDE: 16
CE_LOC: [3, 6, 9]
CE_KEEP_RATIO: [0.7, 0.7, 0.7]
CE_TEMPLATE_RANGE: 'CTR_POINT' # choose between ALL, CTR_POINT, CTR_REC, GT_BOX
HEAD:
TYPE: CENTER
NUM_CHANNELS: 256
TRAIN:
BACKBONE_MULTIPLIER: 0.1
DROP_PATH_RATE: 0.1
CE_START_EPOCH: 20 # candidate elimination start epoch
CE_WARM_EPOCH: 50 # candidate elimination warm up epoch
BATCH_SIZE: 32
EPOCH: 100
GIOU_WEIGHT: 2.0
L1_WEIGHT: 5.0
GRAD_CLIP_NORM: 0.1
LR: 0.0004
LR_DROP_EPOCH: 80
NUM_WORKER: 10
OPTIMIZER: ADAMW
PRINT_INTERVAL: 50
SCHEDULER:
TYPE: step
DECAY_RATE: 0.1
VAL_EPOCH_INTERVAL: 20
WEIGHT_DECAY: 0.0001
AMP: False
TEST:
EPOCH: 100
SEARCH_FACTOR: 5.0
SEARCH_SIZE: 384
TEMPLATE_FACTOR: 2.0
TEMPLATE_SIZE: 192
================================================
FILE: artrackv2_mindspore/external/AR/README.md
================================================
# Alpha-Refine
## Introduction
Alpha-Refine is the winner of the VOT Real-Time Challenge 2020, which has great ability to predict high-quality masks.
In this work, we combine the STARK tracker with Alpha-Refine to test on the VOT2020 benchamark.
## Installation
After the environment has been installed according to the README.md of STARK, you only need to install a few more packages as shown below.
* Install ninja-build for Precise ROI pooling
```bash
sudo apt-get install ninja-build
```
In case of issues, we refer to https://github.com/vacancy/PreciseRoIPooling.
* Install the Precise ROI pooling
```
cd ltr/external
git clone https://github.com/vacancy/PreciseRoIPooling.git
cd ../..
```
* Add the project path to environment variables
```
export PYTHONPATH=<absolute_path_of_AR>:$PYTHONPATH
```
* Setup the environment
Create the default environment setting files.
```bash
# Environment settings for pytracking. Saved at pytracking/evaluation/local.py
python -c "from pytracking.evaluation.environment import create_default_local_file; create_default_local_file()"
# Environment settings for ltr. Saved at ltr/admin/local.py
python -c "from ltr.admin.environment import create_default_local_file; create_default_local_file()"
```
You can modify these files to set the paths to datasets, results paths etc.
* Download the pre-trained Alpha-Refine network
Download the network for [Alpha-Refine](https://drive.google.com/open?id=1qOQRfaRMbQ2nmgX1NFjoQHfXOAn609QM)
and put it under the ltr/checkpoints/ltr/ARcm_seg/ARcm_coco_seg_only_mask_384 dir.
================================================
FILE: artrackv2_mindspore/external/AR/__init__.py
================================================
================================================
FILE: artrackv2_mindspore/external/AR/ltr/README.md
================================================
# LTR
A general PyTorch based framework for learning tracking representations.
## Table of Contents
* [Quick Start](#quick-start)
* [Overview](#overview)
* [Trackers](#trackers)
* [PrDiMP](#PrDiMP)
* [DiMP](#DiMP)
* [ATOM](#ATOM)
* [Training your own networks](#training-your-own-networks)
## Quick Start
The installation script will automatically generate a local configuration file "admin/local.py". In case the file was not generated, run ```admin.environment.create_default_local_file()``` to generate it. Next, set the paths to the training workspace,
i.e. the directory where the checkpoints will be saved. Also set the paths to the datasets you want to use. If all the dependencies have been correctly installed, you can train a network using the run_training.py script in the correct conda environment.
```bash
conda activate pytracking
python run_training.py train_module train_name
```
Here, ```train_module``` is the sub-module inside ```train_settings``` and ```train_name``` is the name of the train setting file to be used.
For example, you can train using the included default ATOM settings by running:
```bash
python run_training bbreg atom_default
```
## Overview
The framework consists of the following sub-modules.
- [actors](actors): Contains the actor classes for different trainings. The actor class is responsible for passing the input data through the network can calculating losses.
- [admin](admin): Includes functions for loading networks, tensorboard etc. and also contains environment settings.
- [dataset](dataset): Contains integration of a number of training datasets, namely [TrackingNet](https://tracking-net.org/), [GOT-10k](http://got-10k.aitestunion.com/), [LaSOT](https://cis.temple.edu/lasot/),
[ImageNet-VID](http://image-net.org/), [DAVIS](https://davischallenge.org), [YouTube-VOS](https://youtube-vos.org), [MS-COCO](http://cocodataset.org/#home), [SBD](http://home.bharathh.info/pubs/codes/SBD), [LVIS](https://www.lvisdataset.org), [ECSSD](http://www.cse.cuhk.edu.hk/leojia/projects/hsaliency/dataset.html), [MSRA10k](https://mmcheng.net/msra10k), and [HKU-IS](https://sites.google.com/site/ligb86/hkuis). Additionally, it includes modules to generate synthetic videos from image datasets.
- [data_specs](data_specs): Information about train/val splits of different datasets.
- [data](data): Contains functions for processing data, e.g. loading images, data augmentations, sampling frames from videos.
- [external](external): External libraries needed for training. Added as submodules.
- [models](models): Contains different layers and network definitions.
- [trainers](trainers): The main class which runs the training.
- [train_settings](train_settings): Contains settings files, specifying the training of a network.
## Trackers
The framework currently contains the training code for the following trackers.
### PrDiMP
The following setting files can be used train the DiMP networks, or to know the exact training details.
- [dimp.prdimp18](train_settings/dimp/prdimp18.py): The default settings used for training the PrDiMP model with ResNet-18 backbone.
- [dimp.prdimp50](train_settings/dimp/prdimp50.py): The default settings used for training the PrDiMP model with ResNet-50 backbone.
- [dimp.super_dimp](train_settings/dimp/super_dimp.py): Combines the bounding-box regressor of PrDiMP with the standard DiMP classifier and better training and inference settings.
### DiMP
The following setting files can be used train the DiMP networks, or to know the exact training details.
- [dimp.dimp18](train_settings/dimp/dimp18.py): The default settings used for training the DiMP model with ResNet-18 backbone.
- [dimp.dimp50](train_settings/dimp/dimp50.py): The default settings used for training the DiMP model with ResNet-50 backbone.
### ATOM
The following setting file can be used train the ATOM network, or to know the exact training details.
- [bbreg.atom](train_settings/bbreg/atom_paper.py): The settings used in the paper for training the network in ATOM.
- [bbreg.atom](train_settings/bbreg/atom.py): Newer settings used for training the network in ATOM, also utilizing the GOT10k dataset.
- [bbreg.atom](train_settings/bbreg/atom_prob_ml.py): Settings for ATOM with the probabilistic bounding box regression proposed in [this paper](https://arxiv.org/abs/1909.12297).
- [bbreg.atom](train_settings/bbreg/atom_paper.py): The baseline ATOM* setting evaluated in [this paper](https://arxiv.org/abs/1909.12297).
## Training your own networks
To train a custom network using the toolkit, the following components need to be specified in the train settings. For reference, see [atom.py](train_settings/bbreg/atom.py).
- Datasets: The datasets to be used for training. A number of standard tracking datasets are already available in ```dataset``` module.
- Processing: This function should perform the necessary post-processing of the data, e.g. cropping of target region, data augmentations etc.
- Sampler: Determines how the frames are sampled from a video sequence to form the batches.
- Network: The network module to be trained.
- Objective: The training objective.
- Actor: The trainer passes the training batch to the actor who is responsible for passing the data through the network correctly, and calculating the training loss.
- Optimizer: Optimizer to be used, e.g. Adam.
- Trainer: The main class which runs the epochs and saves checkpoints.
================================================
FILE: artrackv2_mindspore/external/AR/ltr/__init__.py
================================================
from .admin.loading import load_network
from .admin.model_constructor import model_constructor
from .admin.multigpu import MultiGPU
================================================
FILE: artrackv2_mindspore/external/AR/ltr/actors/__init__.py
================================================
from .base_actor import BaseActor
from .bbreg import AtomActor
from .tracking import DiMPActor
================================================
FILE: artrackv2_mindspore/external/AR/ltr/actors/base_actor.py
================================================
from pytracking import TensorDict
class BaseActor:
""" Base class for actor. The actor class handles the passing of the data through the network
and calculation the loss"""
def __init__(self, net, objective):
"""
args:
net - The network to train
objective - The loss function
"""
self.net = net
self.objective = objective
def __call__(self, data: TensorDict):
""" Called in each training iteration. Should pass in input data through the network, calculate the loss, and
return the training stats for the input data
args:
data - A TensorDict containing all the necessary data blocks.
returns:
loss - loss for the input data
stats - a dict containing detailed losses
"""
raise NotImplementedError
def to(self, device):
""" Move the network to device
args:
device - device to use. 'cpu' or 'cuda'
"""
self.net.to(device)
def train(self, mode=True):
""" Set whether the network is in train mode.
args:
mode (True) - Bool specifying whether in training mode.
"""
self.net.train(mode)
def eval(self):
""" Set network to eval mode"""
self.train(False)
================================================
FILE: artrackv2_mindspore/external/AR/ltr/actors/bbreg.py
================================================
from . import BaseActor
class AtomActor(BaseActor):
""" Actor for training the IoU-Net in ATOM"""
def __call__(self, data):
"""
args:
data - The input data, should contain the fields 'train_images', 'test_images', 'train_anno',
'test_proposals' and 'proposal_iou'.
returns:
loss - the training loss
states - dict containing detailed losses
"""
# Run network to obtain IoU prediction for each proposal in 'test_proposals'
iou_pred = self.net(data['train_images'], data['test_images'], data['train_anno'], data['test_proposals'])
iou_pred = iou_pred.view(-1, iou_pred.shape[2])
iou_gt = data['proposal_iou'].view(-1, data['proposal_iou'].shape[2])
# Compute loss
loss = self.objective(iou_pred, iou_gt)
# Return training stats
stats = {'Loss/total': loss.item(),
'Loss/iou': loss.item()}
return loss, stats
class AtomBBKLActor(BaseActor):
""" Actor for training the IoU-Net in ATOM with BBKL"""
def __call__(self, data):
"""
args:
data - The input data, should contain the fields 'train_images', 'test_images', 'train_anno',
'test_proposals', 'proposal_density', and 'gt_density'.
returns:
loss - the training loss
states - dict containing detailed losses
"""
# Run network to obtain IoU prediction for each proposal in 'test_proposals'
bb_scores = self.net(data['train_images'], data['test_images'], data['train_anno'], data['test_proposals'])
bb_scores = bb_scores.view(-1, bb_scores.shape[2])
proposal_density = data['proposal_density'].view(-1, data['proposal_density'].shape[2])
gt_density = data['gt_density'].view(-1, data['gt_density'].shape[2])
# Compute loss
loss = self.objective(bb_scores, sample_density=proposal_density, gt_density=gt_density, mc_dim=1)
# Return training stats
stats = {'Loss/total': loss.item(),
'Loss/bb_ce': loss.item()}
return loss, stats
================================================
FILE: artrackv2_mindspore/external/AR/ltr/actors/tracking.py
================================================
from . import BaseActor
import torch
class DiMPActor(BaseActor):
"""Actor for training the DiMP network."""
def __init__(self, net, objective, loss_weight=None):
super().__init__(net, objective)
if loss_weight is None:
loss_weight = {'iou': 1.0, 'test_clf': 1.0}
self.loss_weight = loss_weight
def __call__(self, data):
"""
args:
data - The input data, should contain the fields 'train_images', 'test_images', 'train_anno',
'test_proposals', 'proposal_iou' and 'test_label'.
returns:
loss - the training loss
stats - dict containing detailed losses
"""
# Run network
target_scores, iou_pred = self.net(train_imgs=data['train_images'],
test_imgs=data['test_images'],
train_bb=data['train_anno'],
test_proposals=data['test_proposals'])
# Classification losses for the different optimization iterations
clf_losses_test = [self.objective['test_clf'](s, data['test_label'], data['test_anno']) for s in target_scores]
# Loss of the final filter
clf_loss_test = clf_losses_test[-1]
loss_target_classifier = self.loss_weight['test_clf'] * clf_loss_test
# Compute loss for ATOM IoUNet
loss_iou = self.loss_weight['iou'] * self.objective['iou'](iou_pred, data['proposal_iou'])
# Loss for the initial filter iteration
loss_test_init_clf = 0
if 'test_init_clf' in self.loss_weight.keys():
loss_test_init_clf = self.loss_weight['test_init_clf'] * clf_losses_test[0]
# Loss for the intermediate filter iterations
loss_test_iter_clf = 0
if 'test_iter_clf' in self.loss_weight.keys():
test_iter_weights = self.loss_weight['test_iter_clf']
if isinstance(test_iter_weights, list):
loss_test_iter_clf = sum([a*b for a, b in zip(test_iter_weights, clf_losses_test[1:-1])])
else:
loss_test_iter_clf = (test_iter_weights / (len(clf_losses_test) - 2)) * sum(clf_losses_test[1:-1])
# Total loss
loss = loss_iou + loss_target_classifier + loss_test_init_clf + loss_test_iter_clf
# Log stats
stats = {'Loss/total': loss.item(),
'Loss/iou': loss_iou.item(),
'Loss/target_clf': loss_target_classifier.item()}
if 'test_init_clf' in self.loss_weight.keys():
stats['Loss/test_init_clf'] = loss_test_init_clf.item()
if 'test_iter_clf' in self.loss_weight.keys():
stats['Loss/test_iter_clf'] = loss_test_iter_clf.item()
stats['ClfTrain/test_loss'] = clf_loss_test.item()
if len(clf_losses_test) > 0:
stats['ClfTrain/test_init_loss'] = clf_losses_test[0].item()
if len(clf_losses_test) > 2:
stats['ClfTrain/test_iter_loss'] = sum(clf_losses_test[1:-1]).item() / (len(clf_losses_test) - 2)
return loss, stats
class KLDiMPActor(BaseActor):
"""Actor for training the DiMP network."""
def __init__(self, net, objective, loss_weight=None):
super().__init__(net, objective)
if loss_weight is None:
loss_weight = {'bb_ce': 1.0}
self.loss_weight = loss_weight
def __call__(self, data):
"""
args:
data - The input data, should contain the fields 'train_images', 'test_images', 'train_anno',
'test_proposals', 'proposal_iou' and 'test_label'.
returns:
loss - the training loss
stats - dict containing detailed losses
"""
# Run network
target_scores, bb_scores = self.net(train_imgs=data['train_images'],
test_imgs=data['test_images'],
train_bb=data['train_anno'],
test_proposals=data['test_proposals'])
# Reshape bb reg variables
is_valid = data['test_anno'][:, :, 0] < 99999.0
bb_scores = bb_scores[is_valid, :]
proposal_density = data['proposal_density'][is_valid, :]
gt_density = data['gt_density'][is_valid, :]
# Compute loss
bb_ce = self.objective['bb_ce'](bb_scores, sample_density=proposal_density, gt_density=gt_density, mc_dim=1)
loss_bb_ce = self.loss_weight['bb_ce'] * bb_ce
# If standard DiMP classifier is used
loss_target_classifier = 0
loss_test_init_clf = 0
loss_test_iter_clf = 0
if 'test_clf' in self.loss_weight.keys():
# Classification losses for the different optimization iterations
clf_losses_test = [self.objective['test_clf'](s, data['test_label'], data['test_anno']) for s in target_scores]
# Loss of the final filter
clf_loss_test = clf_losses_test[-1]
loss_target_classifier = self.loss_weight['test_clf'] * clf_loss_test
# Loss for the initial filter iteration
if 'test_init_clf' in self.loss_weight.keys():
loss_test_init_clf = self.loss_weight['test_init_clf'] * clf_losses_test[0]
# Loss for the intermediate filter iterations
if 'test_iter_clf' in self.loss_weight.keys():
test_iter_weights = self.loss_weight['test_iter_clf']
if isinstance(test_iter_weights, list):
loss_test_iter_clf = sum([a * b for a, b in zip(test_iter_weights, clf_losses_test[1:-1])])
else:
loss_test_iter_clf = (test_iter_weights / (len(clf_losses_test) - 2)) * sum(clf_losses_test[1:-1])
# If PrDiMP classifier is used
loss_clf_ce = 0
loss_clf_ce_init = 0
loss_clf_ce_iter = 0
if 'clf_ce' in self.loss_weight.keys():
# Classification losses for the different optimization iterations
clf_ce_losses = [self.objective['clf_ce'](s, data['test_label_density'], grid_dim=(-2,-1)) for s in target_scores]
# Loss of the final filter
clf_ce = clf_ce_losses[-1]
loss_clf_ce = self.loss_weight['clf_ce'] * clf_ce
# Loss for the initial filter iteration
if 'clf_ce_init' in self.loss_weight.keys():
loss_clf_ce_init = self.loss_weight['clf_ce_init'] * clf_ce_losses[0]
# Loss for the intermediate filter iterations
if 'clf_ce_iter' in self.loss_weight.keys() and len(clf_ce_losses) > 2:
test_iter_weights = self.loss_weight['clf_ce_iter']
if isinstance(test_iter_weights, list):
loss_clf_ce_iter = sum([a * b for a, b in zip(test_iter_weights, clf_ce_losses[1:-1])])
else:
loss_clf_ce_iter = (test_iter_weights / (len(clf_ce_losses) - 2)) * sum(clf_ce_losses[1:-1])
# Total loss
loss = loss_bb_ce + loss_clf_ce + loss_clf_ce_init + loss_clf_ce_iter + \
loss_target_classifier + loss_test_init_clf + loss_test_iter_clf
if torch.isinf(loss) or torch.isnan(loss):
raise Exception('ERROR: Loss was nan or inf!!!')
# Log stats
stats = {'Loss/total': loss.item(),
'Loss/bb_ce': bb_ce.item(),
'Loss/loss_bb_ce': loss_bb_ce.item()}
if 'test_clf' in self.loss_weight.keys():
stats['Loss/target_clf'] = loss_target_classifier.item()
if 'test_init_clf' in self.loss_weight.keys():
stats['Loss/test_init_clf'] = loss_test_init_clf.item()
if 'test_iter_clf' in self.loss_weight.keys():
stats['Loss/test_iter_clf'] = loss_test_iter_clf.item()
if 'clf_ce' in self.loss_weight.keys():
stats['Loss/clf_ce'] = loss_clf_ce.item()
if 'clf_ce_init' in self.loss_weight.keys():
stats['Loss/clf_ce_init'] = loss_clf_ce_init.item()
if 'clf_ce_iter' in self.loss_weight.keys() and len(clf_ce_losses) > 2:
stats['Loss/clf_ce_iter'] = loss_clf_ce_iter.item()
if 'test_clf' in self.loss_weight.keys():
stats['ClfTrain/test_loss'] = clf_loss_test.item()
if len(clf_losses_test) > 0:
stats['ClfTrain/test_init_loss'] = clf_losses_test[0].item()
if len(clf_losses_test) > 2:
stats['ClfTrain/test_iter_loss'] = sum(clf_losses_test[1:-1]).item() / (len(clf_losses_test) - 2)
if 'clf_ce' in self.loss_weight.keys():
stats['ClfTrain/clf_ce'] = clf_ce.item()
if len(clf_ce_losses) > 0:
stats['ClfTrain/clf_ce_init'] = clf_ce_losses[0].item()
if len(clf_ce_losses) > 2:
stats['ClfTrain/clf_ce_iter'] = sum(clf_ce_losses[1:-1]).item() / (len(clf_ce_losses) - 2)
return loss, stats
================================================
FILE: artrackv2_mindspore/external/AR/ltr/admin/__init__.py
================================================
================================================
FILE: artrackv2_mindspore/external/AR/ltr/admin/environment.py
================================================
import importlib
import os
from collections import OrderedDict
def create_default_local_file():
path = os.path.join(os.path.dirname(__file__), 'local.py')
empty_str = '\'\''
default_settings = OrderedDict({
'workspace_dir': empty_str,
'tensorboard_dir': 'self.workspace_dir + \'/tensorboard/\'',
'lasot_dir': empty_str,
'got10k_dir': empty_str,
'trackingnet_dir': empty_str,
'coco_dir': empty_str,
'lvis_dir': empty_str,
'sbd_dir': empty_str,
'imagenet_dir': empty_str,
'imagenetdet_dir': empty_str,
'ecssd_dir': empty_str,
'hkuis_dir': empty_str,
'msra10k_dir': empty_str,
'davis_dir': empty_str,
'youtubevos_dir': empty_str})
comment = {'workspace_dir': 'Base directory for saving network checkpoints.',
'tensorboard_dir': 'Directory for tensorboard files.'}
with open(path, 'w') as f:
f.write('class EnvironmentSettings:\n')
f.write(' def __init__(self):\n')
for attr, attr_val in default_settings.items():
comment_str = None
if attr in comment:
comment_str = comment[attr]
if comment_str is None:
f.write(' self.{} = {}\n'.format(attr, attr_val))
else:
f.write(' self.{} = {} # {}\n'.format(attr, attr_val, comment_str))
def env_settings():
env_module_name = 'ltr.admin.local'
try:
env_module = importlib.import_module(env_module_name)
return env_module.EnvironmentSettings()
except:
env_file = os.path.join(os.path.dirname(__file__), 'local.py')
create_default_local_file()
raise RuntimeError('YOU HAVE NOT SETUP YOUR local.py!!!\n Go to "{}" and set all the paths you need. Then try to run again.'.format(env_file))
================================================
FILE: artrackv2_mindspore/external/AR/ltr/admin/loading.py
================================================
import torch
import os
import sys
from pathlib import Path
import importlib
import inspect
from ltr.admin import settings as ws_settings
def load_trained_network(workspace_dir, network_path, checkpoint=None):
"""OUTDATED. Use load_pretrained instead!"""
checkpoint_dir = os.path.join(workspace_dir, 'checkpoints')
directory = '{}/{}'.format(checkpoint_dir, network_path)
net, _ = load_network(directory, checkpoint)
return net
def load_pretrained(module, name, checkpoint=None, **kwargs):
"""Load a network trained using the LTR framework. This is useful when you want to initialize your new network with
a previously trained model.
args:
module - Name of the train script module. I.e. the name of the folder in ltr/train_scripts.
name - The name of the train_script.
checkpoint - You can supply the checkpoint number or the full path to the checkpoint file (see load_network).
**kwargs - These are passed to load_network (see that function).
"""
settings = ws_settings.Settings()
network_dir = os.path.join(settings.env.workspace_dir, 'checkpoints', 'ltr', module, name)
return load_network(network_dir=network_dir, checkpoint=checkpoint, **kwargs)
def load_network(network_dir=None, checkpoint=None, constructor_fun_name=None, constructor_module=None, **kwargs):
"""Loads a network checkpoint file.
Can be called in two different ways:
load_checkpoint(network_dir):
Loads the checkpoint file given by the path. If checkpoint_dir is a directory,
it tries to find the latest checkpoint in that directory.
load_checkpoint(network_dir, checkpoint=epoch_num):
Loads the network at the given epoch number (int).
The extra keyword arguments are supplied to the network constructor to replace saved ones.
"""
if network_dir is not None:
net_path = Path(network_dir)
else:
net_path = None
if net_path.is_file():
checkpoint = str(net_path)
if checkpoint is None:
# Load most recent checkpoint
checkpoint_list = sorted(net_path.glob('*.pth.tar'))
if checkpoint_list:
checkpoint_path = checkpoint_list[-1]
else:
raise Exception('No matching checkpoint file found')
elif isinstance(checkpoint, int):
# Checkpoint is the epoch number
checkpoint_list = sorted(net_path.glob('*_ep{:04d}.pth.tar'.format(checkpoint)))
if not checkpoint_list or len(checkpoint_list) == 0:
raise Exception('No matching checkpoint file found')
if len(checkpoint_list) > 1:
raise Exception('Multiple matching checkpoint files found')
else:
checkpoint_path = checkpoint_list[0]
elif isinstance(checkpoint, str):
# Checkpoint is the path
checkpoint_path = os.path.expanduser(checkpoint)
else:
raise TypeError
# Load network
checkpoint_dict = torch_load_legacy(checkpoint_path)
# Construct network model
if 'constructor' in checkpoint_dict and checkpoint_dict['constructor'] is not None:
net_constr = checkpoint_dict['constructor']
if constructor_fun_name is not None:
net_constr.fun_name = constructor_fun_name
if constructor_module is not None:
net_constr.fun_module = constructor_module
# Legacy networks before refactoring
if net_constr.fun_module.startswith('dlframework.'):
net_constr.fun_module = net_constr.fun_module[len('dlframework.'):]
net_fun = getattr(importlib.import_module(net_constr.fun_module), net_constr.fun_name)
net_fun_args = list(inspect.signature(net_fun).parameters.keys())
for arg, val in kwargs.items():
if arg in net_fun_args:
net_constr.kwds[arg] = val
else:
print('WARNING: Keyword argument "{}" not found when loading network. It was ignored.'.format(arg))
net = net_constr.get()
else:
raise RuntimeError('No constructor for the given network.')
net.load_state_dict(checkpoint_dict['net'])
net.constructor = checkpoint_dict['constructor']
if 'net_info' in checkpoint_dict and checkpoint_dict['net_info'] is not None:
net.info = checkpoint_dict['net_info']
return net, checkpoint_dict
def load_weights(net, path, strict=True):
checkpoint_dict = torch.load(path)
weight_dict = checkpoint_dict['net']
net.load_state_dict(weight_dict, strict=strict)
return net
def torch_load_legacy(path):
"""Load network with legacy environment."""
# Setup legacy env (for older networks)
_setup_legacy_env()
# Load network
checkpoint_dict = torch.load(path, map_location='cpu')
# Cleanup legacy
_cleanup_legacy_env()
return checkpoint_dict
def _setup_legacy_env():
importlib.import_module('ltr')
sys.modules['dlframework'] = sys.modules['ltr']
sys.modules['dlframework.common'] = sys.modules['ltr']
importlib.import_module('ltr.admin')
sys.modules['dlframework.common.utils'] = sys.modules['ltr.admin']
for m in ('model_constructor', 'stats', 'settings', 'local'):
importlib.import_module('ltr.admin.' + m)
sys.modules['dlframework.common.utils.' + m] = sys.modules['ltr.admin.' + m]
def _cleanup_legacy_env():
del_modules = []
for m in sys.modules.keys():
if m.startswith('dlframework'):
del_modules.append(m)
for m in del_modules:
del sys.modules[m]
================================================
FILE: artrackv2_mindspore/external/AR/ltr/admin/model_constructor.py
================================================
from functools import wraps
import importlib
def model_constructor(f):
""" Wraps the function 'f' which returns the network. An extra field 'constructor' is added to the network returned
by 'f'. This field contains an instance of the 'NetConstructor' class, which contains the information needed to
re-construct the network, such as the name of the function 'f', the function arguments etc. Thus, the network can
be easily constructed from a saved checkpoint by calling NetConstructor.get() function.
"""
@wraps(f)
def f_wrapper(*args, **kwds):
net_constr = NetConstructor(f.__name__, f.__module__, args, kwds)
output = f(*args, **kwds)
if isinstance(output, (tuple, list)):
# Assume first argument is the network
output[0].constructor = net_constr
else:
output.constructor = net_constr
return output
return f_wrapper
class NetConstructor:
""" Class to construct networks. Takes as input the function name (e.g. atom_resnet18), the name of the module
which contains the network function (e.g. ltr.models.bbreg.atom) and the arguments for the network
function. The class object can then be stored along with the network weights to re-construct the network."""
def __init__(self, fun_name, fun_module, args, kwds):
"""
args:
fun_name - The function which returns the network
fun_module - the module which contains the network function
args - arguments which are passed to the network function
kwds - arguments which are passed to the network function
"""
self.fun_name = fun_name
self.fun_module = fun_module
self.args = args
self.kwds = kwds
def get(self):
""" Rebuild the network by calling the network function with the correct arguments. """
net_module = importlib.import_module(self.fun_module)
net_fun = getattr(net_module, self.fun_name)
return net_fun(*self.args, **self.kwds)
================================================
FILE: artrackv2_mindspore/external/AR/ltr/admin/multigpu.py
================================================
import torch.nn as nn
def is_multi_gpu(net):
return isinstance(net, (MultiGPU, nn.DataParallel))
class MultiGPU(nn.DataParallel):
"""Wraps a network to allow simple multi-GPU training."""
def __getattr__(self, item):
try:
return super().__getattr__(item)
except:
pass
return getattr(self.module, item)
================================================
FILE: artrackv2_mindspore/external/AR/ltr/admin/settings.py
================================================
from ltr.admin.environment import env_settings
class Settings:
""" Training settings, e.g. the paths to datasets and networks."""
def __init__(self):
self.set_default()
def set_default(self):
self.env = env_settings()
self.use_gpu = True
================================================
FILE: artrackv2_mindspore/external/AR/ltr/admin/stats.py
================================================
class StatValue:
def __init__(self):
self.clear()
def reset(self):
self.val = 0
def clear(self):
self.reset()
self.history = []
def update(self, val):
self.val = val
self.history.append(self.val)
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.clear()
self.has_new_data = False
def reset(self):
self.avg = 0
self.val = 0
self.sum = 0
self.count = 0
def clear(self):
self.reset()
self.history = []
def update(self, val, n=1):
self.val = val
self.sum += val * n
self.count += n
self.avg = self.sum / self.count
def new_epoch(self):
if self.count > 0:
self.history.append(self.avg)
self.reset()
self.has_new_data = True
else:
self.has_new_data = False
def topk_accuracy(output, target, topk=(1,)):
"""Computes the precision@k for the specified values of k"""
single_input = not isinstance(topk, (tuple, list))
if single_input:
topk = (topk,)
maxk = max(topk)
batch_size = target.size(0)
_, pred = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = pred.eq(target.view(1, -1).expand_as(pred))
res = []
for k in topk:
correct_k = correct[:k].view(-1).float().sum(0, keepdim=True)[0]
res.append(correct_k * 100.0 / batch_size)
if single_input:
return res[0]
return res
================================================
FILE: artrackv2_mindspore/external/AR/ltr/admin/tensorboard.py
================================================
import os
from collections import OrderedDict
try:
from torch.utils.tensorboard import SummaryWriter
except:
print('WARNING: You are using tensorboardX instead sis you have a too old pytorch version.')
from tensorboardX import SummaryWriter
class TensorboardWriter:
def __init__(self, directory, loader_names):
self.directory = directory
self.writer = OrderedDict({name: SummaryWriter(os.path.join(self.directory, name)) for name in loader_names})
def write_info(self, module_name, script_name, description):
tb_info_writer = SummaryWriter(os.path.join(self.directory, 'info'))
tb_info_writer.add_text('Modulet_name', module_name)
tb_info_writer.add_text('Script_name', script_name)
tb_info_writer.add_text('Description', description)
tb_info_writer.close()
def write_epoch(self, stats: OrderedDict, epoch: int, ind=-1):
for loader_name, loader_stats in stats.items():
if loader_stats is None:
continue
for var_name, val in loader_stats.items():
if hasattr(val, 'history') and getattr(val, 'has_new_data', True):
self.writer[loader_name].add_scalar(var_name, val.history[ind], epoch)
================================================
FILE: artrackv2_mindspore/external/AR/ltr/data/__init__.py
================================================
from .loader import LTRLoader
================================================
FILE: artrackv2_mindspore/external/AR/ltr/data/bounding_box_utils.py
================================================
import torch
def rect_to_rel(bb, sz_norm=None):
"""Convert standard rectangular parametrization of the bounding box [x, y, w, h]
to relative parametrization [cx/sw, cy/sh, log(w), log(h)], where [cx, cy] is the center coordinate.
args:
bb - N x 4 tensor of boxes.
sz_norm - [N] x 2 tensor of value of [sw, sh] (optional). sw=w and sh=h if not given.
"""
c = bb[...,:2] + 0.5 * bb[...,2:]
if sz_norm is None:
c_rel = c / bb[...,2:]
else:
c_rel = c / sz_norm
sz_rel = torch.log(bb[...,2:])
return torch.cat((c_rel, sz_rel), dim=-1)
def rel_to_rect(bb, sz_norm=None):
"""Inverts the effect of rect_to_rel. See above."""
sz = torch.exp(bb[...,2:])
if sz_norm is None:
c = bb[...,:2] * sz
else:
c = bb[...,:2] * sz_norm
tl = c - 0.5 * sz
return torch.cat((tl, sz), dim=-1)
def masks_to_bboxes(mask, fmt='c'):
""" Convert a mask tensor to one or more bounding boxes.
Note: This function is a bit new, make sure it does what it says. /Andreas
:param mask: Tensor of masks, shape = (..., H, W)
:param fmt: bbox layout. 'c' => "center + size" or (x_center, y_center, width, height)
't' => "top left + size" or (x_left, y_top, width, height)
'v' => "vertices" or (x_left, y_top, x_right, y_bottom)
:return: tensor containing a batch of bounding boxes, shape = (..., 4)
"""
batch_shape = mask.shape[:-2]
mask = mask.reshape((-1, *mask.shape[-2:]))
bboxes = []
for m in mask:
mx = m.sum(dim=-2).nonzero()
my = m.sum(dim=-1).nonzero()
bb = [mx.min(), my.min(), mx.max(), my.max()] if (len(mx) > 0 and len(my) > 0) else [0, 0, 0, 0]
bboxes.append(bb)
bboxes = torch.tensor(bboxes, dtype=torch.float32, device=mask.device)
bboxes = bboxes.reshape(batch_shape + (4,))
if fmt == 'v':
return bboxes
x1 = bboxes[..., :2]
s = bboxes[..., 2:] - x1 + 1
if fmt == 'c':
return torch.cat((x1 + 0.5 * s, s), dim=-1)
elif fmt == 't':
return torch.cat((x1, s), dim=-1)
raise ValueError("Undefined bounding box layout '%s'" % fmt)
def masks_to_bboxes_multi(mask, ids, fmt='c'):
assert mask.dim() == 2
bboxes = []
for id in ids:
mx = (mask == id).sum(dim=-2).nonzero()
my = (mask == id).float().sum(dim=-1).nonzero()
bb = [mx.min(), my.min(), mx.max(), my.max()] if (len(mx) > 0 and len(my) > 0) else [0, 0, 0, 0]
bb = torch.tensor(bb, dtype=torch.float32, device=mask.device)
x1 = bb[:2]
s = bb[2:] - x1 + 1
if fmt == 'v':
pass
elif fmt == 'c':
bb = torch.cat((x1 + 0.5 * s, s), dim=-1)
elif fmt == 't':
bb = torch.cat((x1, s), dim=-1)
else:
raise ValueError("Undefined bounding box layout '%s'" % fmt)
bboxes.append(bb)
return bboxes
================================================
FILE: artrackv2_mindspore/external/AR/ltr/data/image_loader.py
================================================
import jpeg4py
import cv2 as cv
from PIL import Image
import numpy as np
davis_palette = np.repeat(np.expand_dims(np.arange(0,256), 1), 3, 1).astype(np.uint8)
davis_palette[:22, :] = [[0, 0, 0], [128, 0, 0], [0, 128, 0], [128, 128, 0],
[0, 0, 128], [128, 0, 128], [0, 128, 128], [128, 128, 128],
[64, 0, 0], [191, 0, 0], [64, 128, 0], [191, 128, 0],
[64, 0, 128], [191, 0, 128], [64, 128, 128], [191, 128, 128],
[0, 64, 0], [128, 64, 0], [0, 191, 0], [128, 191, 0],
[0, 64, 128], [128, 64, 128]]
def default_image_loader(path):
"""The default image loader, reads the image from the given path. It first tries to use the jpeg4py_loader,
but reverts to the opencv_loader if the former is not available."""
if default_image_loader.use_jpeg4py is None:
# Try using jpeg4py
im = jpeg4py_loader(path)
if im is None:
default_image_loader.use_jpeg4py = False
print('Using opencv_loader instead.')
else:
default_image_loader.use_jpeg4py = True
return im
if default_image_loader.use_jpeg4py:
return jpeg4py_loader(path)
return opencv_loader(path)
default_image_loader.use_jpeg4py = None
def jpeg4py_loader(path):
""" Image reading using jpeg4py https://github.com/ajkxyz/jpeg4py"""
try:
return jpeg4py.JPEG(path).decode()
except Exception as e:
print('ERROR: Could not read image "{}"'.format(path))
print(e)
return None
def opencv_loader(path):
""" Read image using opencv's imread function and returns it in rgb format"""
try:
im = cv.imread(path, cv.IMREAD_COLOR)
# convert to rgb and return
return cv.cvtColor(im, cv.COLOR_BGR2RGB)
except Exception as e:
print('ERROR: Could not read image "{}"'.format(path))
print(e)
return None
def jpeg4py_loader_w_failsafe(path):
""" Image reading using jpeg4py https://github.com/ajkxyz/jpeg4py"""
try:
return jpeg4py.JPEG(path).decode()
except:
try:
im = cv.imread(path, cv.IMREAD_COLOR)
# convert to rgb and return
return cv.cvtColor(im, cv.COLOR_BGR2RGB)
except Exception as e:
print('ERROR: Could not read image "{}"'.format(path))
print(e)
return None
def opencv_seg_loader(path):
""" Read segmentation annotation using opencv's imread function"""
try:
return cv.imread(path)
except Exception as e:
print('ERROR: Could not read image "{}"'.format(path))
print(e)
return None
def imread_indexed(filename):
""" Load indexed image with given filename. Used to read segmentation annotations."""
im = Image.open(filename)
annotation = np.atleast_3d(im)[...,0]
return annotation
def imwrite_indexed(filename, array, color_palette=None):
""" Save indexed image as png. Used to save segmentation annotation."""
if color_palette is None:
color_palette = davis_palette
if np.atleast_3d(array).shape[2] != 1:
raise Exception("Saving indexed PNGs requires 2D array.")
im = Image.fromarray(array)
im.putpalette(color_palette.ravel())
im.save(filename, format='PNG')
================================================
FILE: artrackv2_mindspore/external/AR/ltr/data/loader.py
================================================
import torch
import torch.utils.data.dataloader
import importlib
import collections
from torch._six import string_classes, int_classes
from pytracking import TensorDict, TensorList
def _check_use_shared_memory():
if hasattr(torch.utils.data.dataloader, '_use_shared_memory'):
return getattr(torch.utils.data.dataloader, '_use_shared_memory')
collate_lib = importlib.import_module('torch.utils.data._utils.collate')
if hasattr(collate_lib, '_use_shared_memory'):
return getattr(collate_lib, '_use_shared_memory')
return torch.utils.data.get_worker_info() is not None
def ltr_collate(batch):
"""Puts each data field into a tensor with outer dimension batch size"""
error_msg = "batch must contain tensors, numbers, dicts or lists; found {}"
elem_type = type(batch[0])
if isinstance(batch[0], torch.Tensor):
out = None
if _check_use_shared_memory():
# If we're in a background process, concatenate directly into a
# shared memory tensor to avoid an extra copy
numel = sum([x.numel() for x in batch])
storage = batch[0].storage()._new_shared(numel)
out = batch[0].new(storage)
return torch.stack(batch, 0, out=out)
# if batch[0].dim() < 4:
# return torch.stack(batch, 0, out=out)
# return torch.cat(batch, 0, out=out)
elif elem_type.__module__ == 'numpy' and elem_type.__name__ != 'str_' \
and elem_type.__name__ != 'string_':
elem = batch[0]
if elem_type.__name__ == 'ndarray':
# array of string classes and object
if torch.utils.data.dataloader.re.search('[SaUO]', elem.dtype.str) is not None:
raise TypeError(error_msg.format(elem.dtype))
return torch.stack([torch.from_numpy(b) for b in batch], 0)
if elem.shape == (): # scalars
py_type = float if elem.dtype.name.startswith('float') else int
return torch.utils.data.dataloader.numpy_type_map[elem.dtype.name](list(map(py_type, batch)))
elif isinstance(batch[0], int_classes):
return torch.LongTensor(batch)
elif isinstance(batch[0], float):
return torch.DoubleTensor(batch)
elif isinstance(batch[0], string_classes):
return batch
elif isinstance(batch[0], TensorDict):
return TensorDict({key: ltr_collate([d[key] for d in batch]) for key in batch[0]})
elif isinstance(batch[0], collections.Mapping):
return {key: ltr_collate([d[key] for d in batch]) for key in batch[0]}
elif isinstance(batch[0], TensorList):
transposed = zip(*batch)
return TensorList([ltr_collate(samples) for samples in transposed])
elif isinstance(batch[0], collections.Sequence):
transposed = zip(*batch)
return [ltr_collate(samples) for samples in transposed]
elif batch[0] is None:
return batch
raise TypeError((error_msg.format(type(batch[0]))))
def ltr_collate_stack1(batch):
"""Puts each data field into a tensor. The tensors are stacked at dim=1 to form the batch"""
error_msg = "batch must contain tensors, numbers, dicts or lists; found {}"
elem_type = type(batch[0])
if isinstance(batch[0], torch.Tensor):
out = None
if _check_use_shared_memory():
# If we're in a background process, concatenate directly into a
# shared memory tensor to avoid an extra copy
numel = sum([x.numel() for x in batch])
storage = batch[0].storage()._new_shared(numel)
out = batch[0].new(storage)
return torch.stack(batch, 1, out=out)
# if batch[0].dim() < 4:
# return torch.stack(batch, 0, out=out)
# return torch.cat(batch, 0, out=out)
elif elem_type.__module__ == 'numpy' and elem_type.__name__ != 'str_' \
and elem_type.__name__ != 'string_':
elem = batch[0]
if elem_type.__name__ == 'ndarray':
# array of string classes and object
if torch.utils.data.dataloader.re.search('[SaUO]', elem.dtype.str) is not None:
raise TypeError(error_msg.format(elem.dtype))
return torch.stack([torch.from_numpy(b) for b in batch], 1)
if elem.shape == (): # scalars
py_type = float if elem.dtype.name.startswith('float') else int
return torch.utils.data.dataloader.numpy_type_map[elem.dtype.name](list(map(py_type, batch)))
elif isinstance(batch[0], int_classes):
return torch.LongTensor(batch)
elif isinstance(batch[0], float):
return torch.DoubleTensor(batch)
elif isinstance(batch[0], string_classes):
return batch
elif isinstance(batch[0], TensorDict):
return TensorDict({key: ltr_collate_stack1([d[key] for d in batch]) for key in batch[0]})
elif isinstance(batch[0], collections.Mapping):
return {key: ltr_collate_stack1([d[key] for d in batch]) for key in batch[0]}
elif isinstance(batch[0], TensorList):
transposed = zip(*batch)
return TensorList([ltr_collate_stack1(samples) for samples in transposed])
elif isinstance(batch[0], collections.Sequence):
transposed = zip(*batch)
return [ltr_collate_stack1(samples) for samples in transposed]
elif batch[0] is None:
return batch
raise TypeError((error_msg.format(type(batch[0]))))
class LTRLoader(torch.utils.data.dataloader.DataLoader):
"""
Data loader. Combines a dataset and a sampler, and provides
single- or multi-process iterators over the dataset.
Note: The only difference with default pytorch DataLoader is that an additional option stack_dim is available to
select along which dimension the data should be stacked to form a batch.
Arguments:
dataset (Dataset): dataset from which to load the data.
batch_size (int, optional): how many samples per batch to load
(default: 1).
shuffle (bool, optional): set to ``True`` to have the data reshuffled
at every epoch (default: False).
sampler (Sampler, optional): defines the strategy to draw samples from
the dataset. If specified, ``shuffle`` must be False.
batch_sampler (Sampler, optional): like sampler, but returns a batch of
indices at a time. Mutually exclusive with batch_size, shuffle,
sampler, and drop_last.
num_workers (int, optional): how many subprocesses to use for data
loading. 0 means that the data will be loaded in the main process.
(default: 0)
collate_fn (callable, optional): merges a list of samples to form a mini-batch.
stack_dim (int): Dimension along which to stack to form the batch. (default: 0)
pin_memory (bool, optional): If ``True``, the data loader will copy tensors
into CUDA pinned memory before returning them.
drop_last (bool, optional): set to ``True`` to drop the last incomplete batch,
if the dataset size is not divisible by the batch size. If ``False`` and
the size of dataset is not divisible by the batch size, then the last batch
will be smaller. (default: False)
timeout (numeric, optional): if positive, the timeout value for collecting a batch
from workers. Should always be non-negative. (default: 0)
worker_init_fn (callable, optional): If not None, this will be called on each
worker subprocess with the worker id (an int in ``[0, num_workers - 1]``) as
input, after seeding and before data loading. (default: None)
.. note:: By default, each worker will have its PyTorch seed set to
``base_seed + worker_id``, where ``base_seed`` is a long generated
by main process using its RNG. However, seeds for other libraies
may be duplicated upon initializing workers (w.g., NumPy), causing
each worker to return identical random numbers. (See
:ref:`dataloader-workers-random-seed` section in FAQ.) You may
use ``torch.initial_seed()`` to access the PyTorch seed for each
worker in :attr:`worker_init_fn`, and use it to set other seeds
before data loading.
.. warning:: If ``spawn`` start method is used, :attr:`worker_init_fn` cannot be an
unpicklable object, e.g., a lambda function.
"""
__initialized = False
def __init__(self, name, dataset, training=True, batch_size=1, shuffle=False, sampler=None, batch_sampler=None,
num_workers=0, epoch_interval=1, collate_fn=None, stack_dim=0, pin_memory=False, drop_last=False,
timeout=0, worker_init_fn=None):
if collate_fn is None:
if stack_dim == 0:
collate_fn = ltr_collate
elif stack_dim == 1:
collate_fn = ltr_collate_stack1
else:
raise ValueError('Stack dim no supported. Must be 0 or 1.')
super(LTRLoader, self).__init__(dataset, batch_size, shuffle, sampler, batch_sampler,
num_workers, collate_fn, pin_memory, drop_last,
timeout, worker_init_fn)
self.name = name
self.training = training
self.epoch_interval = epoch_interval
self.stack_dim = stack_dim
================================================
FILE: artrackv2_mindspore/external/AR/ltr/data/processing.py
================================================
import torch
import torchvision.transforms as transforms
from pytracking import TensorDict
import ltr.data.processing_utils as prutils
def stack_tensors(x):
if isinstance(x, (list, tuple)) and isinstance(x[0], torch.Tensor):
return torch.stack(x)
return x
class BaseProcessing:
""" Base class for Processing. Processing class is used to process the data returned by a dataset, before passing it
through the network. For example, it can be used to crop a search region around the object, apply various data
augmentations, etc."""
def __init__(self, transform=transforms.ToTensor(), train_transform=None, test_transform=None, joint_transform=None):
"""
args:
transform - The set of transformations to be applied on the images. Used only if train_transform or
test_transform is None.
train_transform - The set of transformations to be applied on the train images. If None, the 'transform'
argument is used instead.
test_transform - The set of transformations to be applied on the test images. If None, the 'transform'
argument is used instead.
joint_transform - The set of transformations to be applied 'jointly' on the train and test images. For
example, it can be used to convert both test and train images to grayscale.
"""
self.transform = {'train': transform if train_transform is None else train_transform,
'test': transform if test_transform is None else test_transform,
'joint': joint_transform}
def __call__(self, data: TensorDict):
raise NotImplementedError
class ATOMProcessing(BaseProcessing):
""" The processing class used for training ATOM. The images are processed in the following way.
First, the target bounding box is jittered by adding some noise. Next, a square region (called search region )
centered at the jittered target center, and of area search_area_factor^2 times the area of the jittered box is
cropped from the image. The reason for jittering the target box is to avoid learning the bias that the target is
always at the center of the search region. The search region is then resized to a fixed size given by the
argument output_sz. A set of proposals are then generated for the test images by jittering the ground truth box.
"""
def __init__(self, search_area_factor, output_sz, center_jitter_factor, scale_jitter_factor, proposal_params,
mode='pair', *args, **kwargs):
"""
args:
search_area_factor - The size of the search region relative to the target size.
output_sz - An integer, denoting the size to which the search region is resized. The search region is always
square.
center_jitter_factor - A dict containing the amount of jittering to be applied to the target center before
extracting the search region. See _get_jittered_box for how the jittering is done.
scale_jitter_factor - A dict containing the amount of jittering to be applied to the target size before
extracting the search region. See _get_jittered_box for how the jittering is done.
proposal_params - Arguments for the proposal generation process. See _generate_proposals for details.
mode - Either 'pair' or 'sequence'. If mode='sequence', then output has an extra dimension for frames
"""
super().__init__(*args, **kwargs)
self.search_area_factor = search_area_factor
self.output_sz = output_sz
self.center_jitter_factor = center_jitter_factor
self.scale_jitter_factor = scale_jitter_factor
self.proposal_params = proposal_params
self.mode = mode
def _get_jittered_box(self, box, mode):
""" Jitter the input box
args:
box - input bounding box
mode - string 'train' or 'test' indicating train or test data
returns:
torch.Tensor - jittered box
"""
jittered_size = box[2:4] * torch.exp(torch.randn(2) * self.scale_jitter_factor[mode])
max_offset = (jittered_size.prod().sqrt() * torch.tensor(self.center_jitter_factor[mode]).float())
jittered_center = box[0:2] + 0.5 * box[2:4] + max_offset * (torch.rand(2) - 0.5)
return torch.cat((jittered_center - 0.5 * jittered_size, jittered_size), dim=0)
def _generate_proposals(self, box):
""" Generates proposals by adding noise to the input box
args:
box - input box
returns:
torch.Tensor - Array of shape (num_proposals, 4) containing proposals
torch.Tensor - Array of shape (num_proposals,) containing IoU overlap of each proposal with the input box. The
IoU is mapped to [-1, 1]
"""
# Generate proposals
num_proposals = self.proposal_params['boxes_per_frame']
proposal_method = self.proposal_params.get('proposal_method', 'default')
if proposal_method == 'default':
proposals = torch.zeros((num_proposals, 4))
gt_iou = torch.zeros(num_proposals)
for i in range(num_proposals):
proposals[i, :], gt_iou[i] = prutils.perturb_box(box, min_iou=self.proposal_params['min_iou'],
sigma_factor=self.proposal_params['sigma_factor'])
elif proposal_method == 'gmm':
proposals, _, _ = prutils.sample_box_gmm(box, self.proposal_params['proposal_sigma'],
num_samples=num_proposals)
gt_iou = prutils.iou(box.view(1,4), proposals.view(-1,4))
# Map to [-1, 1]
gt_iou = gt_iou * 2 - 1
return proposals, gt_iou
def __call__(self, data: TensorDict):
"""
args:
data - The input data, should contain the following fields:
'train_images', test_images', 'train_anno', 'test_anno'
returns:
TensorDict - output data block with following fields:
'train_images', 'test_images', 'train_anno', 'test_anno', 'test_proposals', 'proposal_iou'
"""
# Apply joint transforms
if self.transform['joint'] is not None:
data['train_images'], data['train_anno'] = self.transform['joint'](image=data['train_images'], bbox=data['train_anno'])
data['test_images'], data['test_anno'] = self.transform['joint'](image=data['test_images'], bbox=data['test_anno'], new_roll=False)
for s in ['train', 'test']:
assert self.mode == 'sequence' or len(data[s + '_images']) == 1, \
"In pair mode, num train/test frames must be 1"
# Add a uniform noise to the center pos
jittered_anno = [self._get_jittered_box(a, s) for a in data[s + '_anno']]
# Crop image region centered at jittered_anno box
crops, boxes = prutils.jittered_center_crop(data[s + '_images'], jittered_anno, data[s + '_anno'],
self.search_area_factor, self.output_sz)
# Apply transforms
data[s + '_images'], data[s + '_anno'] = self.transform[s](image=crops, bbox=boxes, joint=False)
# Generate proposals
frame2_proposals, gt_iou = zip(*[self._generate_proposals(a) for a in data['test_anno']])
data['test_proposals'] = list(frame2_proposals)
data['proposal_iou'] = list(gt_iou)
# Prepare output
if self.mode == 'sequence':
data = data.apply(stack_tensors)
else:
data = data.apply(lambda x: x[0] if isinstance(x, list) else x)
return data
class KLBBregProcessing(BaseProcessing):
""" Based on ATOMProcessing. It supports training ATOM using the Maximum Likelihood or KL-divergence based learning
introduced in [https://arxiv.org/abs/1909.12297] and in PrDiMP [https://arxiv.org/abs/2003.12565].
"""
def __init__(self, search_area_factor, output_sz, center_jitter_factor, scale_jitter_factor, proposal_params,
mode='pair', *args, **kwargs):
"""
args:
search_area_factor - The size of the search region relative to the target size.
output_sz - An integer, denoting the size to which the search region is resized. The search region is always
square.
center_jitter_factor - A dict containing the amount of jittering to be applied to the target center before
extracting the search region. See _get_jittered_box for how the jittering is done.
scale_jitter_factor - A dict containing the amount of jittering to be applied to the target size before
extracting the search region. See _get_jittered_box for how the jittering is done.
proposal_params - Arguments for the proposal generation process. See _generate_proposals for details.
mode - Either 'pair' or 'sequence'. If mode='sequence', then output has an extra dimension for frames
"""
super().__init__(*args, **kwargs)
self.search_area_factor = search_area_factor
self.output_sz = output_sz
self.center_jitter_factor = center_jitter_factor
self.scale_jitter_factor = scale_jitter_factor
self.proposal_params = proposal_params
self.mode = mode
def _get_jittered_box(self, box, mode):
""" Jitter the input box
args:
box - input bounding box
mode - string 'train' or 'test' indicating train or test data
returns:
torch.Tensor - jittered box
"""
jittered_size = box[2:4] * torch.exp(torch.randn(2) * self.scale_jitter_factor[mode])
max_offset = (jittered_size.prod().sqrt() * torch.tensor(self.center_jitter_factor[mode]).float())
jittered_center = box[0:2] + 0.5 * box[2:4] + max_offset * (torch.rand(2) - 0.5)
return torch.cat((jittered_center - 0.5 * jittered_size, jittered_size), dim=0)
def _generate_proposals(self, box):
"""
"""
# Generate proposals
proposals, proposal_density, gt_density = prutils.sample_box_gmm(box, self.proposal_params['proposal_sigma'],
gt_sigma=self.proposal_params['gt_sigma'],
num_samples=self.proposal_params[
'boxes_per_frame'],
add_mean_box=self.proposal_params.get(
'add_mean_box', False))
return proposals, proposal_density, gt_density
def __call__(self, data: TensorDict):
"""
args:
data - The input data, should contain the following fields:
'train_images', test_images', 'train_anno', 'test_anno'
returns:
TensorDict - output data block with following fields:
'train_images', 'test_images', 'train_anno', 'test_anno', 'test_proposals', 'proposal_density', 'gt_density'
"""
# Apply joint transforms
if self.transform['joint'] is not None:
data['train_images'], data['train_anno'] = self.transform['joint'](image=data['train_images'], bbox=data['train_anno'])
data['test_images'], data['test_anno'] = self.transform['joint'](image=data['test_images'], bbox=data['test_anno'], new_roll=False)
for s in ['train', 'test']:
assert self.mode == 'sequence' or len(data[s + '_images']) == 1, \
"In pair mode, num train/test frames must be 1"
# Add a uniform noise to the center pos
jittered_anno = [self._get_jittered_box(a, s) for a in data[s + '_anno']]
# Crop image region centered at jittered_anno box
crops, boxes, _ = prutils.jittered_center_crop(data[s + '_images'], jittered_anno, data[s + '_anno'],
self.search_area_factor, self.output_sz)
# Apply transforms
data[s + '_images'], data[s + '_anno'] = self.transform[s](image=crops, bbox=boxes, joint=False)
# Generate proposals
proposals, proposal_density, gt_density = zip(*[self._generate_proposals(a) for a in data['test_anno']])
data['test_proposals'] = proposals
data['proposal_density'] = proposal_density
data['gt_density'] = gt_density
# Prepare output
if self.mode == 'sequence':
data = data.apply(stack_tensors)
else:
data = data.apply(lambda x: x[0] if isinstance(x, list) else x)
return data
class ATOMwKLProcessing(BaseProcessing):
"""Same as ATOMProcessing but using the GMM-based sampling of proposal boxes used in KLBBregProcessing."""
def __init__(self, search_area_factor, output_sz, center_jitter_factor, scale_jitter_factor, proposal_params,
mode='pair', *args, **kwargs):
super().__init__(*args, **kwargs)
self.search_area_factor = search_area_factor
self.output_sz = output_sz
self.center_jitter_factor = center_jitter_factor
self.scale_jitter_factor = scale_jitter_factor
self.proposal_params = proposal_params
self.mode = mode
def _get_jittered_box(self, box, mode):
""" Jitter the input box
args:
box - input bounding box
mode - string 'train' or 'test' indicating train or test data
returns:
torch.Tensor - jittered box
"""
jittered_size = box[2:4] * torch.exp(torch.randn(2) * self.scale_jitter_factor[mode])
max_offset = (jittered_size.prod().sqrt() * torch.tensor(self.center_jitter_factor[mode]).float())
jittered_center = box[0:2] + 0.5 * box[2:4] + max_offset * (torch.rand(2) - 0.5)
return torch.cat((jittered_center - 0.5 * jittered_size, jittered_size), dim=0)
def _generate_proposals(self, box):
"""
"""
# Generate proposals
proposals, proposal_density, gt_density = prutils.sample_box_gmm(box, self.proposal_params['proposal_sigma'],
self.proposal_params['gt_sigma'],
self.proposal_params['boxes_per_frame'])
iou = prutils.iou_gen(proposals, box.view(1, 4))
return proposals, proposal_density, gt_density, iou
def __call__(self, data: TensorDict):
# Apply joint transforms
if self.transform['joint'] is not None:
data['train_images'], data['train_anno'] = self.transform['joint'](image=data['train_images'], bbox=data['train_anno'])
data['test_images'], data['test_anno'] = self.transform['joint'](image=data['test_images'], bbox=data['test_anno'], new_roll=False)
for s in ['train', 'test']:
assert self.mode == 'sequence' or len(data[s + '_images']) == 1, \
"In pair mode, num train/test frames must be 1"
# Add a uniform noise to the center pos
jittered_anno = [self._get_jittered_box(a, s) for a in data[s + '_anno']]
# Crop image region centered at jittered_anno box
crops, boxes = prutils.jittered_center_crop(data[s + '_images'], jittered_anno, data[s + '_anno'],
self.search_area_factor, self.output_sz)
# Apply transforms
data[s + '_images'], data[s + '_anno'] = self.transform[s](image=crops, bbox=boxes, joint=False)
# Generate proposals
proposals, proposal_density, gt_density, proposal_iou = zip(
*[self._generate_proposals(a) for a in data['test_anno']])
data['test_proposals'] = proposals
data['proposal_density'] = proposal_density
data['gt_density'] = gt_density
data['proposal_iou'] = proposal_iou
# Prepare output
if self.mode == 'sequence':
data = data.apply(stack_tensors)
else:
data = data.apply(lambda x: x[0] if isinstance(x, list) else x)
return data
class DiMPProcessing(BaseProcessing):
""" The processing class used for training DiMP. The images are processed in the following way.
First, the target bounding box is jittered by adding some noise. Next, a square region (called search region )
centered at the jittered target center, and of area search_area_factor^2 times the area of the jittered box is
cropped from the image. The reason for jittering the target box is to avoid learning the bias that the target is
always at the center of the search region. The search region is then resized to a fixed size given by the
argument output_sz. A Gaussian label centered at the target is generated for each image. These label functions are
used for computing the loss of the predicted classification model on the test images. A set of proposals are
also generated for the test images by jittering the ground truth box. These proposals are used to train the
bounding box estimating branch.
"""
def __init__(self, search_area_factor, output_sz, center_jitter_factor, scale_jitter_factor, crop_type='replicate',
max_scale_change=None, mode='pair', proposal_params=None, label_function_params=None, *args, **kwargs):
"""
args:
search_area_factor - The size of the search region relative to the target size.
output_sz - An integer, denoting the size to which the search region is resized. The search region is always
square.
center_jitter_factor - A dict containing the amount of jittering to be applied to the target center before
extracting the search region. See _get_jittered_box for how the jittering is done.
scale_jitter_factor - A dict containing the amount of jittering to be applied to the target size before
extracting the search region. See _get_jittered_box for how the jittering is done.
crop_type - If 'replicate', the boundary pixels are replicated in case the search region crop goes out of image.
If 'inside', the search region crop is shifted/shrunk to fit completely inside the image.
If 'inside_major', the search region crop is shifted/shrunk to fit completely inside one axis of the image.
max_scale_change - Maximum allowed scale change when performing the crop (only applicable for 'inside' and 'inside_major')
mode - Either 'pair' or 'sequence'. If mode='sequence', then output has an extra dimension for frames
proposal_params - Arguments for the proposal generation process. See _generate_proposals for details.
label_function_params - Arguments for the label generation process. See _generate_label_function for details.
"""
super().__init__(*args, **kwargs)
self.search_area_factor = search_area_factor
self.output_sz = output_sz
self.center_jitter_factor = center_jitter_factor
self.scale_jitter_factor = scale_jitter_factor
self.crop_type = crop_type
self.mode = mode
self.max_scale_change = max_scale_change
self.proposal_params = proposal_params
self.label_function_params = label_function_params
def _get_jittered_box(self, box, mode):
""" Jitter the input box
args:
box - input bounding box
mode - string 'train' or 'test' indicating train or test data
returns:
torch.Tensor - jittered box
"""
jittered_size = box[2:4] * torch.exp(torch.randn(2) * self.scale_jitter_factor[mode])
max_offset = (jittered_size.prod().sqrt() * torch.tensor(self.center_jitter_factor[mode]).float())
jittered_center = box[0:2] + 0.5 * box[2:4] + max_offset * (torch.rand(2) - 0.5)
return torch.cat((jittered_center - 0.5 * jittered_size, jittered_size), dim=0)
def _generate_proposals(self, box):
""" Generates proposals by adding noise to the input box
args:
box - input box
returns:
torch.Tensor - Array of shape (num_proposals, 4) containing proposals
torch.Tensor - Array of shape (num_proposals,) containing IoU overlap of each proposal with the input box. The
IoU is mapped to [-1, 1]
"""
# Generate proposals
num_proposals = self.proposal_params['boxes_per_frame']
proposal_method = self.proposal_params.get('proposal_method', 'default')
if proposal_method == 'default':
proposals = torch.zeros((num_proposals, 4))
gt_iou = torch.zeros(num_proposals)
for i in range(num_proposals):
proposals[i, :], gt_iou[i] = prutils.perturb_box(box, min_iou=self.proposal_params['min_iou'],
sigma_factor=self.proposal_params['sigma_factor'])
elif proposal_method == 'gmm':
proposals, _, _ = prutils.sample_box_gmm(box, self.proposal_params['proposal_sigma'],
num_samples=num_proposals)
gt_iou = prutils.iou(box.view(1, 4), proposals.view(-1, 4))
else:
raise ValueError('Unknown proposal method.')
# Map to [-1, 1]
gt_iou = gt_iou * 2 - 1
return proposals, gt_iou
def _generate_label_function(self, target_bb):
""" Generates the gaussian label function centered at target_bb
args:
target_bb - target bounding box (num_images, 4)
returns:
torch.Tensor - Tensor of shape (num_images, label_sz, label_sz) containing the label for each sample
"""
gauss_label = prutils.gaussian_label_function(target_bb.view(-1, 4), self.label_function_params['sigma_factor'],
self.label_function_params['kernel_sz'],
self.label_function_params['feature_sz'], self.output_sz,
end_pad_if_even=self.label_function_params.get('end_pad_if_even', True))
return gauss_label
def __call__(self, data: TensorDict):
"""
args:
data - The input data, should contain the following fields:
'train_images', test_images', 'train_anno', 'test_anno'
returns:
TensorDict - output data block with following fields:
'train_images', 'test_images', 'train_anno', 'test_anno', 'test_proposals', 'proposal_iou',
'test_label' (optional), 'train_label' (optional), 'test_label_density' (optional), 'train_label_density' (optional)
"""
if self.transform['joint'] is not None:
data['train_images'], data['train_anno'] = self.transform['joint'](image=data['train_images'], bbox=data['train_anno'])
data['test_images'], data['test_anno'] = self.transform['joint'](image=data['test_images'], bbox=data['test_anno'], new_roll=False)
for s in ['train', 'test']:
assert self.mode == 'sequence' or len(data[s + '_images']) == 1, \
"In pair mode, num train/test frames must be 1"
# Add a uniform noise to the center pos
jittered_anno = [self._get_jittered_box(a, s) for a in data[s + '_anno']]
crops, boxes = prutils.target_image_crop(data[s + '_images'], jittered_anno, data[s + '_anno'],
self.search_area_factor, self.output_sz, mode=self.crop_type,
max_scale_change=self.max_scale_change)
data[s + '_images'], data[s + '_anno'] = self.transform[s](image=crops, bbox=boxes, joint=False)
# Generate proposals
if self.proposal_params:
frame2_proposals, gt_iou = zip(*[self._generate_proposals(a) for a in data['test_anno']])
data['test_proposals'] = list(frame2_proposals)
data['proposal_iou'] = list(gt_iou)
# Prepare output
if self.mode == 'sequence':
data = data.apply(stack_tensors)
else:
data = data.apply(lambda x: x[0] if isinstance(x, list) else x)
# Generate label functions
if self.label_function_params is not None:
data['train_label'] = self._generate_label_function(data['train_anno'])
data['test_label'] = self._generate_label_function(data['test_anno'])
return data
class KLDiMPProcessing(BaseProcessing):
""" The processing class used for training PrDiMP that additionally supports the probabilistic classifier and
bounding box regressor. See DiMPProcessing for details.
"""
def __init__(self, search_area_factor, output_sz, center_jitter_factor, scale_jitter_factor, crop_type='replicate',
max_scale_change=None, mode='pair', proposal_params=None,
label_function_params=None, label_density_params=None, *args, **kwargs):
"""
args:
search_area_factor - The size of the search region relative to the target size.
output_sz - An integer, denoting the size to which the search region is resized. The search region is always
square.
center_jitter_factor - A dict containing the amount of jittering to be applied to the target center before
extracting the search region. See _get_jittered_box for how the jittering is done.
scale_jitter_factor - A dict containing the amount of jittering to be applied to the target size before
extracting the search region. See _get_jittered_box for how the jittering is done.
crop_type - If 'replicate', the boundary pixels are replicated in case the search region crop goes out of image.
If 'inside', the search region crop is shifted/shrunk to fit completely inside the image.
If 'inside_major', the search region crop is shifted/shrunk to fit completely inside one axis of the image.
max_scale_change - Maximum allowed scale change when performing the crop (only applicable for 'inside' and 'inside_major')
mode - Either 'pair' or 'sequence'. If mode='sequence', then output has an extra dimension for frames
proposal_params - Arguments for the proposal generation process. See _generate_proposals for details.
label_function_params - Arguments for the label generation process. See _generate_label_function for details.
label_density_params - Arguments for the label density generation process. See _generate_label_function for details.
"""
super().__init__(*args, **kwargs)
self.search_area_factor = search_area_factor
self.output_sz = output_sz
self.center_jitter_factor = center_jitter_factor
self.scale_jitter_factor = scale_jitter_factor
self.crop_type = crop_type
self.mode = mode
self.max_scale_change = max_scale_change
self.proposal_params = proposal_params
self.label_function_params = label_function_params
self.label_density_params = label_density_params
def _get_jittered_box(self, box, mode):
""" Jitter the input box
args:
box - input bounding box
mode - string 'train' or 'test' indicating train or test data
returns:
torch.Tensor - jittered box
"""
jittered_size = box[2:4] * torch.exp(torch.randn(2) * self.scale_jitter_factor[mode])
max_offset = (jittered_size.prod().sqrt() * torch.tensor(self.center_jitter_factor[mode]).float())
jittered_center = box[0:2] + 0.5 * box[2:4] + max_offset * (torch.rand(2) - 0.5)
return torch.cat((jittered_center - 0.5 * jittered_size, jittered_size), dim=0)
def _generate_proposals(self, box):
""" Generate proposal sample boxes from a GMM proposal distribution and compute their ground-truth density.
This is used for ML and KL based regression learning of the bounding box regressor.
args:
box - input bounding box
"""
# Generate proposals
proposals, proposal_density, gt_density = prutils.sample_box_gmm(box, self.proposal_params['proposal_sigma'],
gt_sigma=self.proposal_params['gt_sigma'],
num_samples=self.proposal_params['boxes_per_frame'],
add_mean_box=self.proposal_params.get('add_mean_box', False))
return proposals, proposal_density, gt_density
def _generate_label_function(self, target_bb):
""" Generates the gaussian label function centered at target_bb
args:
target_bb - target bounding box (num_images, 4)
returns:
torch.Tensor - Tensor of shape (num_images, label_sz, label_sz) containing the label for each sample
"""
gauss_label = prutils.gaussian_label_function(target_bb.view(-1, 4), self.label_function_params['sigma_factor'],
self.label_function_params['kernel_sz'],
self.label_function_params['feature_sz'], self.output_sz,
end_pad_if_even=self.label_function_params.get('end_pad_if_even', True))
return gauss_label
def _generate_label_density(self, target_bb):
""" Generates the gaussian label density centered at target_bb
args:
target_bb - target bounding box (num_images, 4)
returns:
torch.Tensor - Tensor of shape (num_images, label_sz, label_sz) containing the label for each sample
"""
feat_sz = self.label_density_params['feature_sz'] * self.label_density_params.get('interp_factor', 1)
gauss_label = prutils.gaussian_label_function(target_bb.view(-1, 4), self.label_density_params['sigma_factor'],
self.label_density_params['kernel_sz'],
feat_sz, self.output_sz,
end_pad_if_even=self.label_density_params.get('end_pad_if_even', True),
density=True,
uni_bias=self.label_density_params.get('uni_weight', 0.0))
gauss_label *= (gauss_label > self.label_density_params.get('threshold', 0.0)).float()
if self.label_density_params.get('normalize', False):
g_sum = gauss_label.sum(dim=(-2,-1))
valid = g_sum>0.01
gauss_label[valid, :, :] /= g_sum[valid].view(-1, 1, 1)
gauss_label[~valid, :, :] = 1.0 / (gauss_label.shape[-2] * gauss_label.shape[-1])
gauss_label *= 1.0 - self.label_density_params.get('shrink', 0.0)
return gauss_label
def __call__(self, data: TensorDict):
"""
args:
data - The input data, should contain the following fields:
'train_images', test_images', 'train_anno', 'test_anno'
returns:
TensorDict - output data block with following fields:
'train_images', 'test_images', 'train_anno', 'test_anno', 'test_proposals', 'proposal_density', 'gt_density',
'test_label' (optional), 'train_label' (optional), 'test_label_density' (optional), 'train_label_density' (optional)
"""
if self.transform['joint'] is not None:
data['train_images'], data['train_anno'] = self.transform['joint'](image=data['train_images'], bbox=data['train_anno'])
data['test_images'], data['test_anno'] = self.transform['joint'](image=data['test_images'], bbox=data['test_anno'], new_roll=False)
for s in ['train', 'test']:
assert self.mode == 'sequence' or len(data[s + '_images']) == 1, \
"In pair mode, num train/test frames must be 1"
# Add a uniform noise to the center pos
jittered_anno = [self._get_jittered_box(a, s) for a in data[s + '_anno']]
crops, boxes = prutils.target_image_crop(data[s + '_images'], jittered_anno, data[s + '_anno'],
self.search_area_factor, self.output_sz, mode=self.crop_type,
max_scale_change=self.max_scale_change)
data[s + '_images'], data[s + '_anno'] = self.transform[s](image=crops, bbox=boxes, joint=False)
# Generate proposals
proposals, proposal_density, gt_density = zip(*[self._generate_proposals(a) for a in data['test_anno']])
data['test_proposals'] = proposals
data['proposal_density'] = proposal_density
data['gt_density'] = gt_density
for s in ['train', 'test']:
is_distractor = data.get('is_distractor_{}_frame'.format(s), None)
if is_distractor is not None:
for is_dist, box in zip(is_distractor, data[s+'_anno']):
if is_dist:
box[0] = 99999999.9
box[1] = 99999999.9
# Prepare output
if self.mode == 'sequence':
data = data.apply(stack_tensors)
else:
data = data.apply(lambda x: x[0] if isinstance(x, list) else x)
# Generate label functions
if self.label_function_params is not None:
data['train_label'] = self._generate_label_function(data['train_anno'])
data['test_label'] = self._generate_label_function(data['test_anno'])
if self.label_density_params is not None:
data['train_label_density'] = self._generate_label_density(data['train_anno'])
data['test_label_density'] = self._generate_label_density(data['test_anno'])
return data
================================================
FILE: artrackv2_mindspore/external/AR/ltr/data/processing_utils.py
================================================
import torch
import math
import cv2 as cv
import random
import torch.nn.functional as F
from .bounding_box_utils import rect_to_rel, rel_to_rect
def sample_target(im, target_bb, search_area_factor, output_sz=None, mask=None):
""" Extracts a square crop centered at target_bb box, of area search_area_factor^2 times target_bb area
args:
im - cv image
target_bb - target box [x, y, w, h]
search_area_factor - Ratio of crop size to target size
output_sz - (float) Size to which the extracted crop is resized (always square). If None, no resizing is done.
returns:
cv image - extracted crop
float - the factor by which the crop has been resized to make the crop size equal output_size
"""
x, y, w, h = target_bb.tolist()
# Crop image
crop_sz = math.ceil(math.sqrt(w * h) * search_area_factor)
if crop_sz < 1:
raise Exception('Too small bounding box.')
x1 = round(x + 0.5 * w - crop_sz * 0.5)
x2 = x1 + crop_sz
y1 = round(y + 0.5 * h - crop_sz * 0.5)
y2 = y1 + crop_sz
x1_pad = max(0, -x1)
x2_pad = max(x2 - im.shape[1] + 1, 0)
y1_pad = max(0, -y1)
y2_pad = max(y2 - im.shape[0] + 1, 0)
# Crop target
im_crop = im[y1 + y1_pad:y2 - y2_pad, x1 + x1_pad:x2 - x2_pad, :]
if mask is not None:
mask_crop = mask[y1 + y1_pad:y2 - y2_pad, x1 + x1_pad:x2 - x2_pad]
# Pad
im_crop_padded = cv.copyMakeBorder(im_crop, y1_pad, y2_pad, x1_pad, x2_pad, cv.BORDER_REPLICATE)
if mask is not None:
mask_crop_padded = F.pad(mask_crop, pad=(x1_pad, x2_pad, y1_pad, y2_pad), mode='constant', value=0)
if output_sz is not None:
resize_factor = output_sz / crop_sz
im_crop_padded = cv.resize(im_crop_padded, (output_sz, output_sz))
if mask is None:
return im_crop_padded, resize_factor
mask_crop_padded = \
F.interpolate(mask_crop_padded[None, None], (output_sz, output_sz), mode='bilinear', align_corners=False)[0, 0]
return im_crop_padded, resize_factor, mask_crop_padded
else:
if mask is None:
return im_crop_padded, 1.0
return im_crop_padded, 1.0, mask_crop_padded
def transform_image_to_crop(box_in: torch.Tensor, box_extract: torch.Tensor, resize_factor: float,
crop_sz: torch.Tensor) -> torch.Tensor:
""" Transform the box co-ordinates from the original image co-ordinates to the co-ordinates of the cropped image
args:
box_in - the box for which the co-ordinates are to be transformed
box_extract - the box about which the image crop has been extracted.
resize_factor - the ratio between the original image scale and the scale of the image crop
crop_sz - size of the cropped image
returns:
torch.Tensor - transformed co-ordinates of box_in
"""
box_extract_center = box_extract[0:2] + 0.5 * box_extract[2:4]
box_in_center = box_in[0:2] + 0.5 * box_in[2:4]
box_out_center = (crop_sz - 1) / 2 + (box_in_center - box_extract_center) * resize_factor
box_out_wh = box_in[2:4] * resize_factor
box_out = torch.cat((box_out_center - 0.5 * box_out_wh, box_out_wh))
return box_out
def jittered_center_crop(frames, box_extract, box_gt, search_area_factor, output_sz, masks=None):
""" For each frame in frames, extracts a square crop centered at box_extract, of area search_area_factor^2
times box_extract area. The extracted crops are then resized to output_sz. Further, the co-ordinates of the box
box_gt are transformed to the image crop co-ordinates
args:
frames - list of frames
box_extract - list of boxes of same length as frames. The crops are extracted using anno_extract
box_gt - list of boxes of same length as frames. The co-ordinates of these boxes are transformed from
image co-ordinates to the crop co-ordinates
search_area_factor - The area of the extracted crop is search_area_factor^2 times box_extract area
output_sz - The size to which the extracted crops are resized
returns:
list - list of image crops
list - box_gt location in the crop co-ordinates
"""
if masks is None:
crops_resize_factors = [sample_target(f, a, search_area_factor, output_sz)
for f, a in zip(frames, box_extract)]
frames_crop, resize_factors = zip(*crops_resize_factors)
masks_crop = None
else:
crops_resize_factors = [sample_target(f, a, search_area_factor, output_sz, m)
for f, a, m in zip(frames, box_extract, masks)]
frames_crop, resize_factors, masks_crop = zip(*crops_resize_factors)
crop_sz = torch.Tensor([output_sz, output_sz])
# find the bb location in the crop
box_crop = [transform_image_to_crop(a_gt, a_ex, rf, crop_sz)
for a_gt, a_ex, rf in zip(box_gt, box_extract, resize_factors)]
return frames_crop, box_crop, masks_crop
def sample_target_adaptive(im, target_bb, search_area_factor, output_sz, mode: str = 'replicate',
max_scale_change=None, mask=None):
""" Extracts a crop centered at target_bb box, of area search_area_factor^2. If the crop area contains regions
outside the image, it is shifted so that the it is inside the image. Further, if the crop area exceeds the image
size, a smaller crop which fits the image is returned instead.
args:
im - Input numpy image to crop.
target_bb - target box [x, y, w, h]
search_area_factor - Ratio of crop size to target size
output_sz - (float) Size to which the extracted crop is resized (always square). If None, no resizing is done.
mode - If 'replicate', the boundary pixels are replicated in case the search region crop goes out of image.
If 'inside', the search region crop is shifted/shrunk to fit completely inside the image.
If 'inside_major', the search region crop is shifted/shrunk to fit completely inside one axis of the image.
max_scale_change - Maximum allowed scale change when performing the crop (only applicable for 'inside' and 'inside_major')
mask - Optional mask to apply the same crop.
returns:
numpy image - Extracted crop.
torch.Tensor - A bounding box denoting the cropped region in the image.
numpy mask - Cropped mask returned only if mask is not None.
"""
if max_scale_change is None:
max_scale_change = float('inf')
if isinstance(output_sz, (float, int)):
output_sz = (output_sz, output_sz)
output_sz = torch.Tensor(output_sz)
im_h = im.shape[0]
im_w = im.shape[1]
bbx, bby, bbw, bbh = target_bb.tolist()
# Crop image
crop_sz_x, crop_sz_y = (output_sz * (
target_bb[2:].prod() / output_sz.prod()).sqrt() * search_area_factor).ceil().long().tolist()
# Get new sample size if forced inside the image
if mode == 'inside' or mode == 'inside_major':
# Calculate rescaling factor if outside the image
rescale_factor = [crop_sz_x / im_w, crop_sz_y / im_h]
if mode == 'inside':
rescale_factor = max(rescale_factor)
elif mode == 'inside_major':
rescale_factor = min(rescale_factor)
rescale_factor = min(max(1, rescale_factor), max_scale_change)
crop_sz_x = math.floor(crop_sz_x / rescale_factor)
crop_sz_y = math.floor(crop_sz_y / rescale_factor)
if crop_sz_x < 1 or crop_sz_y < 1:
raise Exception('Too small bounding box.')
x1 = round(bbx + 0.5 * bbw - crop_sz_x * 0.5)
x2 = x1 + crop_sz_x
y1 = round(bby + 0.5 * bbh - crop_sz_y * 0.5)
y2 = y1 + crop_sz_y
# Move box inside image
shift_x = max(0, -x1) + min(0, im_w - x2)
x1 += shift_x
x2 += shift_x
shift_y = max(0, -y1) + min(0, im_h - y2)
y1 += shift_y
y2 += shift_y
out_x = (max(0, -x1) + max(0, x2 - im_w)) // 2
out_y = (max(0, -y1) + max(0, y2 - im_h)) // 2
shift_x = (-x1 - out_x) * (out_x > 0)
shift_y = (-y1 - out_y) * (out_y > 0)
x1 += shift_x
x2 += shift_x
y1 += shift_y
y2 += shift_y
x1_pad = max(0, -x1)
x2_pad = max(x2 - im.shape[1] + 1, 0)
y1_pad = max(0, -y1)
y2_pad = max(y2 - im.shape[0] + 1, 0)
# Crop target
im_crop = im[y1 + y1_pad:y2 - y2_pad, x1 + x1_pad:x2 - x2_pad, :]
if mask is not None:
mask_crop = mask[y1 + y1_pad:y2 - y2_pad, x1 + x1_pad:x2 - x2_pad]
# Pad
im_crop_padded = cv.copyMakeBorder(im_crop, y1_pad, y2_pad, x1_pad, x2_pad, cv.BORDER_REPLICATE)
if mask is not None:
mask_crop_padded = F.pad(mask_crop, pad=(x1_pad, x2_pad, y1_pad, y2_pad), mode='constant', value=0)
# Resize image
im_out = cv.resize(im_crop_padded, tuple(output_sz.long().tolist()))
if mask is not None:
mask_out = \
F.interpolate(mask_crop_padded[None, None], tuple(output_sz.flip(0).long().tolist()), mode='nearest')[0, 0]
crop_box = torch.Tensor([x1, y1, x2 - x1, y2 - y1])
if mask is None:
return im_out, crop_box
else:
return im_out, crop_box, mask_out
def crop_and_resize(im, box, crop_bb, output_sz, mask=None):
if isinstance(output_sz, (float, int)):
output_sz = (output_sz, output_sz)
im_h = im.shape[0]
im_w = im.shape[1]
if crop_bb[2] < 1 or crop_bb[3] < 1:
raise Exception('Too small bounding box.')
x1 = crop_bb[0]
x2 = crop_bb[0] + crop_bb[2]
y1 = crop_bb[1]
y2 = crop_bb[1] + crop_bb[3]
x1_pad = max(0, -x1)
x2_pad = max(x2 - im.shape[1] + 1, 0)
y1_pad = max(0, -y1)
y2_pad = max(y2 - im.shape[0] + 1, 0)
# Crop target
im_crop = im[y1 + y1_pad:y2 - y2_pad, x1 + x1_pad:x2 - x2_pad, :]
if mask is not None:
mask_crop = mask[y1 + y1_pad:y2 - y2_pad, x1 + x1_pad:x2 - x2_pad]
# Pad
im_crop_padded = cv.copyMakeBorder(im_crop, y1_pad, y2_pad, x1_pad, x2_pad, cv.BORDER_REPLICATE)
if mask is not None:
mask_crop_padded = F.pad(mask_crop, pad=(x1_pad, x2_pad, y1_pad, y2_pad), mode='constant', value=0)
# Resize image
im_out = cv.resize(im_crop_padded, output_sz)
if mask is not None:
mask_out = F.interpolate(mask_crop_padded[None, None], (output_sz[1], output_sz[0]), mode='nearest')[0, 0]
rescale_factor = output_sz[0] / crop_bb[2]
# Hack
if box is not None:
box_crop = box.clone()
box_crop[0] -= crop_bb[0]
box_crop[1] -= crop_bb[1]
box_crop *= rescale_factor
else:
box_crop = None
if mask is None:
return im_out, box_crop
else:
return im_out, box_crop, mask_out
def transform_box_to_crop(box: torch.Tensor, crop_box: torch.Tensor, crop_sz: torch.Tensor) -> torch.Tensor:
""" Transform the box co-ordinates from the original image co-ordinates to the co-ordinates of the cropped image
args:
box - the box for which the co-ordinates are to be transformed
crop_box - bounding box defining the crop in the original image
crop_sz - size of the cropped image
returns:
torch.Tensor - transformed co-ordinates of box_in
"""
box_out = box.clone()
box_out[:2] -= crop_box[:2]
scale_factor = crop_sz / crop_box[2:]
box_out[:2] *= scale_factor
box_out[2:] *= scale_factor
return box_out
def target_image_crop(frames, box_extract, box_gt, search_area_factor, output_sz, mode: str = 'replicate',
max_scale_change=None, masks=None):
""" For each frame in frames, extracts a square crop centered at box_extract, of area search_area_factor^2
times box_extract area. If the crop area contains regions outside the image, it is shifted / shrunk so that it
completely fits inside the image. The extracted crops are then resized to output_sz. Further, the co-ordinates of
the box box_gt are transformed to the image crop co-ordinates
args:
frames - list of frames
box_extract - list of boxes of same length as frames. The crops are extracted using anno_extract
box_gt - list of boxes of same length as frames. The co-ordinates of these boxes are transformed from
image co-ordinates to the crop co-ordinates
search_area_factor - The area of the extracted crop is search_area_factor^2 times box_extract area
output_sz - The size to which the extracted crops are resized
mode - If 'replicate', the boundary pixels are replicated in case the search region crop goes out of image.
If 'inside', the search region crop is shifted/shrunk to fit completely inside the image.
If 'inside_major', the search region crop is shifted/shrunk to fit completely inside one axis of the image.
max_scale_change - Maximum allowed scale change when performing the crop (only applicable for 'inside' and 'inside_major')
masks - Optional masks to apply the same crop.
returns:
list - list of image crops
list - box_gt location in the crop co-ordinates
"""
if isinstance(output_sz, (float, int)):
output_sz = (output_sz, output_sz)
if masks is None:
frame_crops_boxes = [sample_target_adaptive(f, a, search_area_factor, output_sz, mode, max_scale_change)
for f, a in zip(frames, box_extract)]
frames_crop, crop_boxes = zip(*frame_crops_boxes)
else:
frame_crops_boxes_masks = [
sample_target_adaptive(f, a, search_area_factor, output_sz, mode, max_scale_change, mask=m)
for f, a, m in zip(frames, box_extract, masks)]
frames_crop, crop_boxes, masks_crop = zip(*frame_crops_boxes_masks)
crop_sz = torch.Tensor(output_sz)
# find the bb location in the crop
box_crop = [transform_box_to_crop(bb_gt, crop_bb, crop_sz)
for bb_gt, crop_bb in zip(box_gt, crop_boxes)]
if masks is None:
return frames_crop, box_crop
else:
return frames_crop, box_crop, masks_crop
def iou(reference, proposals):
"""Compute the IoU between a reference box with multiple proposal boxes.
args:
reference - Tensor of shape (1, 4).
proposals - Tensor of shape (num_proposals, 4)
returns:
torch.Tensor - Tensor of shape (num_proposals,) containing IoU of reference box with each proposal box.
"""
# Intersection box
tl = torch.max(reference[:, :2], proposals[:, :2])
br = torch.min(reference[:, :2] + reference[:, 2:], proposals[:, :2] + proposals[:, 2:])
sz = (br - tl).clamp(0)
# Area
intersection = sz.prod(dim=1)
union = reference[:, 2:].prod(dim=1) + proposals[:, 2:].prod(dim=1) - intersection
return intersection / union
def rand_uniform(a, b, shape=1):
""" sample numbers uniformly between a and b.
args:
a - lower bound
b - upper bound
shape - shape of the output tensor
returns:
torch.Tensor - tensor of shape=shape
"""
return (b - a) * torch.rand(shape) + a
def perturb_box(box, min_iou=0.5, sigma_factor=0.1):
""" Perturb the input box by adding gaussian noise to the co-ordinates
args:
box - input box
min_iou - minimum IoU overlap between input box and the perturbed box
sigma_factor - amount of perturbation, relative to the box size. Can be either a single element, or a list of
sigma_factors, in which case one of them will be uniformly sampled. Further, each of the
sigma_factor element can be either a float, or a tensor
of shape (4,) specifying the sigma_factor per co-ordinate
returns:
torch.Tensor - the perturbed box
"""
if isinstance(sigma_factor, list):
# If list, sample one sigma_factor as current sigma factor
c_sigma_factor = random.choice(sigma_factor)
else:
c_sigma_factor = sigma_factor
if not isinstance(c_sigma_factor, torch.Tensor):
c_sigma_factor = c_sigma_factor * torch.ones(4)
perturb_factor = torch.sqrt(box[2] * box[3]) * c_sigma_factor
# multiple tries to ensure that the perturbed box has iou > min_iou with the input box
for i_ in range(100):
c_x = box[0] + 0.5 * box[2]
c_y = box[1] + 0.5 * box[3]
c_x_per = random.gauss(c_x, perturb_factor[0])
c_y_per = random.gauss(c_y, perturb_factor[1])
w_per = random.gauss(box[2], perturb_factor[2])
h_per = random.gauss(box[3], perturb_factor[3])
if w_per <= 1:
w_per = box[2] * rand_uniform(0.15, 0.5)
if h_per <= 1:
h_per = box[3] * rand_uniform(0.15, 0.5)
box_per = torch.Tensor([c_x_per - 0.5 * w_per, c_y_per - 0.5 * h_per, w_per, h_per]).round()
if box_per[2] <= 1:
box_per[2] = box[2] * rand_uniform(0.15, 0.5)
if box_per[3] <= 1:
box_per[3] = box[3] * rand_uniform(0.15, 0.5)
box_iou = iou(box.view(1, 4), box_per.view(1, 4))
# if there is sufficient overlap, return
if box_iou > min_iou:
return box_per, box_iou
# else reduce the perturb factor
perturb_factor *= 0.9
return box_per, box_iou
def gauss_1d(sz, sigma, center, end_pad=0, density=False):
k = torch.arange(-(sz - 1) / 2, (sz + 1) / 2 + end_pad).reshape(1, -1)
gauss = torch.exp(-1.0 / (2 * sigma ** 2) * (k - center.reshape(-1, 1)) ** 2)
if density:
gauss /= math.sqrt(2 * math.pi) * sigma
return gauss
def gauss_2d(sz, sigma, center, end_pad=(0, 0), density=False):
if isinstance(sigma, (float, int)):
sigma = (sigma, sigma)
return gauss_1d(sz[0].item(), sigma[0], center[:, 0], end_pad[0], density).reshape(center.shape[0], 1, -1) * \
gauss_1d(sz[1].item(), sigma[1], center[:, 1], end_pad[1], density).reshape(center.shape[0], -1, 1)
def gaussian_label_function(target_bb, sigma_factor, kernel_sz, feat_sz, image_sz, end_pad_if_even=True, density=False,
uni_bias=0):
"""Construct Gaussian label function."""
if isinstance(kernel_sz, (float, int)):
kernel_sz = (kernel_sz, kernel_sz)
if isinstance(feat_sz, (float, int)):
feat_sz = (feat_sz, feat_sz)
if isinstance(image_sz, (float, int)):
image_sz = (image_sz, image_sz)
image_sz = torch.Tensor(image_sz)
feat_sz = torch.Tensor(feat_sz)
target_center = target_bb[:, 0:2] + 0.5 * target_bb[:, 2:4]
target_center_norm = (target_center - image_sz / 2) / image_sz
center = feat_sz * target_center_norm + 0.5 * \
torch.Tensor([(kernel_sz[0] + 1) % 2, (kernel_sz[1] + 1) % 2])
sigma = sigma_factor * feat_sz.prod().sqrt().item()
if end_pad_if_even:
end_pad = (int(kernel_sz[0] % 2 == 0), int(kernel_sz[1] % 2 == 0))
else:
end_pad = (0, 0)
gauss_label = gauss_2d(feat_sz, sigma, center, end_pad, density=density)
if density:
sz = (feat_sz + torch.Tensor(end_pad)).prod()
label = (1.0 - uni_bias) * gauss_label + uni_bias / sz
else:
label = gauss_label + uni_bias
return label
def gauss_density_centered(x, std):
"""Evaluate the probability density of a Gaussian centered at zero.
args:
x - Samples.
std - List of standard deviations
"""
return torch.exp(-0.5 * (x / std) ** 2) / (math.sqrt(2 * math.pi) * std)
def gmm_density_centered(x, std):
"""Evaluate the probability density of a GMM centered at zero.
args:
x - Samples. Assumes dim=-1 is the component dimension and dim=-2 is feature dimension. Rest are sample dimension.
std - Tensor of standard deviations
"""
if x.dim() == std.dim() - 1:
x = x.unsqueeze(-1)
elif not (x.dim() == std.dim() and x.shape[-1] == 1):
raise ValueError('Last dimension must be the gmm stds.')
return gauss_density_centered(x, std).prod(-2).mean(-1)
def sample_gmm_centered(std, num_samples=1):
"""Sample from a GMM distribution centered at zero:
args:
std - Tensor of standard deviations
num_samples - number of samples
"""
num_components = std.shape[-1]
num_dims = std.numel() // num_components
std = std.view(1, num_dims, num_components)
# Sample component ids
k = torch.randint(num_components, (num_samples,), dtype=torch.int64)
std_samp = std[0, :, k].t()
# Sample
x_centered = std_samp * torch.randn(num_samples, num_dims)
prob_dens = gmm_density_centered(x_centered, std)
return x_centered, prob_dens
def sample_gmm(mean, std, num_samples=1):
"""Sample from a GMM distribution:
args:
mean - a single mean vector
std - Tensor of standard deviations
num_samples - number of samples
"""
num_dims = mean.numel()
num_components = std.shape[-1]
mean = mean.view(1, num_dims)
std = std.view(1, -1, num_components)
# Sample component ids
k = torch.randint(num_components, (num_samples,), dtype=torch.int64)
std_samp = std[0, :, k].t()
# Sample
x_centered = std_samp * torch.randn(num_samples, num_dims)
x = x_centered + mean
prob_dens = gmm_density_centered(x_centered, std)
return x, prob_dens
def sample_box_gmm(mean_box, proposal_sigma, gt_sigma=None, num_samples=1, add_mean_box=False):
"""Sample boxes from a Gaussian mixture model.
args:
mean_box - Center (or mean) bounding box
proposal_sigma - List of standard deviations for each Gaussian
gt_sigma - Standard deviation of the ground truth distribution
num_samples - Number of sampled boxes
add_mean_box - Also add mean box as first element
returns:
proposals, proposal density and ground truth density for all samples
"""
center_std = torch.Tensor([s[0] for s in proposal_sigma])
sz_std = torch.Tensor([s[1] for s in proposal_sigma])
std = torch.stack([center_std, center_std, sz_std, sz_std])
mean_box = mean_box.view(1, 4)
sz_norm = mean_box[:, 2:].clone()
# Sample boxes
proposals_rel_centered, proposal_density = sample_gmm_centered(std, num_samples)
# Add mean and map back
mean_box_rel = rect_to_rel(mean_box, sz_norm)
proposals_rel = proposals_rel_centered + mean_box_rel
proposals = rel_to_rect(proposals_rel, sz_norm)
if gt_sigma is None or gt_sigma[0] == 0 and gt_sigma[1] == 0:
gt_density = torch.zeros_like(proposal_density)
else:
std_gt = torch.Tensor([gt_sigma[0], gt_sigma[0], gt_sigma[1], gt_sigma[1]]).view(1, 4)
gt_density = gauss_density_centered(proposals_rel_centered, std_gt).prod(-1)
if add_mean_box:
proposals = torch.cat((mean_box, proposals))
proposal_density = torch.cat((torch.Tensor([-1]), proposal_density))
gt_density = torch.cat((torch.Tensor([1]), gt_density))
return proposals, proposal_density, gt_density
================================================
FILE: artrackv2_mindspore/external/AR/ltr/data/processing_utils_SE.py
================================================
import torch
import math
import cv2 as cv
import random
import numpy as np
def stack_tensors(x):
if isinstance(x, list) and isinstance(x[0], torch.Tensor):
return torch.stack(x)
return x
'''Added on 2019.12.23'''
def sample_target_SE(im, target_bb, search_area_factor, output_sz=None, mode=cv.BORDER_REPLICATE):
""" Extracts a crop centered at target_bb box, of size search_area_factor times target_bb(Both height and width)
args:
im - cv image
target_bb - target box [x, y, w, h]
search_area_factor - Ratio of crop size to target size
output_sz - (float) Size to which the extracted crop is resized (always square). If None, no resizing is done.
returns:
cv image - extracted crop
float - the factor by which the crop has been resized to make the crop size equal output_size
"""
x, y, w, h = target_bb.tolist()
# Crop image
ws = math.ceil(search_area_factor * w)
hs = math.ceil(search_area_factor * h)
if ws < 1 or hs < 1:
raise Exception('Too small bounding box.')
x1 = round(x + 0.5*w - ws*0.5)
x2 = x1 + ws
y1 = round(y + 0.5 * h - hs * 0.5)
y2 = y1 + hs
x1_pad = max(0, -x1)
x2_pad = max(x2-im.shape[1]+1, 0)
y1_pad = max(0, -y1)
y2_pad = max(y2-im.shape[0]+1, 0)
# Crop target
im_crop = im[y1+y1_pad:y2-y2_pad, x1+x1_pad:x2-x2_pad, :]
# Pad
im_crop_padded = cv.copyMakeBorder(im_crop, y1_pad, y2_pad, x1_pad, x2_pad, mode)
if output_sz is not None:
w_rsz_f = output_sz / ws
h_rsz_f = output_sz / hs
im_crop_padded_rsz = cv.resize(im_crop_padded, (output_sz, output_sz))
if len(im_crop_padded_rsz.shape)==2:
im_crop_padded_rsz = im_crop_padded_rsz[...,np.newaxis]
return im_crop_padded_rsz, h_rsz_f, w_rsz_f
else:
return im_crop_padded, 1.0, 1.0
'''把mask映射到原图上'''
def map_mask_back(im, target_bb, search_area_factor, mask, mode=cv.BORDER_REPLICATE):
""" Extracts a crop centered at target_bb box, of size search_area_factor times target_bb(Both height and width)
args:
im - cv image
target_bb - target box [x, y, w, h]
search_area_factor - Ratio of crop size to target size
output_sz - (float) Size to which the extracted crop is resized (always square). If None, no resizing is done.
returns:
cv image - extracted crop
float - the factor by which the crop has been resized to make the crop size equal output_size
"""
H,W = (im.shape[0],im.shape[1])
base = np.zeros((H,W))
x, y, w, h = target_bb.tolist()
# Crop image
ws = math.ceil(search_area_factor * w)
hs = math.ceil(search_area_factor * h)
if ws < 1 or hs < 1:
raise Exception('Too small bounding box.')
x1 = round(x + 0.5*w - ws*0.5)
x2 = x1 + ws
y1 = round(y + 0.5 * h - hs * 0.5)
y2 = y1 + hs
x1_pad = max(0, -x1)
x2_pad = max(x2-im.shape[1]+1, 0)
y1_pad = max(0, -y1)
y2_pad = max(y2-im.shape[0]+1, 0)
'''pad base'''
base_padded = cv.copyMakeBorder(base, y1_pad, y2_pad, x1_pad, x2_pad, mode)
'''Resize mask'''
mask_rsz = cv.resize(mask,(ws,hs))
'''fill region with mask'''
base_padded[y1+y1_pad:y2+y1_pad, x1+x1_pad:x2+x1_pad] = mask_rsz.copy()
'''crop base_padded to get final mask'''
final_mask = base_padded[y1_pad:y1_pad+H,x1_pad:x1_pad+W]
assert (final_mask.shape == (H,W))
return final_mask
'''Added on 2019.12.23'''
def transform_image_to_crop_SE(box_in: torch.Tensor, box_extract: torch.Tensor, resize_factor_h: float, resize_factor_w: float,
crop_sz: torch.Tensor) -> torch.Tensor:
""" Transform the box co-ordinates from the original image co-ordinates to the co-ordinates of the cropped image
args:
box_in - the box for which the co-ordinates are to be transformed
box_extract - the box about which the image crop has been extracted.
resize_factor - the ratio between the original image scale and the scale of the image crop
crop_sz - size of the cropped image
returns:
torch.Tensor - transformed co-ordinates of box_in
"""
box_extract_center = box_extract[0:2] + 0.5*box_extract[2:4]
box_in_center = box_in[0:2] + 0.5*box_in[2:4]
box_out_xc = (crop_sz[0] -1)/2 + (box_in_center[0] - box_extract_center[0])*resize_factor_w
box_out_yc = (crop_sz[0] -1)/2 + (box_in_center[1] - box_extract_center[1])*resize_factor_h
box_out_w = box_in[2] * resize_factor_w
box_out_h = box_in[3] * resize_factor_h
'''2019.12.28 为了避免出现(x1,y1)小于0,或者(x2,y2)大于256的情况,这里我对它们加上了一些限制'''
max_sz = crop_sz[0].item()
box_out_x1 = torch.clamp(box_out_xc - 0.5 * box_out_w,0,max_sz)
box_out_y1 = torch.clamp(box_out_yc - 0.5 * box_out_h,0,max_sz)
box_out_x2 = torch.clamp(box_out_xc + 0.5 * box_out_w,0,max_sz)
box_out_y2 = torch.clamp(box_out_yc + 0.5 * box_out_h,0,max_sz)
box_out_w_new = box_out_x2 - box_out_x1
box_out_h_new = box_out_y2 - box_out_y1
box_out = torch.stack((box_out_x1, box_out_y1, box_out_w_new, box_out_h_new))
return box_out
def centered_crop(frames, anno, area_factor, output_sz):
crops_resize_factors = [sample_target(f, a, area_factor, output_sz)
for f, a in zip(frames, anno)]
frames_crop, resize_factors = zip(*crops_resize_factors)
crop_sz = torch.Tensor([output_sz, output_sz])
# find the bb location in the crop
anno_crop = [transform_image_to_crop(a, a, rf, crop_sz)
for a, rf in zip(anno, resize_factors)]
return frames_crop, anno_crop
'''Added by Bin Yan 2019.12.23,
changed on 2020.1.4(add a new args: "get_bbox_coord")'''
def jittered_center_crop_SE(frames, box_extract, box_gt, search_area_factor, output_sz, get_bbox_coord=True, mode=cv.BORDER_REPLICATE):
"""
Crop a patch centered at box_extract. The height and width of cropped region is search_area_factor times that of box_extract.
The extracted crops are then resized to output_sz. Further, the co-ordinates of the box box_gt are transformed to the image crop co-ordinates
args:
frames - list of frames
box_extract - list of boxes of same length as frames. The crops are extracted using anno_extract
box_gt - list of boxes of same length as frames. The co-ordinates of these boxes are transformed from
image co-ordinates to the crop co-ordinates
search_area_factor - The area of the extracted crop is search_area_factor^2 times box_extract area
output_sz - The size to which the extracted crops are resized
returns:
list - list of image crops
list - box_gt location in the crop co-ordinates
"""
'''call function "sample_target_SE" and function "transform_image_to_crop_SE"'''
'''get cropped patch(fixed size)'''
crops_resize_factors = [sample_target_SE(f, a, search_area_factor, output_sz, mode=mode)
for f, a in zip(frames, box_extract)]
frames_crop, resize_factors_h, resize_factors_w = zip(*crops_resize_factors)
if get_bbox_coord:
crop_sz = torch.Tensor([output_sz, output_sz])
# find the bb location in the crop
'''get GT's cooridinate on the cropped patch'''
box_crop = [transform_image_to_crop_SE(a_gt, a_ex, h_rsf, w_rsf, crop_sz)
for a_gt, a_ex, h_rsf, w_rsf in zip(box_gt, box_extract, resize_factors_h, resize_factors_w)]
return frames_crop, box_crop
else:
return frames_crop
def sample_target_nopad(im, target_bb, search_area_factor, output_sz):
""" Extracts a crop centered at target_bb box, of area search_area_factor^2. If the crop area contains regions
outside the image, it is shifted so that the it is inside the image. Further, if the crop area exceeds the image
size, a smaller crop which fits the image is returned instead.
args:
im - cv image
target_bb - target box [x, y, w, h]
search_area_factor - Ratio of crop size to target size
output_sz - (float) Size to which the extracted crop is resized (always square). If None, no resizing is done.
returns:
cv image - extracted crop
torch.Tensor - a bounding box denoting the cropped region in the image.
"""
if isinstance(output_sz, (float, int)):
output_sz = (output_sz, output_sz)
output_sz = torch.Tensor(output_sz)
im_h = im.shape[0]
im_w = im.shape[1]
bbx, bby, bbw, bbh = target_bb.tolist()
# Crop image
crop_sz_x, crop_sz_y = (output_sz * (target_bb[2:].prod()/output_sz.prod()).sqrt() * search_area_factor).ceil()
# Calculate rescaling factor if outside the image
rescale_factor = max(1, crop_sz_x/im_w, crop_sz_y/im_h)
crop_sz_x = math.floor(crop_sz_x / rescale_factor)
crop_sz_y = math.floor(crop_sz_y / rescale_factor)
if crop_sz_x < 1 or crop_sz_y < 1:
raise Exception('Too small bounding box.')
x1 = round(bbx + 0.5*bbw - crop_sz_x*0.5)
x2 = x1 + crop_sz_x
y1 = round(bby + 0.5*bbh - crop_sz_y*0.5)
y2 = y1 + crop_sz_y
# Move box inside image
shift_x = max(0, -x1) + min(0, im_w - x2)
x1 += shift_x
x2 += shift_x
shift_y = max(0, -y1) + min(0, im_h - y2)
y1 += shift_y
y2 += shift_y
# Crop and resize image
im_crop = im[y1:y2, x1:x2, :]
im_out = cv.resize(im_crop, tuple(output_sz.long().tolist()))
crop_box = torch.Tensor([x1, y1, x2-x1, y2-y1])
return im_out, crop_box
def transform_box_to_crop(box: torch.Tensor, crop_box: torch.Tensor, crop_sz: torch.Tensor) -> torch.Tensor:
""" Transform the box co-ordinates from the original image co-ordinates to the co-ordinates of the cropped image
args:
box - the box for which the co-ordinates are to be transformed
crop_box - bounding box defining the crop in the original image
crop_sz - size of the cropped image
returns:
torch.Tensor - transformed co-ordinates of box_in
"""
box_out = box.clone()
box_out[:2] -= crop_box[:2]
scale_factor = crop_sz / crop_box[2:]
box_out[:2] *= scale_factor
box_out[2:] *= scale_factor
return box_out
def jittered_center_crop_nopad(frames, box_extract, box_gt, search_area_factor, output_sz):
""" For each frame in frames, extracts a square crop centered at box_extract, of area search_area_factor^2
times box_extract area. If the crop area contains regions outside the image, it is shifted / shrunk so that it
completely fits inside the image. The extracted crops are then resized to output_sz. Further, the co-ordinates of
the box box_gt are transformed to the image crop co-ordinates
args:
frames - list of frames
box_extract - list of boxes of same length as frames. The crops are extracted using anno_extract
box_gt - list of boxes of same length as frames. The co-ordinates of these boxes are transformed from
image co-ordinates to the crop co-ordinates
search_area_factor - The area of the extracted crop is search_area_factor^2 times box_extract area
output_sz - The size to which the extracted crops are resized
returns:
list - list of image crops
list - box_gt location in the crop co-ordinates
"""
if isinstance(output_sz, (float, int)):
output_sz = (output_sz, output_sz)
frame_crops_boxes = [sample_target_nopad(f, a, search_area_factor, output_sz)
for f, a in zip(frames, box_extract)]
frames_crop, crop_boxes = zip(*frame_crops_boxes)
crop_sz = torch.Tensor(output_sz)
# find the bb location in the crop
box_crop = [transform_box_to_crop(bb_gt, crop_bb, crop_sz)
for bb_gt, crop_bb in zip(box_gt, crop_boxes)]
return frames_crop, box_crop
def iou(reference, proposals):
"""Compute the IoU between a reference box with multiple proposal boxes.
args:
reference - Tensor of shape (1, 4).
proposals - Tensor of shape (num_proposals, 4)
returns:
torch.Tensor - Tensor of shape (num_proposals,) containing IoU of reference box with each proposal box.
"""
# Intersection box
tl = torch.max(reference[:,:2], proposals[:,:2])
br = torch.min(reference[:,:2] + reference[:,2:], proposals[:,:2] + proposals[:,2:])
sz = (br - tl).clamp(0)
# Area
intersection = sz.prod(dim=1)
union = reference[:,2:].prod(dim=1) + proposals[:,2:].prod(dim=1) - intersection
return intersection / union
def rand_uniform(a, b, shape=1):
""" sample numbers uniformly between a and b.
args:
a - lower bound
b - upper bound
shape - shape of the output tensor
returns:
torch.Tensor - tensor of shape=shape
"""
return (b - a) * torch.rand(shape) + a
def perturb_box(box, min_iou=0.5, sigma_factor=0.1):
""" Perturb the input box by adding gaussian noise to the co-ordinates
args:
box - input box
min_iou - minimum IoU overlap between input box and the perturbed box
sigma_factor - amount of perturbation, relative to the box size. Can be either a single element, or a list of
sigma_factors, in which case one of them will be uniformly sampled. Further, each of the
sigma_factor element can be either a float, or a tensor
of shape (4,) specifying the sigma_factor per co-ordinate
returns:
torch.Tensor - the perturbed box
"""
if isinstance(sigma_factor, list):
# If list, sample one sigma_factor as current sigma factor
c_sigma_factor = random.choice(sigma_factor)
else:
c_sigma_factor = sigma_factor
if not isinstance(c_sigma_factor, torch.Tensor):
c_sigma_factor = c_sigma_factor * torch.ones(4)
perturb_factor = torch.sqrt(box[2]*box[3])*c_sigma_factor
# multiple tries to ensure that the perturbed box has iou > min_iou with the input box
for i_ in range(100):
c_x = box[0] + 0.5*box[2]
c_y = box[1] + 0.5 * box[3]
c_x_per = random.gauss(c_x, perturb_factor[0])
c_y_per = random.gauss(c_y, perturb_factor[1])
w_per = random.gauss(box[2], perturb_factor[2])
h_per = random.gauss(box[3], perturb_factor[3])
if w_per <= 1:
w_per = box[2]*rand_uniform(0.15, 0.5)
if h_per <= 1:
h_per = box[3]*rand_uniform(0.15, 0.5)
box_per = torch.Tensor([c_x_per - 0.5*w_per, c_y_per - 0.5*h_per, w_per, h_per]).round()
if box_per[2] <= 1:
box_per[2] = box[2]*rand_uniform(0.15, 0.5)
if box_per[3] <= 1:
box_per[3] = box[3]*rand_uniform(0.15, 0.5)
box_iou = iou(box.view(1, 4), box_per.view(1, 4))
# if there is sufficient overlap, return
if box_iou > min_iou:
return box_per, box_iou
# else reduce the perturb factor
perturb_factor *= 0.9
return box_per, box_iou
def gauss_1d(sz, sigma, center, end_pad=0):
k = torch.arange(-(sz-1)/2, (sz+1)/2 + end_pad).reshape(1, -1)
return torch.exp(-1.0/(2*sigma**2) * (k - center.reshape(-1, 1))**2)
def gauss_2d(sz, sigma, center, end_pad=(0, 0)):
if isinstance(sigma, (float, int)):
sigma = (sigma, sigma)
return gauss_1d(sz[0].item(), sigma[0], center[:, 0], end_pad[0]).reshape(center.shape[0], 1, -1) * \
gauss_1d(sz[1].item(), sigma[1], center[:, 1], end_pad[1]).reshape(center.shape[0], -1, 1)
def gaussian_label_function(target_bb, sigma_factor, kernel_sz, feat_sz, image_sz, end_pad_if_even=True):
"""Construct Gaussian label function."""
if isinstance(kernel_sz, (float, int)):
kernel_sz = (kernel_sz, kernel_sz)
if isinstance(feat_sz, (float, int)):
feat_sz = (feat_sz, feat_sz)
if isinstance(image_sz, (float, int)):
image_sz = (image_sz, image_sz)
image_sz = torch.Tensor(image_sz)
feat_sz = torch.Tensor(feat_sz)
target_center = target_bb[:, 0:2] + 0.5 * target_bb[:, 2:4]
target_center_norm = (target_center - image_sz / 2) / image_sz
center = feat_sz * target_center_norm + 0.5 * \
torch.Tensor([(kernel_sz[0] + 1) % 2, (kernel_sz[1] + 1) % 2])
sigma = sigma_factor * feat_sz.prod().sqrt().item()
if end_pad_if_even:
end_pad = (int(kernel_sz[0]%2 == 0), int(kernel_sz[1]%2 == 0))
else:
end_pad = (0, 0)
gauss_label = gauss_2d(feat_sz, sigma, center, end_pad)
return gauss_label
================================================
FILE: artrackv2_mindspore/external/AR/ltr/data/sampler.py
================================================
import random
import torch.utils.data
from pytracking import TensorDict
def no_processing(data):
return data
class TrackingSampler(torch.utils.data.Dataset):
""" Class responsible for sampling frames from training sequences to form batches. Each training sample is a
tuple consisting of i) a set of train frames, used to learn the DiMP classification model and obtain the
modulation vector for IoU-Net, and ii) a set of test frames on which target classification loss for the predicted
DiMP model, and the IoU prediction loss for the IoU-Net is calculated.
The sampling is done in the following ways. First a dataset is selected at random. Next, a sequence is selected
from that dataset. A base frame is then sampled randomly from the sequence. Next, a set of 'train frames' and
'test frames' are sampled from the sequence from the range [base_frame_id - max_gap, base_frame_id] and
(base_frame_id, base_frame_id + max_gap] respectively. Only the frames in which the target is visible are sampled.
If enough visible frames are not found, the 'max_gap' is increased gradually till enough frames are found.
The sampled frames are then passed through the input 'processing' function for the necessary processing-
"""
def __init__(self, datasets, p_datasets, samples_per_epoch, max_gap,
num_test_frames, num_train_frames=1, processing=no_processing, frame_sample_mode='causal'):
"""
args:
datasets - List of datasets to be used for training
p_datasets - List containing the probabilities by which each dataset will be sampled
samples_per_epoch - Number of training samples per epoch
max_gap - Maximum gap, in frame numbers, between the train frames and the test frames.
num_test_frames - Number of test frames to sample.
num_train_frames - Number of train frames to sample.
processing - An instance of Processing class which performs the necessary processing of the data.
frame_sample_mode - Either 'causal' or 'interval'. If 'causal', then the test frames are sampled in a causally,
otherwise randomly within the interval.
"""
self.datasets = datasets
# If p not provided, sample uniformly from all videos
if p_datasets is None:
p_datasets = [len(d) for d in self.datasets]
# Normalize
p_total = sum(p_datasets)
self.p_datasets = [x / p_total for x in p_datasets]
self.samples_per_epoch = samples_per_epoch
self.max_gap = max_gap
self.num_test_frames = num_test_frames
self.num_train_frames = num_train_frames
self.processing = processing
self.frame_sample_mode = frame_sample_mode
def __len__(self):
return self.samples_per_epoch
def _sample_visible_ids(self, visible, num_ids=1, min_id=None, max_id=None):
""" Samples num_ids frames between min_id and max_id for which target is visible
args:
visible - 1d Tensor indicating whether target is visible for each frame
num_ids - number of frames to be samples
min_id - Minimum allowed frame number
max_id - Maximum allowed frame number
returns:
list - List of sampled frame numbers. None if not sufficient visible frames could be found.
"""
if num_ids == 0:
return []
if min_id is None or min_id < 0:
min_id = 0
if max_id is None or max_id > len(visible):
max_id = len(visible)
valid_ids = [i for i in range(min_id, max_id) if visible[i]]
# No visible ids
if len(valid_ids) == 0:
return None
return random.choices(valid_ids, k=num_ids)
def __getitem__(self, index):
"""
args:
index (int): Index (Ignored since we sample randomly)
returns:
TensorDict - dict containing all the data blocks
"""
# Select a dataset
dataset = random.choices(self.datasets, self.p_datasets)[0]
is_video_dataset = dataset.is_video_sequence()
# Sample a sequence with enough visible frames
enough_visible_frames = False
while not enough_visible_frames:
# Sample a sequence
seq_id = random.randint(0, dataset.get_num_sequences() - 1)
# Sample frames
seq_info_dict = dataset.get_sequence_info(seq_id)
visible = seq_info_dict['visible']
enough_visible_frames = visible.type(torch.int64).sum().item() > 2 * (
self.num_test_frames + self.num_train_frames) and len(visible) >= 20
enough_visible_frames = enough_visible_frames or not is_video_dataset
if is_video_dataset:
train_frame_ids = None
test_frame_ids = None
gap_increase = 0
if self.frame_sample_mode == 'interval':
# Sample frame numbers within interval defined by the first frame
while test_frame_ids is None:
base_frame_id = self._sample_visible_ids(visible, num_ids=1)
extra_train_frame_ids = self._sample_visible_ids(visible, num_ids=self.num_train_frames - 1,
min_id=base_frame_id[
0] - self.max_gap - gap_increase,
max_id=base_frame_id[
0] + self.max_gap + gap_increase)
if extra_train_frame_ids is None:
gap_increase += 5
continue
train_frame_ids = base_frame_id + extra_train_frame_ids
test_frame_ids = self._sample_visible_ids(visible, num_ids=self.num_test_frames,
min_id=train_frame_ids[0] - self.max_gap - gap_increase,
max_id=train_frame_ids[0] + self.max_gap + gap_increase)
gap_increase += 5 # Increase gap until a frame is found
elif self.frame_sample_mode == 'causal':
# Sample test and train frames in a causal manner, i.e. test_frame_ids > train_frame_ids
while test_frame_ids is None:
base_frame_id = self._sample_visible_ids(visible, num_ids=1, min_id=self.num_train_frames - 1,
max_id=len(visible) - self.num_test_frames)
prev_frame_ids = self._sample_visible_ids(visible, num_ids=self.num_train_frames - 1,
min_id=base_frame_id[0] - self.max_gap - gap_increase,
max_id=base_frame_id[0])
if prev_frame_ids is None:
gap_increase += 5
continue
train_frame_ids = base_frame_id + prev_frame_ids
test_frame_ids = self._sample_visible_ids(visible, min_id=train_frame_ids[0] + 1,
max_id=train_frame_ids[0] + self.max_gap + gap_increase,
num_ids=self.num_test_frames)
# Increase gap until a frame is found
gap_increase += 5
else:
# In case of image dataset, just repeat the image to generate synthetic video
train_frame_ids = [1] * self.num_train_frames
test_frame_ids = [1] * self.num_test_frames
train_frames, train_anno, meta_obj_train = dataset.get_frames(seq_id, train_frame_ids, seq_info_dict)
test_frames, test_anno, meta_obj_test = dataset.get_frames(seq_id, test_frame_ids, seq_info_dict)
data = TensorDict({'train_images': train_frames,
'train_anno': train_anno['bbox'],
'test_images': test_frames,
'test_anno': test_anno['bbox'],
'dataset': dataset.get_name(),
'test_class': meta_obj_test.get('object_class_name')})
return self.processing(data)
class DiMPSampler(TrackingSampler):
""" See TrackingSampler."""
def __init__(self, datasets, p_datasets, samples_per_epoch, max_gap,
num_test_frames, num_train_frames=1, processing=no_processing, frame_sample_mode='causal'):
super().__init__(datasets=datasets, p_datasets=p_datasets, samples_per_epoch=samples_per_epoch, max_gap=max_gap,
num_test_frames=num_test_frames, num_train_frames=num_train_frames, processing=processing,
frame_sample_mode=frame_sample_mode)
class ATOMSampler(TrackingSampler):
""" See TrackingSampler."""
def __init__(self, datasets, p_datasets, samples_per_epoch, max_gap,
num_test_frames=1, num_train_frames=1, processing=no_processing, frame_sample_mode='interval'):
super().__init__(datasets=datasets, p_datasets=p_datasets, samples_per_epoch=samples_per_epoch, max_gap=max_gap,
num_test_frames=num_test_frames, num_train_frames=num_train_frames, processing=processing,
frame_sample_mode=frame_sample_mode)
================================================
FILE: artrackv2_mindspore/external/AR/ltr/data/transforms.py
================================================
import random
import numpy as np
import math
import cv2 as cv
import torch
import torch.nn.functional as F
import torchvision.transforms.functional as tvisf
class Transform:
"""A set of transformations, used for e.g. data augmentation.
Args of constructor:
transforms: An arbitrary number of transformations, derived from the TransformBase class.
They are applied in the order they are given.
The Transform object can jointly transform images, bounding boxes and segmentation masks.
This is done by calling the object with the following key-word arguments (all are optional).
The following arguments are inputs to be transformed. They are either supplied as a single instance, or a list of instances.
image - Image
coords - 2xN dimensional Tensor of 2D image coordinates [y, x]
bbox - Bounding box on the form [x, y, w, h]
mask - Segmentation mask with discrete classes
The following parameters can be supplied with calling the transform object:
joint [Bool] - If True then transform all images/coords/bbox/mask in the list jointly using the same transformation.
Otherwise each tuple (images, coords, bbox, mask) will be transformed independently using
different random rolls. Default: True.
new_roll [Bool] - If False, then no new random roll is performed, and the saved result from the previous roll
is used instead. Default: True.
Check the DiMPProcessing class for examples.
"""
def __init__(self, *transforms):
if len(transforms) == 1 and isinstance(transforms[0], (list, tuple)):
transforms = transforms[0]
self.transforms = transforms
self._valid_inputs = ['image', 'coords', 'bbox', 'mask']
self._valid_args = ['joint', 'new_roll']
self._valid_all = self._valid_inputs + self._valid_args
def __call__(self, **inputs):
var_names = [k for k in inputs.keys() if k in self._valid_inputs]
for v in inputs.keys():
if v not in self._valid_all:
raise ValueError('Incorrect input \"{}\" to transform. Only supports inputs {} and arguments {}.'.format(v, self._valid_inputs, self._valid_args))
joint_mode = inputs.get('joint', True)
new_roll = inputs.get('new_roll', True)
if not joint_mode:
out = zip(*[self(**inp) for inp in self._split_inputs(inputs)])
return tuple(list(o) for o in out)
out = {k: v for k, v in inputs.items() if k in self._valid_inputs}
for t in self.transforms:
out = t(**out, joint=joint_mode, new_roll=new_roll)
if len(var_names) == 1:
return out[var_names[0]]
# Make sure order is correct
return tuple(out[v] for v in var_names)
def _split_inputs(self, inputs):
var_names = [k for k in inputs.keys() if k in self._valid_inputs]
split_inputs = [{k: v for k, v in zip(var_names, vals)} for vals in zip(*[inputs[vn] for vn in var_names])]
for arg_name, arg_val in filter(lambda it: it[0]!='joint' and it[0] in self._valid_args, inputs.items()):
if isinstance(arg_val, list):
for inp, av in zip(split_inputs, arg_val):
inp[arg_name] = av
else:
for inp in split_inputs:
inp[arg_name] = arg_val
return split_inputs
def __repr__(self):
format_string = self.__class__.__name__ + '('
for t in self.transforms:
format_string += '\n'
format_string += ' {0}'.format(t)
format_string += '\n)'
return format_string
class TransformBase:
"""Base class for transformation objects. See the Transform class for details."""
def __init__(self):
self._valid_inputs = ['image', 'coords', 'bbox', 'mask']
self._valid_args = ['new_roll']
self._valid_all = self._valid_inputs + self._valid_args
self._rand_params = None
def __call__(self, **inputs):
# Split input
input_vars = {k: v for k, v in inputs.items() if k in self._valid_inputs}
input_args = {k: v for k, v in inputs.items() if k in self._valid_args}
# Roll random parameters for the transform
if input_args.get('new_roll', True):
rand_params = self.roll()
if rand_params is None:
rand_params = ()
elif not isinstance(rand_params, tuple):
rand_params = (rand_params,)
self._rand_params = rand_params
outputs = dict()
for var_name, var in input_vars.items():
if var is not None:
transform_func = getattr(self, 'transform_' + var_name)
if var_name in ['coords', 'bbox']:
params = (self._get_image_size(input_vars),) + self._rand_params
else:
params = self._rand_params
if isinstance(var, (list, tuple)):
outputs[var_name] = [transform_func(x, *params) for x in var]
else:
outputs[var_name] = transform_func(var, *params)
return outputs
def _get_image_size(self, inpu
gitextract_o26t4wgy/
├── ARTrack_env_cuda113.yaml
├── LICENSE
├── README.md
├── artrackv2_mindspore/
│ ├── .gitignore
│ ├── README.md
│ ├── experiments/
│ │ └── ostrack/
│ │ ├── 2stage_256_got.yaml
│ │ ├── best_384.yaml
│ │ ├── finetune.yaml
│ │ ├── finetune_384.yaml
│ │ ├── finetune_384_got.yaml
│ │ ├── vitb_256_mae_32x4_ep300.yaml
│ │ ├── vitb_256_mae_ce_32x4_ep300.yaml
│ │ ├── vitb_256_mae_ce_32x4_got10k_ep100.yaml
│ │ ├── vitb_384_mae_32x4_ep300.yaml
│ │ ├── vitb_384_mae_ce_32x4_ep300.yaml
│ │ └── vitb_384_mae_ce_32x4_got10k_ep100.yaml
│ ├── external/
│ │ ├── AR/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── ltr/
│ │ │ │ ├── README.md
│ │ │ │ ├── __init__.py
│ │ │ │ ├── actors/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── base_actor.py
│ │ │ │ │ ├── bbreg.py
│ │ │ │ │ └── tracking.py
│ │ │ │ ├── admin/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── environment.py
│ │ │ │ │ ├── loading.py
│ │ │ │ │ ├── model_constructor.py
│ │ │ │ │ ├── multigpu.py
│ │ │ │ │ ├── settings.py
│ │ │ │ │ ├── stats.py
│ │ │ │ │ └── tensorboard.py
│ │ │ │ ├── data/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── bounding_box_utils.py
│ │ │ │ │ ├── image_loader.py
│ │ │ │ │ ├── loader.py
│ │ │ │ │ ├── processing.py
│ │ │ │ │ ├── processing_utils.py
│ │ │ │ │ ├── processing_utils_SE.py
│ │ │ │ │ ├── sampler.py
│ │ │ │ │ └── transforms.py
│ │ │ │ ├── dataset/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── base_image_dataset.py
│ │ │ │ │ ├── base_video_dataset.py
│ │ │ │ │ ├── coco.py
│ │ │ │ │ ├── coco_seq.py
│ │ │ │ │ ├── davis.py
│ │ │ │ │ ├── ecssd.py
│ │ │ │ │ ├── got10k.py
│ │ │ │ │ ├── hku_is.py
│ │ │ │ │ ├── imagenetvid.py
│ │ │ │ │ ├── lasot.py
│ │ │ │ │ ├── lvis.py
│ │ │ │ │ ├── msra10k.py
│ │ │ │ │ ├── sbd.py
│ │ │ │ │ ├── synthetic_video.py
│ │ │ │ │ ├── synthetic_video_blend.py
│ │ │ │ │ ├── tracking_net.py
│ │ │ │ │ ├── vos_base.py
│ │ │ │ │ └── youtubevos.py
│ │ │ │ ├── external/
│ │ │ │ │ └── PreciseRoIPooling/
│ │ │ │ │ ├── .gitignore
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── pytorch/
│ │ │ │ │ │ ├── prroi_pool/
│ │ │ │ │ │ │ ├── .gitignore
│ │ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ │ ├── functional.py
│ │ │ │ │ │ │ ├── prroi_pool.py
│ │ │ │ │ │ │ └── src/
│ │ │ │ │ │ │ ├── prroi_pooling_gpu.c
│ │ │ │ │ │ │ ├── prroi_pooling_gpu.h
│ │ │ │ │ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ │ │ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ │ │ │ │ └── tests/
│ │ │ │ │ │ └── test_prroi_pooling2d.py
│ │ │ │ │ └── src/
│ │ │ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ │ │ ├── models/
│ │ │ │ │ ├── AR_seg_mask/
│ │ │ │ │ │ ├── AR_seg_mask.py
│ │ │ │ │ │ └── __init__.py
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── backbone/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── base.py
│ │ │ │ │ │ ├── resnet.py
│ │ │ │ │ │ ├── resnet18_vggm.py
│ │ │ │ │ │ └── resnet_seg.py
│ │ │ │ │ ├── bbreg/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── atom.py
│ │ │ │ │ │ └── atom_iou_net.py
│ │ │ │ │ ├── head/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── seg_network.py
│ │ │ │ │ │ └── utils.py
│ │ │ │ │ ├── layers/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── activation.py
│ │ │ │ │ │ ├── blocks.py
│ │ │ │ │ │ ├── distance.py
│ │ │ │ │ │ ├── filter.py
│ │ │ │ │ │ ├── normalization.py
│ │ │ │ │ │ └── transform.py
│ │ │ │ │ ├── loss/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── kl_regression.py
│ │ │ │ │ │ └── target_classification.py
│ │ │ │ │ ├── meta/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ └── steepestdescent.py
│ │ │ │ │ ├── neck/
│ │ │ │ │ │ ├── CorrNL.py
│ │ │ │ │ │ └── neck_utils.py
│ │ │ │ │ ├── target_classifier/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── features.py
│ │ │ │ │ │ ├── initializer.py
│ │ │ │ │ │ ├── linear_filter.py
│ │ │ │ │ │ ├── optimizer.py
│ │ │ │ │ │ └── residual_modules.py
│ │ │ │ │ └── tracking/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── dimpnet.py
│ │ │ │ ├── run_training.py
│ │ │ │ ├── train_settings/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── bbreg/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── atom.py
│ │ │ │ │ │ ├── atom_gmm_sampl.py
│ │ │ │ │ │ ├── atom_paper.py
│ │ │ │ │ │ └── atom_prob_ml.py
│ │ │ │ │ └── dimp/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── dimp18.py
│ │ │ │ │ ├── dimp50.py
│ │ │ │ │ ├── prdimp18.py
│ │ │ │ │ ├── prdimp50.py
│ │ │ │ │ └── super_dimp.py
│ │ │ │ └── trainers/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base_trainer.py
│ │ │ │ └── ltr_trainer.py
│ │ │ └── pytracking/
│ │ │ ├── ARcm_seg.py
│ │ │ ├── VOT/
│ │ │ │ ├── tracker_DiMP.m
│ │ │ │ ├── trackers.ini
│ │ │ │ └── vot.py
│ │ │ ├── VOT2020_super_only_mask_384_HP/
│ │ │ │ ├── dimp_alpha_065.py
│ │ │ │ ├── dimp_alpha_seg_class.py
│ │ │ │ ├── mixformer_alpha_seg_class.py
│ │ │ │ ├── mixformer_large_alpha_seg_class.py
│ │ │ │ └── vot.py
│ │ │ ├── __init__.py
│ │ │ ├── analysis/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── evaluate_vos.py
│ │ │ │ ├── extract_results.py
│ │ │ │ ├── playback_results.py
│ │ │ │ ├── plot_results.py
│ │ │ │ └── vos_utils.py
│ │ │ ├── evaluation/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── data.py
│ │ │ │ ├── datasets.py
│ │ │ │ ├── environment.py
│ │ │ │ ├── got10kdataset.py
│ │ │ │ ├── lasotdataset.py
│ │ │ │ ├── mobifacedataset.py
│ │ │ │ ├── multi_object_wrapper.py
│ │ │ │ ├── nfsdataset.py
│ │ │ │ ├── otbdataset.py
│ │ │ │ ├── running.py
│ │ │ │ ├── tpldataset.py
│ │ │ │ ├── tracker.py
│ │ │ │ ├── trackingnetdataset.py
│ │ │ │ ├── uavdataset.py
│ │ │ │ ├── vot.py
│ │ │ │ ├── vot2020.py
│ │ │ │ └── votdataset.py
│ │ │ ├── experiments/
│ │ │ │ ├── __init__.py
│ │ │ │ └── myexperiments.py
│ │ │ ├── features/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── augmentation.py
│ │ │ │ ├── color.py
│ │ │ │ ├── deep.py
│ │ │ │ ├── extractor.py
│ │ │ │ ├── featurebase.py
│ │ │ │ ├── net_wrappers.py
│ │ │ │ ├── preprocessing.py
│ │ │ │ └── util.py
│ │ │ ├── libs/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── complex.py
│ │ │ │ ├── dcf.py
│ │ │ │ ├── fourier.py
│ │ │ │ ├── operation.py
│ │ │ │ ├── optimization.py
│ │ │ │ ├── tensordict.py
│ │ │ │ └── tensorlist.py
│ │ │ ├── parameter/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── atom/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── atom_gmm_sampl.py
│ │ │ │ │ ├── atom_prob_ml.py
│ │ │ │ │ ├── default.py
│ │ │ │ │ ├── default_vot.py
│ │ │ │ │ └── multiscale_no_iounet.py
│ │ │ │ ├── dimp/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── dimp18.py
│ │ │ │ │ ├── dimp18_vot.py
│ │ │ │ │ ├── dimp50.py
│ │ │ │ │ ├── dimp50_vot.py
│ │ │ │ │ ├── dimp50_vot19.py
│ │ │ │ │ ├── prdimp18.py
│ │ │ │ │ ├── prdimp50.py
│ │ │ │ │ └── super_dimp.py
│ │ │ │ └── eco/
│ │ │ │ ├── __init__.py
│ │ │ │ └── default.py
│ │ │ ├── tracker/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── atom/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── atom.py
│ │ │ │ │ └── optim.py
│ │ │ │ ├── base/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── basetracker.py
│ │ │ │ ├── dimp/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── dimp.py
│ │ │ │ └── eco/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── eco.py
│ │ │ │ └── optim.py
│ │ │ ├── util_scripts/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── download_results.py
│ │ │ │ ├── pack_got10k_results.py
│ │ │ │ └── pack_trackingnet_results.py
│ │ │ ├── utils/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── convert_vot_anno_to_rect.py
│ │ │ │ ├── load_text.py
│ │ │ │ ├── loading.py
│ │ │ │ ├── params.py
│ │ │ │ ├── plotting.py
│ │ │ │ └── visdom.py
│ │ │ └── vot20_utils.py
│ │ ├── PreciseRoIPooling/
│ │ │ ├── .gitignore
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── pytorch/
│ │ │ │ ├── prroi_pool/
│ │ │ │ │ ├── .gitignore
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── functional.py
│ │ │ │ │ ├── prroi_pool.py
│ │ │ │ │ └── src/
│ │ │ │ │ ├── prroi_pooling_gpu.c
│ │ │ │ │ ├── prroi_pooling_gpu.h
│ │ │ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ │ │ └── tests/
│ │ │ │ └── test_prroi_pooling2d.py
│ │ │ └── src/
│ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ └── vot20/
│ │ └── cttrack/
│ │ ├── config.yaml
│ │ └── trackers.ini
│ ├── lib/
│ │ ├── __init__.py
│ │ ├── config/
│ │ │ ├── __init__.py
│ │ │ └── ostrack/
│ │ │ └── config.py
│ │ ├── models/
│ │ │ ├── __init__.py
│ │ │ ├── component/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── attention.py
│ │ │ │ ├── block.py
│ │ │ │ ├── drop.py
│ │ │ │ ├── mlp.py
│ │ │ │ ├── norm.py
│ │ │ │ ├── patch_embed.py
│ │ │ │ ├── pos_embed.py
│ │ │ │ └── weight_init.py
│ │ │ ├── layers/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── attn.py
│ │ │ │ ├── attn_blocks.py
│ │ │ │ ├── head.py
│ │ │ │ ├── mask_decoder.py
│ │ │ │ ├── patch_embed.py
│ │ │ │ ├── rpe.py
│ │ │ │ └── self_practice.py
│ │ │ ├── ostrack/
│ │ │ │ ├── Vit_model_test.py
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base_backbone.py
│ │ │ │ ├── load_parameter_test.py
│ │ │ │ ├── ostrack.py
│ │ │ │ ├── ostrack_test.py
│ │ │ │ ├── utils.py
│ │ │ │ ├── vit.py
│ │ │ │ └── vit_ce.py
│ │ │ └── timm.py
│ │ ├── train/
│ │ │ ├── __init__.py
│ │ │ ├── _init_paths.py
│ │ │ ├── actors/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base_actor.py
│ │ │ │ └── ostrack.py
│ │ │ ├── admin/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── environment.py
│ │ │ │ ├── local.py
│ │ │ │ ├── settings.py
│ │ │ │ ├── stats.py
│ │ │ │ └── tensorboard.py
│ │ │ ├── base_functions.py
│ │ │ ├── data/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── bounding_box_utils.py
│ │ │ │ ├── image_loader.py
│ │ │ │ ├── loader.py
│ │ │ │ ├── processing.py
│ │ │ │ ├── processing_utils.py
│ │ │ │ ├── sampler.py
│ │ │ │ ├── sequence_sampler.py
│ │ │ │ ├── transforms.py
│ │ │ │ └── wandb_logger.py
│ │ │ ├── data_specs/
│ │ │ │ ├── README.md
│ │ │ │ ├── got10k_train_full_split.txt
│ │ │ │ ├── got10k_train_split.txt
│ │ │ │ ├── got10k_val_split.txt
│ │ │ │ ├── got10k_vot_exclude.txt
│ │ │ │ ├── got10k_vot_train_split.txt
│ │ │ │ ├── got10k_vot_val_split.txt
│ │ │ │ ├── lasot_train_split.txt
│ │ │ │ └── trackingnet_classmap.txt
│ │ │ ├── dataset/
│ │ │ │ ├── COCO_tool.py
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base_image_dataset.py
│ │ │ │ ├── base_video_dataset.py
│ │ │ │ ├── coco.py
│ │ │ │ ├── coco_seq.py
│ │ │ │ ├── coco_seq_lmdb.py
│ │ │ │ ├── got10k.py
│ │ │ │ ├── got10k_lmdb.py
│ │ │ │ ├── imagenetvid.py
│ │ │ │ ├── imagenetvid_lmdb.py
│ │ │ │ ├── lasot.py
│ │ │ │ ├── lasot_lmdb.py
│ │ │ │ ├── tracking_net.py
│ │ │ │ └── tracking_net_lmdb.py
│ │ │ ├── run_training.py
│ │ │ ├── train_script.py
│ │ │ ├── train_script_distill.py
│ │ │ └── trainers/
│ │ │ ├── __init__.py
│ │ │ ├── base_trainer.py
│ │ │ └── ltr_trainer.py
│ │ ├── utils/
│ │ │ ├── __init__.py
│ │ │ ├── box_ops.py
│ │ │ ├── ce_utils.py
│ │ │ ├── focal_loss.py
│ │ │ ├── heapmap_utils.py
│ │ │ ├── image.py
│ │ │ ├── lmdb_utils.py
│ │ │ ├── merge.py
│ │ │ ├── misc.py
│ │ │ ├── tensor.py
│ │ │ └── variable_hook.py
│ │ └── vis/
│ │ ├── __init__.py
│ │ ├── plotting.py
│ │ └── utils.py
│ └── tracking/
│ ├── _init_paths.py
│ ├── analysis_results.ipynb
│ ├── analysis_results.py
│ ├── analysis_results_ITP.py
│ ├── convert_transt.py
│ ├── create_default_local_file.py
│ ├── download_pytracking_results.py
│ ├── pre_read_datasets.py
│ ├── profile_model.py
│ ├── test.py
│ ├── test_exp.py
│ ├── train.py
│ ├── video_demo.py
│ └── vis_results.py
├── experiments/
│ ├── artrack/
│ │ ├── artrack_256_full.yaml
│ │ ├── artrack_256_got.yaml
│ │ ├── artrack_384_full.yaml
│ │ └── artrack_large_384_full.yaml
│ ├── artrack_seq/
│ │ ├── artrack_seq_256_full.yaml
│ │ ├── artrack_seq_256_got.yaml
│ │ ├── artrack_seq_384_full.yaml
│ │ └── artrack_seq_large_384_full.yaml
│ ├── artrackv2/
│ │ ├── artrackv2_256_full.yaml
│ │ ├── artrackv2_256_got.yaml
│ │ └── artrackv2_large_384_got.yaml
│ └── artrackv2_seq/
│ ├── artrackv2_seq_256_full.yaml
│ ├── artrackv2_seq_256_got.yaml
│ └── artrackv2_seq_large_384_got.yaml
├── external/
│ ├── AR/
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── ltr/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── actors/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base_actor.py
│ │ │ │ ├── bbreg.py
│ │ │ │ └── tracking.py
│ │ │ ├── admin/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── environment.py
│ │ │ │ ├── loading.py
│ │ │ │ ├── model_constructor.py
│ │ │ │ ├── multigpu.py
│ │ │ │ ├── settings.py
│ │ │ │ ├── stats.py
│ │ │ │ └── tensorboard.py
│ │ │ ├── data/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── bounding_box_utils.py
│ │ │ │ ├── image_loader.py
│ │ │ │ ├── loader.py
│ │ │ │ ├── processing.py
│ │ │ │ ├── processing_utils.py
│ │ │ │ ├── processing_utils_SE.py
│ │ │ │ ├── sampler.py
│ │ │ │ └── transforms.py
│ │ │ ├── dataset/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base_image_dataset.py
│ │ │ │ ├── base_video_dataset.py
│ │ │ │ ├── coco.py
│ │ │ │ ├── coco_seq.py
│ │ │ │ ├── davis.py
│ │ │ │ ├── ecssd.py
│ │ │ │ ├── got10k.py
│ │ │ │ ├── hku_is.py
│ │ │ │ ├── imagenetvid.py
│ │ │ │ ├── lasot.py
│ │ │ │ ├── lvis.py
│ │ │ │ ├── msra10k.py
│ │ │ │ ├── sbd.py
│ │ │ │ ├── synthetic_video.py
│ │ │ │ ├── synthetic_video_blend.py
│ │ │ │ ├── tracking_net.py
│ │ │ │ ├── vos_base.py
│ │ │ │ └── youtubevos.py
│ │ │ ├── external/
│ │ │ │ └── PreciseRoIPooling/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── LICENSE
│ │ │ │ ├── README.md
│ │ │ │ ├── pytorch/
│ │ │ │ │ ├── prroi_pool/
│ │ │ │ │ │ ├── .gitignore
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── functional.py
│ │ │ │ │ │ ├── prroi_pool.py
│ │ │ │ │ │ └── src/
│ │ │ │ │ │ ├── prroi_pooling_gpu.c
│ │ │ │ │ │ ├── prroi_pooling_gpu.h
│ │ │ │ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ │ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ │ │ │ └── tests/
│ │ │ │ │ └── test_prroi_pooling2d.py
│ │ │ │ └── src/
│ │ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ │ ├── models/
│ │ │ │ ├── AR_seg_mask/
│ │ │ │ │ ├── AR_seg_mask.py
│ │ │ │ │ └── __init__.py
│ │ │ │ ├── __init__.py
│ │ │ │ ├── backbone/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── base.py
│ │ │ │ │ ├── resnet.py
│ │ │ │ │ ├── resnet18_vggm.py
│ │ │ │ │ └── resnet_seg.py
│ │ │ │ ├── bbreg/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── atom.py
│ │ │ │ │ └── atom_iou_net.py
│ │ │ │ ├── head/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── seg_network.py
│ │ │ │ │ └── utils.py
│ │ │ │ ├── layers/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── activation.py
│ │ │ │ │ ├── blocks.py
│ │ │ │ │ ├── distance.py
│ │ │ │ │ ├── filter.py
│ │ │ │ │ ├── normalization.py
│ │ │ │ │ └── transform.py
│ │ │ │ ├── loss/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── kl_regression.py
│ │ │ │ │ └── target_classification.py
│ │ │ │ ├── meta/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── steepestdescent.py
│ │ │ │ ├── neck/
│ │ │ │ │ ├── CorrNL.py
│ │ │ │ │ └── neck_utils.py
│ │ │ │ ├── target_classifier/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── features.py
│ │ │ │ │ ├── initializer.py
│ │ │ │ │ ├── linear_filter.py
│ │ │ │ │ ├── optimizer.py
│ │ │ │ │ └── residual_modules.py
│ │ │ │ └── tracking/
│ │ │ │ ├── __init__.py
│ │ │ │ └── dimpnet.py
│ │ │ ├── run_training.py
│ │ │ ├── train_settings/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── bbreg/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── atom.py
│ │ │ │ │ ├── atom_gmm_sampl.py
│ │ │ │ │ ├── atom_paper.py
│ │ │ │ │ └── atom_prob_ml.py
│ │ │ │ └── dimp/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── dimp18.py
│ │ │ │ ├── dimp50.py
│ │ │ │ ├── prdimp18.py
│ │ │ │ ├── prdimp50.py
│ │ │ │ └── super_dimp.py
│ │ │ └── trainers/
│ │ │ ├── __init__.py
│ │ │ ├── base_trainer.py
│ │ │ └── ltr_trainer.py
│ │ └── pytracking/
│ │ ├── ARcm_seg.py
│ │ ├── VOT/
│ │ │ ├── tracker_DiMP.m
│ │ │ ├── trackers.ini
│ │ │ └── vot.py
│ │ ├── VOT2020_super_only_mask_384_HP/
│ │ │ ├── dimp_alpha_065.py
│ │ │ ├── dimp_alpha_seg_class.py
│ │ │ ├── mixformer_alpha_seg_class.py
│ │ │ ├── mixformer_large_alpha_seg_class.py
│ │ │ └── vot.py
│ │ ├── __init__.py
│ │ ├── analysis/
│ │ │ ├── __init__.py
│ │ │ ├── evaluate_vos.py
│ │ │ ├── extract_results.py
│ │ │ ├── playback_results.py
│ │ │ ├── plot_results.py
│ │ │ └── vos_utils.py
│ │ ├── evaluation/
│ │ │ ├── __init__.py
│ │ │ ├── data.py
│ │ │ ├── datasets.py
│ │ │ ├── environment.py
│ │ │ ├── got10kdataset.py
│ │ │ ├── lasotdataset.py
│ │ │ ├── mobifacedataset.py
│ │ │ ├── multi_object_wrapper.py
│ │ │ ├── nfsdataset.py
│ │ │ ├── otbdataset.py
│ │ │ ├── running.py
│ │ │ ├── tpldataset.py
│ │ │ ├── tracker.py
│ │ │ ├── trackingnetdataset.py
│ │ │ ├── uavdataset.py
│ │ │ ├── vot.py
│ │ │ ├── vot2020.py
│ │ │ └── votdataset.py
│ │ ├── experiments/
│ │ │ ├── __init__.py
│ │ │ └── myexperiments.py
│ │ ├── features/
│ │ │ ├── __init__.py
│ │ │ ├── augmentation.py
│ │ │ ├── color.py
│ │ │ ├── deep.py
│ │ │ ├── extractor.py
│ │ │ ├── featurebase.py
│ │ │ ├── net_wrappers.py
│ │ │ ├── preprocessing.py
│ │ │ └── util.py
│ │ ├── libs/
│ │ │ ├── __init__.py
│ │ │ ├── complex.py
│ │ │ ├── dcf.py
│ │ │ ├── fourier.py
│ │ │ ├── operation.py
│ │ │ ├── optimization.py
│ │ │ ├── tensordict.py
│ │ │ └── tensorlist.py
│ │ ├── parameter/
│ │ │ ├── __init__.py
│ │ │ ├── atom/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── atom_gmm_sampl.py
│ │ │ │ ├── atom_prob_ml.py
│ │ │ │ ├── default.py
│ │ │ │ ├── default_vot.py
│ │ │ │ └── multiscale_no_iounet.py
│ │ │ ├── dimp/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── dimp18.py
│ │ │ │ ├── dimp18_vot.py
│ │ │ │ ├── dimp50.py
│ │ │ │ ├── dimp50_vot.py
│ │ │ │ ├── dimp50_vot19.py
│ │ │ │ ├── prdimp18.py
│ │ │ │ ├── prdimp50.py
│ │ │ │ └── super_dimp.py
│ │ │ └── eco/
│ │ │ ├── __init__.py
│ │ │ └── default.py
│ │ ├── tracker/
│ │ │ ├── __init__.py
│ │ │ ├── atom/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── atom.py
│ │ │ │ └── optim.py
│ │ │ ├── base/
│ │ │ │ ├── __init__.py
│ │ │ │ └── basetracker.py
│ │ │ ├── dimp/
│ │ │ │ ├── __init__.py
│ │ │ │ └── dimp.py
│ │ │ └── eco/
│ │ │ ├── __init__.py
│ │ │ ├── eco.py
│ │ │ └── optim.py
│ │ ├── util_scripts/
│ │ │ ├── __init__.py
│ │ │ ├── download_results.py
│ │ │ ├── pack_got10k_results.py
│ │ │ └── pack_trackingnet_results.py
│ │ ├── utils/
│ │ │ ├── __init__.py
│ │ │ ├── convert_vot_anno_to_rect.py
│ │ │ ├── load_text.py
│ │ │ ├── loading.py
│ │ │ ├── params.py
│ │ │ ├── plotting.py
│ │ │ └── visdom.py
│ │ └── vot20_utils.py
│ ├── PreciseRoIPooling/
│ │ ├── .gitignore
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── pytorch/
│ │ │ ├── prroi_pool/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── __init__.py
│ │ │ │ ├── functional.py
│ │ │ │ ├── prroi_pool.py
│ │ │ │ └── src/
│ │ │ │ ├── prroi_pooling_gpu.c
│ │ │ │ ├── prroi_pooling_gpu.h
│ │ │ │ ├── prroi_pooling_gpu_impl.cu
│ │ │ │ └── prroi_pooling_gpu_impl.cuh
│ │ │ └── tests/
│ │ │ └── test_prroi_pooling2d.py
│ │ └── src/
│ │ ├── prroi_pooling_gpu_impl.cu
│ │ └── prroi_pooling_gpu_impl.cuh
│ └── vot20/
│ └── cttrack/
│ ├── config.yaml
│ └── trackers.ini
├── lib/
│ ├── __init__.py
│ ├── config/
│ │ ├── __init__.py
│ │ ├── artrack/
│ │ │ └── config.py
│ │ ├── artrack_seq/
│ │ │ └── config.py
│ │ ├── artrackv2/
│ │ │ └── config.py
│ │ └── artrackv2_seq/
│ │ └── config.py
│ ├── models/
│ │ ├── __init__.py
│ │ ├── artrack/
│ │ │ ├── __init__.py
│ │ │ ├── artrack.py
│ │ │ ├── base_backbone.py
│ │ │ ├── utils.py
│ │ │ ├── vit.py
│ │ │ └── vit_ce.py
│ │ ├── artrack_seq/
│ │ │ ├── __init__.py
│ │ │ ├── artrack_seq.py
│ │ │ ├── base_backbone.py
│ │ │ ├── utils.py
│ │ │ ├── vit.py
│ │ │ └── vit_ce.py
│ │ ├── artrackv2/
│ │ │ ├── __init__.py
│ │ │ ├── artrackv2.py
│ │ │ ├── base_backbone.py
│ │ │ ├── utils.py
│ │ │ └── vit.py
│ │ ├── artrackv2_seq/
│ │ │ ├── __init__.py
│ │ │ ├── artrackv2_seq.py
│ │ │ ├── base_backbone.py
│ │ │ ├── utils.py
│ │ │ └── vit.py
│ │ ├── layers/
│ │ │ ├── __init__.py
│ │ │ ├── attn.py
│ │ │ ├── attn_blocks.py
│ │ │ ├── frozen_bn.py
│ │ │ ├── head.py
│ │ │ ├── head_seq.py
│ │ │ ├── mask_decoder.py
│ │ │ ├── patch_embed.py
│ │ │ └── rpe.py
│ │ └── mask_decoder/
│ │ ├── __init__.py
│ │ ├── attention.py
│ │ ├── block.py
│ │ ├── drop.py
│ │ ├── mlp.py
│ │ ├── norm.py
│ │ ├── patch_embed.py
│ │ ├── pos_embed.py
│ │ └── weight_init.py
│ ├── test/
│ │ ├── __init__.py
│ │ ├── analysis/
│ │ │ ├── __init__.py
│ │ │ ├── extract_results.py
│ │ │ └── plot_results.py
│ │ ├── evaluation/
│ │ │ ├── __init__.py
│ │ │ ├── data.py
│ │ │ ├── datasets.py
│ │ │ ├── environment.py
│ │ │ ├── got10kdataset.py
│ │ │ ├── itbdataset.py
│ │ │ ├── lasot_lmdbdataset.py
│ │ │ ├── lasotdataset.py
│ │ │ ├── lasotextensionsubsetdataset.py
│ │ │ ├── local.py
│ │ │ ├── nfsdataset.py
│ │ │ ├── otbdataset.py
│ │ │ ├── running.py
│ │ │ ├── tc128cedataset.py
│ │ │ ├── tc128dataset.py
│ │ │ ├── tnl2kdataset.py
│ │ │ ├── tracker.py
│ │ │ ├── trackingnetdataset.py
│ │ │ ├── uavdataset.py
│ │ │ └── votdataset.py
│ │ ├── parameter/
│ │ │ ├── __init__.py
│ │ │ ├── artrack.py
│ │ │ ├── artrack_seq.py
│ │ │ ├── artrackv2.py
│ │ │ └── artrackv2_seq.py
│ │ ├── tracker/
│ │ │ ├── __init__.py
│ │ │ ├── artrack.py
│ │ │ ├── artrack_seq.py
│ │ │ ├── artrackv2.py
│ │ │ ├── artrackv2_seq.py
│ │ │ ├── basetracker.py
│ │ │ ├── data_utils.py
│ │ │ └── vis_utils.py
│ │ └── utils/
│ │ ├── __init__.py
│ │ ├── _init_paths.py
│ │ ├── hann.py
│ │ ├── load_text.py
│ │ ├── params.py
│ │ ├── transform_got10k.py
│ │ └── transform_trackingnet.py
│ ├── train/
│ │ ├── __init__.py
│ │ ├── _init_paths.py
│ │ ├── actors/
│ │ │ ├── __init__.py
│ │ │ ├── artrack.py
│ │ │ ├── artrack_seq.py
│ │ │ ├── artrackv2.py
│ │ │ ├── artrackv2_seq.py
│ │ │ └── base_actor.py
│ │ ├── admin/
│ │ │ ├── __init__.py
│ │ │ ├── environment.py
│ │ │ ├── local.py
│ │ │ ├── multigpu.py
│ │ │ ├── settings.py
│ │ │ ├── stats.py
│ │ │ └── tensorboard.py
│ │ ├── base_functions.py
│ │ ├── data/
│ │ │ ├── __init__.py
│ │ │ ├── bounding_box_utils.py
│ │ │ ├── image_loader.py
│ │ │ ├── loader.py
│ │ │ ├── processing.py
│ │ │ ├── processing_utils.py
│ │ │ ├── sampler.py
│ │ │ ├── sequence_sampler.py
│ │ │ ├── sequence_sampler_v2.py
│ │ │ ├── transforms.py
│ │ │ └── wandb_logger.py
│ │ ├── data_specs/
│ │ │ ├── README.md
│ │ │ ├── got10k_train_full_split.txt
│ │ │ ├── got10k_train_split.txt
│ │ │ ├── got10k_val_split.txt
│ │ │ ├── got10k_vot_exclude.txt
│ │ │ ├── got10k_vot_train_split.txt
│ │ │ ├── got10k_vot_val_split.txt
│ │ │ ├── lasot_train_split.txt
│ │ │ └── trackingnet_classmap.txt
│ │ ├── dataset/
│ │ │ ├── COCO_tool.py
│ │ │ ├── __init__.py
│ │ │ ├── base_image_dataset.py
│ │ │ ├── base_video_dataset.py
│ │ │ ├── coco.py
│ │ │ ├── coco_seq.py
│ │ │ ├── coco_seq_lmdb.py
│ │ │ ├── got10k.py
│ │ │ ├── got10k_lmdb.py
│ │ │ ├── imagenetvid.py
│ │ │ ├── imagenetvid_lmdb.py
│ │ │ ├── lasot.py
│ │ │ ├── lasot_lmdb.py
│ │ │ ├── tracking_net.py
│ │ │ └── tracking_net_lmdb.py
│ │ ├── run_training.py
│ │ ├── train_script.py
│ │ ├── train_script_distill.py
│ │ └── trainers/
│ │ ├── __init__.py
│ │ ├── base_trainer.py
│ │ ├── ltr_seq_trainer.py
│ │ ├── ltr_seq_trainer_v2.py
│ │ └── ltr_trainer.py
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── box_ops.py
│ │ ├── ce_utils.py
│ │ ├── focal_loss.py
│ │ ├── heapmap_utils.py
│ │ ├── image.py
│ │ ├── lmdb_utils.py
│ │ ├── merge.py
│ │ ├── misc.py
│ │ ├── tensor.py
│ │ └── variable_hook.py
│ └── vis/
│ ├── __init__.py
│ ├── plotting.py
│ ├── utils.py
│ └── visdom_cus.py
└── tracking/
├── _init_paths.py
├── analysis_results.py
├── analysis_results_ITP.py
├── convert_transt.py
├── create_default_local_file.py
├── download_pytracking_results.py
├── pre_read_datasets.py
├── test.py
├── test_exp.py
└── train.py
Showing preview only (398K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (4831 symbols across 537 files)
FILE: artrackv2_mindspore/external/AR/ltr/actors/base_actor.py
class BaseActor (line 4) | class BaseActor:
method __init__ (line 7) | def __init__(self, net, objective):
method __call__ (line 16) | def __call__(self, data: TensorDict):
method to (line 28) | def to(self, device):
method train (line 35) | def train(self, mode=True):
method eval (line 42) | def eval(self):
FILE: artrackv2_mindspore/external/AR/ltr/actors/bbreg.py
class AtomActor (line 4) | class AtomActor(BaseActor):
method __call__ (line 6) | def __call__(self, data):
class AtomBBKLActor (line 32) | class AtomBBKLActor(BaseActor):
method __call__ (line 34) | def __call__(self, data):
FILE: artrackv2_mindspore/external/AR/ltr/actors/tracking.py
class DiMPActor (line 5) | class DiMPActor(BaseActor):
method __init__ (line 7) | def __init__(self, net, objective, loss_weight=None):
method __call__ (line 13) | def __call__(self, data):
class KLDiMPActor (line 73) | class KLDiMPActor(BaseActor):
method __init__ (line 75) | def __init__(self, net, objective, loss_weight=None):
method __call__ (line 81) | def __call__(self, data):
FILE: artrackv2_mindspore/external/AR/ltr/admin/environment.py
function create_default_local_file (line 6) | def create_default_local_file():
function env_settings (line 44) | def env_settings():
FILE: artrackv2_mindspore/external/AR/ltr/admin/loading.py
function load_trained_network (line 10) | def load_trained_network(workspace_dir, network_path, checkpoint=None):
function load_pretrained (line 19) | def load_pretrained(module, name, checkpoint=None, **kwargs):
function load_network (line 34) | def load_network(network_dir=None, checkpoint=None, constructor_fun_name...
function load_weights (line 111) | def load_weights(net, path, strict=True):
function torch_load_legacy (line 118) | def torch_load_legacy(path):
function _setup_legacy_env (line 133) | def _setup_legacy_env():
function _cleanup_legacy_env (line 144) | def _cleanup_legacy_env():
FILE: artrackv2_mindspore/external/AR/ltr/admin/model_constructor.py
function model_constructor (line 5) | def model_constructor(f):
class NetConstructor (line 24) | class NetConstructor:
method __init__ (line 28) | def __init__(self, fun_name, fun_module, args, kwds):
method get (line 41) | def get(self):
FILE: artrackv2_mindspore/external/AR/ltr/admin/multigpu.py
function is_multi_gpu (line 4) | def is_multi_gpu(net):
class MultiGPU (line 8) | class MultiGPU(nn.DataParallel):
method __getattr__ (line 10) | def __getattr__(self, item):
FILE: artrackv2_mindspore/external/AR/ltr/admin/settings.py
class Settings (line 4) | class Settings:
method __init__ (line 6) | def __init__(self):
method set_default (line 9) | def set_default(self):
FILE: artrackv2_mindspore/external/AR/ltr/admin/stats.py
class StatValue (line 3) | class StatValue:
method __init__ (line 4) | def __init__(self):
method reset (line 7) | def reset(self):
method clear (line 10) | def clear(self):
method update (line 14) | def update(self, val):
class AverageMeter (line 19) | class AverageMeter(object):
method __init__ (line 21) | def __init__(self):
method reset (line 25) | def reset(self):
method clear (line 31) | def clear(self):
method update (line 35) | def update(self, val, n=1):
method new_epoch (line 41) | def new_epoch(self):
function topk_accuracy (line 50) | def topk_accuracy(output, target, topk=(1,)):
FILE: artrackv2_mindspore/external/AR/ltr/admin/tensorboard.py
class TensorboardWriter (line 10) | class TensorboardWriter:
method __init__ (line 11) | def __init__(self, directory, loader_names):
method write_info (line 15) | def write_info(self, module_name, script_name, description):
method write_epoch (line 22) | def write_epoch(self, stats: OrderedDict, epoch: int, ind=-1):
FILE: artrackv2_mindspore/external/AR/ltr/data/bounding_box_utils.py
function rect_to_rel (line 4) | def rect_to_rel(bb, sz_norm=None):
function rel_to_rect (line 21) | def rel_to_rect(bb, sz_norm=None):
function masks_to_bboxes (line 33) | def masks_to_bboxes(mask, fmt='c'):
function masks_to_bboxes_multi (line 70) | def masks_to_bboxes_multi(mask, ids, fmt='c'):
FILE: artrackv2_mindspore/external/AR/ltr/data/image_loader.py
function default_image_loader (line 15) | def default_image_loader(path):
function jpeg4py_loader (line 34) | def jpeg4py_loader(path):
function opencv_loader (line 44) | def opencv_loader(path):
function jpeg4py_loader_w_failsafe (line 57) | def jpeg4py_loader_w_failsafe(path):
function opencv_seg_loader (line 73) | def opencv_seg_loader(path):
function imread_indexed (line 83) | def imread_indexed(filename):
function imwrite_indexed (line 92) | def imwrite_indexed(filename, array, color_palette=None):
FILE: artrackv2_mindspore/external/AR/ltr/data/loader.py
function _check_use_shared_memory (line 9) | def _check_use_shared_memory():
function ltr_collate (line 18) | def ltr_collate(batch):
function ltr_collate_stack1 (line 69) | def ltr_collate_stack1(batch):
class LTRLoader (line 120) | class LTRLoader(torch.utils.data.dataloader.DataLoader):
method __init__ (line 172) | def __init__(self, name, dataset, training=True, batch_size=1, shuffle...
FILE: artrackv2_mindspore/external/AR/ltr/data/processing.py
function stack_tensors (line 7) | def stack_tensors(x):
class BaseProcessing (line 13) | class BaseProcessing:
method __init__ (line 17) | def __init__(self, transform=transforms.ToTensor(), train_transform=No...
method __call__ (line 33) | def __call__(self, data: TensorDict):
class ATOMProcessing (line 37) | class ATOMProcessing(BaseProcessing):
method __init__ (line 47) | def __init__(self, search_area_factor, output_sz, center_jitter_factor...
method _get_jittered_box (line 69) | def _get_jittered_box(self, box, mode):
method _generate_proposals (line 85) | def _generate_proposals(self, box):
method __call__ (line 114) | def __call__(self, data: TensorDict):
class KLBBregProcessing (line 157) | class KLBBregProcessing(BaseProcessing):
method __init__ (line 162) | def __init__(self, search_area_factor, output_sz, center_jitter_factor...
method _get_jittered_box (line 184) | def _get_jittered_box(self, box, mode):
method _generate_proposals (line 200) | def _generate_proposals(self, box):
method __call__ (line 213) | def __call__(self, data: TensorDict):
class ATOMwKLProcessing (line 257) | class ATOMwKLProcessing(BaseProcessing):
method __init__ (line 259) | def __init__(self, search_area_factor, output_sz, center_jitter_factor...
method _get_jittered_box (line 269) | def _get_jittered_box(self, box, mode):
method _generate_proposals (line 285) | def _generate_proposals(self, box):
method __call__ (line 296) | def __call__(self, data: TensorDict):
class DiMPProcessing (line 334) | class DiMPProcessing(BaseProcessing):
method __init__ (line 347) | def __init__(self, search_area_factor, output_sz, center_jitter_factor...
method _get_jittered_box (line 378) | def _get_jittered_box(self, box, mode):
method _generate_proposals (line 394) | def _generate_proposals(self, box):
method _generate_label_function (line 426) | def _generate_label_function(self, target_bb):
method __call__ (line 442) | def __call__(self, data: TensorDict):
class KLDiMPProcessing (line 491) | class KLDiMPProcessing(BaseProcessing):
method __init__ (line 496) | def __init__(self, search_area_factor, output_sz, center_jitter_factor...
method _get_jittered_box (line 530) | def _get_jittered_box(self, box, mode):
method _generate_proposals (line 546) | def _generate_proposals(self, box):
method _generate_label_function (line 560) | def _generate_label_function(self, target_bb):
method _generate_label_density (line 576) | def _generate_label_density(self, target_bb):
method __call__ (line 605) | def __call__(self, data: TensorDict):
FILE: artrackv2_mindspore/external/AR/ltr/data/processing_utils.py
function sample_target (line 9) | def sample_target(im, target_bb, search_area_factor, output_sz=None, mas...
function transform_image_to_crop (line 68) | def transform_image_to_crop(box_in: torch.Tensor, box_extract: torch.Ten...
function jittered_center_crop (line 91) | def jittered_center_crop(frames, box_extract, box_gt, search_area_factor...
function sample_target_adaptive (line 128) | def sample_target_adaptive(im, target_bb, search_area_factor, output_sz,...
function crop_and_resize (line 240) | def crop_and_resize(im, box, crop_bb, output_sz, mask=None):
function transform_box_to_crop (line 298) | def transform_box_to_crop(box: torch.Tensor, crop_box: torch.Tensor, cro...
function target_image_crop (line 319) | def target_image_crop(frames, box_extract, box_gt, search_area_factor, o...
function iou (line 371) | def iou(reference, proposals):
function rand_uniform (line 394) | def rand_uniform(a, b, shape=1):
function perturb_box (line 407) | def perturb_box(box, min_iou=0.5, sigma_factor=0.1):
function gauss_1d (line 469) | def gauss_1d(sz, sigma, center, end_pad=0, density=False):
function gauss_2d (line 477) | def gauss_2d(sz, sigma, center, end_pad=(0, 0), density=False):
function gaussian_label_function (line 484) | def gaussian_label_function(target_bb, sigma_factor, kernel_sz, feat_sz,...
function gauss_density_centered (line 520) | def gauss_density_centered(x, std):
function gmm_density_centered (line 529) | def gmm_density_centered(x, std):
function sample_gmm_centered (line 542) | def sample_gmm_centered(std, num_samples=1):
function sample_gmm (line 564) | def sample_gmm(mean, std, num_samples=1):
function sample_box_gmm (line 589) | def sample_box_gmm(mean_box, proposal_sigma, gt_sigma=None, num_samples=...
FILE: artrackv2_mindspore/external/AR/ltr/data/processing_utils_SE.py
function stack_tensors (line 8) | def stack_tensors(x):
function sample_target_SE (line 15) | def sample_target_SE(im, target_bb, search_area_factor, output_sz=None, ...
function map_mask_back (line 66) | def map_mask_back(im, target_bb, search_area_factor, mask, mode=cv.BORDE...
function transform_image_to_crop_SE (line 114) | def transform_image_to_crop_SE(box_in: torch.Tensor, box_extract: torch....
function centered_crop (line 146) | def centered_crop(frames, anno, area_factor, output_sz):
function jittered_center_crop_SE (line 162) | def jittered_center_crop_SE(frames, box_extract, box_gt, search_area_fac...
function sample_target_nopad (line 196) | def sample_target_nopad(im, target_bb, search_area_factor, output_sz):
function transform_box_to_crop (line 255) | def transform_box_to_crop(box: torch.Tensor, crop_box: torch.Tensor, cro...
function jittered_center_crop_nopad (line 276) | def jittered_center_crop_nopad(frames, box_extract, box_gt, search_area_...
function iou (line 312) | def iou(reference, proposals):
function rand_uniform (line 335) | def rand_uniform(a, b, shape=1):
function perturb_box (line 348) | def perturb_box(box, min_iou=0.5, sigma_factor=0.1):
function gauss_1d (line 410) | def gauss_1d(sz, sigma, center, end_pad=0):
function gauss_2d (line 415) | def gauss_2d(sz, sigma, center, end_pad=(0, 0)):
function gaussian_label_function (line 422) | def gaussian_label_function(target_bb, sigma_factor, kernel_sz, feat_sz,...
FILE: artrackv2_mindspore/external/AR/ltr/data/sampler.py
function no_processing (line 6) | def no_processing(data):
class TrackingSampler (line 10) | class TrackingSampler(torch.utils.data.Dataset):
method __init__ (line 25) | def __init__(self, datasets, p_datasets, samples_per_epoch, max_gap,
method __len__ (line 56) | def __len__(self):
method _sample_visible_ids (line 59) | def _sample_visible_ids(self, visible, num_ids=1, min_id=None, max_id=...
method __getitem__ (line 86) | def __getitem__(self, index):
class DiMPSampler (line 172) | class DiMPSampler(TrackingSampler):
method __init__ (line 175) | def __init__(self, datasets, p_datasets, samples_per_epoch, max_gap,
class ATOMSampler (line 182) | class ATOMSampler(TrackingSampler):
method __init__ (line 185) | def __init__(self, datasets, p_datasets, samples_per_epoch, max_gap,
FILE: artrackv2_mindspore/external/AR/ltr/data/transforms.py
class Transform (line 10) | class Transform:
method __init__ (line 35) | def __init__(self, *transforms):
method __call__ (line 43) | def __call__(self, **inputs):
method _split_inputs (line 65) | def _split_inputs(self, inputs):
method __repr__ (line 77) | def __repr__(self):
class TransformBase (line 86) | class TransformBase:
method __init__ (line 88) | def __init__(self):
method __call__ (line 94) | def __call__(self, **inputs):
method _get_image_size (line 122) | def _get_image_size(self, inputs):
method roll (line 138) | def roll(self):
method transform_image (line 141) | def transform_image(self, image, *rand_params):
method transform_coords (line 145) | def transform_coords(self, coords, image_shape, *rand_params):
method transform_bbox (line 149) | def transform_bbox(self, bbox, image_shape, *rand_params):
method transform_mask (line 171) | def transform_mask(self, mask, *rand_params):
class ToTensor (line 176) | class ToTensor(TransformBase):
method transform_image (line 179) | def transform_image(self, image):
method transfrom_mask (line 191) | def transfrom_mask(self, mask):
class ToTensorAndJitter (line 197) | class ToTensorAndJitter(TransformBase):
method __init__ (line 199) | def __init__(self, brightness_jitter=0.0, normalize=True):
method roll (line 204) | def roll(self):
method transform_image (line 207) | def transform_image(self, image, brightness_factor):
method transform_mask (line 217) | def transform_mask(self, mask, brightness_factor):
class Normalize (line 224) | class Normalize(TransformBase):
method __init__ (line 226) | def __init__(self, mean, std, inplace=False):
method transform_image (line 232) | def transform_image(self, image):
class ToGrayscale (line 236) | class ToGrayscale(TransformBase):
method __init__ (line 238) | def __init__(self, probability = 0.5):
method roll (line 243) | def roll(self):
method transform_image (line 246) | def transform_image(self, image, do_grayscale):
class ToBGR (line 256) | class ToBGR(TransformBase):
method transform_image (line 258) | def transform_image(self, image):
class RandomHorizontalFlip (line 265) | class RandomHorizontalFlip(TransformBase):
method __init__ (line 267) | def __init__(self, probability = 0.5):
method roll (line 271) | def roll(self):
method transform_image (line 274) | def transform_image(self, image, do_flip):
method transform_coords (line 281) | def transform_coords(self, coords, image_shape, do_flip):
method transform_mask (line 287) | def transform_mask(self, mask, do_flip):
class Blur (line 295) | class Blur(TransformBase):
method __init__ (line 297) | def __init__(self, sigma):
method transform_image (line 308) | def transform_image(self, image):
class RandomBlur (line 317) | class RandomBlur(TransformBase):
method __init__ (line 319) | def __init__(self, sigma, probability=0.1):
method roll (line 332) | def roll(self):
method transform (line 335) | def transform(self, image, do_blur=None):
class RandomAffine (line 350) | class RandomAffine(TransformBase):
method __init__ (line 352) | def __init__(self, p_flip=0.0, max_rotation=0.0, max_shear=0.0, max_sc...
method roll (line 370) | def roll(self):
method _construct_t_mat (line 382) | def _construct_t_mat(self, image_shape, do_flip, theta, shear_values, ...
method transform_image (line 411) | def transform_image(self, image, do_flip, theta, shear_values, scale_f...
method transform_coords (line 422) | def transform_coords(self, coords, image_shape, do_flip, theta, shear_...
method transform_mask (line 433) | def transform_mask(self, mask, do_flip, theta, shear_values, scale_fac...
FILE: artrackv2_mindspore/external/AR/ltr/dataset/base_image_dataset.py
class BaseImageDataset (line 5) | class BaseImageDataset(torch.utils.data.Dataset):
method __init__ (line 8) | def __init__(self, name, root, image_loader=jpeg4py_loader):
method __len__ (line 22) | def __len__(self):
method __getitem__ (line 29) | def __getitem__(self, index):
method get_name (line 34) | def get_name(self):
method get_num_images (line 42) | def get_num_images(self):
method has_class_info (line 49) | def has_class_info(self):
method get_class_name (line 52) | def get_class_name(self, image_id):
method get_num_classes (line 55) | def get_num_classes(self):
method get_class_list (line 58) | def get_class_list(self):
method get_images_in_class (line 61) | def get_images_in_class(self, class_name):
method has_segmentation_info (line 64) | def has_segmentation_info(self):
method get_image_info (line 67) | def get_image_info(self, seq_id):
method get_image (line 78) | def get_image(self, image_id, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/base_video_dataset.py
class BaseVideoDataset (line 5) | class BaseVideoDataset(torch.utils.data.Dataset):
method __init__ (line 8) | def __init__(self, name, root, image_loader=jpeg4py_loader):
method __len__ (line 22) | def __len__(self):
method __getitem__ (line 29) | def __getitem__(self, index):
method is_video_sequence (line 34) | def is_video_sequence(self):
method is_synthetic_video_dataset (line 42) | def is_synthetic_video_dataset(self):
method get_name (line 50) | def get_name(self):
method get_num_sequences (line 58) | def get_num_sequences(self):
method has_class_info (line 65) | def has_class_info(self):
method has_occlusion_info (line 68) | def has_occlusion_info(self):
method get_num_classes (line 71) | def get_num_classes(self):
method get_class_list (line 74) | def get_class_list(self):
method get_sequences_in_class (line 77) | def get_sequences_in_class(self, class_name):
method has_segmentation_info (line 80) | def has_segmentation_info(self):
method get_sequence_info (line 83) | def get_sequence_info(self, seq_id):
method get_frames (line 94) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/coco.py
class MSCOCO (line 11) | class MSCOCO(BaseImageDataset):
method __init__ (line 34) | def __init__(self, root=None, image_loader=jpeg4py_loader, data_fracti...
method _get_image_list (line 65) | def _get_image_list(self, min_area=None):
method get_num_classes (line 74) | def get_num_classes(self):
method get_name (line 77) | def get_name(self):
method has_class_info (line 80) | def has_class_info(self):
method has_segmentation_info (line 83) | def has_segmentation_info(self):
method get_class_list (line 86) | def get_class_list(self):
method _build_im_per_class (line 92) | def _build_im_per_class(self):
method get_images_in_class (line 103) | def get_images_in_class(self, class_name):
method get_image_info (line 106) | def get_image_info(self, im_id):
method _get_anno (line 118) | def _get_anno(self, im_id):
method _get_image (line 123) | def _get_image(self, im_id):
method get_meta_info (line 128) | def get_meta_info(self, im_id):
method get_class_name (line 144) | def get_class_name(self, im_id):
method get_image (line 148) | def get_image(self, image_id, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/coco_seq.py
class MSCOCOSeq (line 11) | class MSCOCOSeq(BaseVideoDataset):
method __init__ (line 34) | def __init__(self, root=None, image_loader=jpeg4py_loader, data_fracti...
method _get_sequence_list (line 65) | def _get_sequence_list(self):
method is_video_sequence (line 71) | def is_video_sequence(self):
method get_num_classes (line 74) | def get_num_classes(self):
method get_name (line 77) | def get_name(self):
method has_class_info (line 80) | def has_class_info(self):
method get_class_list (line 83) | def get_class_list(self):
method has_segmentation_info (line 89) | def has_segmentation_info(self):
method get_num_sequences (line 92) | def get_num_sequences(self):
method _build_seq_per_class (line 95) | def _build_seq_per_class(self):
method get_sequences_in_class (line 106) | def get_sequences_in_class(self, class_name):
method get_sequence_info (line 109) | def get_sequence_info(self, seq_id):
method _get_anno (line 121) | def _get_anno(self, seq_id):
method _get_frames (line 126) | def _get_frames(self, seq_id):
method get_meta_info (line 131) | def get_meta_info(self, seq_id):
method get_class_name (line 148) | def get_class_name(self, seq_id):
method get_frames (line 152) | def get_frames(self, seq_id=None, frame_ids=None, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/davis.py
class Davis (line 8) | class Davis(VOSDatasetBase):
method __init__ (line 19) | def __init__(self, root=None, sequences=None, version='2017', split='t...
method _construct_sequence (line 76) | def _construct_sequence(self, sequence_info):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/ecssd.py
class ECSSD (line 10) | class ECSSD(BaseImageDataset):
method __init__ (line 22) | def __init__(self, root=None, image_loader=jpeg4py_loader, data_fracti...
method _load_dataset (line 39) | def _load_dataset(self, min_area=None):
method get_name (line 50) | def get_name(self):
method has_segmentation_info (line 53) | def has_segmentation_info(self):
method get_image_info (line 56) | def get_image_info(self, im_id):
method get_meta_info (line 67) | def get_meta_info(self, im_id):
method get_image (line 76) | def get_image(self, image_id, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/got10k.py
class Got10k (line 14) | class Got10k(BaseVideoDataset):
method __init__ (line 26) | def __init__(self, root=None, image_loader=jpeg4py_loader, split=None,...
method get_name (line 75) | def get_name(self):
method has_class_info (line 78) | def has_class_info(self):
method has_occlusion_info (line 81) | def has_occlusion_info(self):
method _load_meta_info (line 84) | def _load_meta_info(self):
method _read_meta (line 88) | def _read_meta(self, seq_path):
method _build_seq_per_class (line 105) | def _build_seq_per_class(self):
method get_sequences_in_class (line 117) | def get_sequences_in_class(self, class_name):
method _get_sequence_list (line 120) | def _get_sequence_list(self):
method _read_bb_anno (line 126) | def _read_bb_anno(self, seq_path):
method _read_target_visible (line 131) | def _read_target_visible(self, seq_path):
method _get_sequence_path (line 146) | def _get_sequence_path(self, seq_id):
method get_sequence_info (line 149) | def get_sequence_info(self, seq_id):
method _get_frame_path (line 159) | def _get_frame_path(self, seq_path, frame_id):
method _get_frame (line 162) | def _get_frame(self, seq_path, frame_id):
method get_class_name (line 165) | def get_class_name(self, seq_id):
method get_frames (line 170) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/hku_is.py
class HKUIS (line 10) | class HKUIS(BaseImageDataset):
method __init__ (line 23) | def __init__(self, root=None, image_loader=jpeg4py_loader, data_fracti...
method _load_dataset (line 40) | def _load_dataset(self, min_area=None):
method get_name (line 57) | def get_name(self):
method has_segmentation_info (line 60) | def has_segmentation_info(self):
method get_image_info (line 63) | def get_image_info(self, im_id):
method get_meta_info (line 73) | def get_meta_info(self, im_id):
method get_image (line 82) | def get_image(self, image_id, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/imagenetvid.py
function get_target_to_image_ratio (line 12) | def get_target_to_image_ratio(seq):
class ImagenetVID (line 18) | class ImagenetVID(BaseVideoDataset):
method __init__ (line 30) | def __init__(self, root=None, image_loader=default_image_loader, min_l...
method get_name (line 62) | def get_name(self):
method get_num_sequences (line 65) | def get_num_sequences(self):
method get_sequence_info (line 68) | def get_sequence_info(self, seq_id):
method _get_frame (line 74) | def _get_frame(self, sequence, frame_id):
method get_frames (line 83) | def get_frames(self, seq_id, frame_ids, anno=None):
method _process_anno (line 105) | def _process_anno(self, root):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/lasot.py
class Lasot (line 14) | class Lasot(BaseVideoDataset):
method __init__ (line 26) | def __init__(self, root=None, image_loader=jpeg4py_loader, vid_ids=Non...
method _build_sequence_list (line 52) | def _build_sequence_list(self, vid_ids=None, split=None):
method _build_class_list (line 69) | def _build_class_list(self):
method get_name (line 80) | def get_name(self):
method has_class_info (line 83) | def has_class_info(self):
method has_occlusion_info (line 86) | def has_occlusion_info(self):
method get_num_sequences (line 89) | def get_num_sequences(self):
method get_num_classes (line 92) | def get_num_classes(self):
method get_sequences_in_class (line 95) | def get_sequences_in_class(self, class_name):
method _read_bb_anno (line 98) | def _read_bb_anno(self, seq_path):
method _read_target_visible (line 103) | def _read_target_visible(self, seq_path):
method _get_sequence_path (line 117) | def _get_sequence_path(self, seq_id):
method get_sequence_info (line 124) | def get_sequence_info(self, seq_id):
method _get_frame_path (line 133) | def _get_frame_path(self, seq_path, frame_id):
method _get_frame (line 136) | def _get_frame(self, seq_path, frame_id):
method _get_class (line 139) | def _get_class(self, seq_path):
method get_class_name (line 143) | def get_class_name(self, seq_id):
method get_frames (line 149) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/lvis.py
class LVIS (line 11) | class LVIS(BaseImageDataset):
method __init__ (line 33) | def __init__(self, root=None, image_loader=jpeg4py_loader_w_failsafe, ...
method _get_image_list (line 62) | def _get_image_list(self, min_area=None):
method get_num_classes (line 70) | def get_num_classes(self):
method get_name (line 73) | def get_name(self):
method has_class_info (line 76) | def has_class_info(self):
method get_class_list (line 79) | def get_class_list(self):
method has_segmentation_info (line 85) | def has_segmentation_info(self):
method _build_im_per_class (line 88) | def _build_im_per_class(self):
method get_images_in_class (line 99) | def get_images_in_class(self, class_name):
method get_image_info (line 102) | def get_image_info(self, im_id):
method _get_anno (line 114) | def _get_anno(self, im_id):
method _get_image (line 119) | def _get_image(self, im_id):
method get_meta_info (line 124) | def get_meta_info(self, im_id):
method get_class_name (line 140) | def get_class_name(self, im_id):
method get_image (line 144) | def get_image(self, image_id, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/msra10k.py
class MSRA10k (line 10) | class MSRA10k(BaseImageDataset):
method __init__ (line 23) | def __init__(self, root=None, image_loader=jpeg4py_loader, data_fracti...
method _load_dataset (line 40) | def _load_dataset(self, min_area=None):
method get_name (line 54) | def get_name(self):
method has_segmentation_info (line 57) | def has_segmentation_info(self):
method get_image_info (line 60) | def get_image_info(self, im_id):
method get_meta_info (line 70) | def get_meta_info(self, im_id):
method get_image (line 79) | def get_image(self, image_id, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/sbd.py
class SBD (line 12) | class SBD(BaseImageDataset):
method __init__ (line 24) | def __init__(self, root=None, image_loader=jpeg4py_loader_w_failsafe, ...
method _load_dataset (line 49) | def _load_dataset(self, split):
method _get_mask_from_mat (line 62) | def _get_mask_from_mat(self, mat):
method _construct_image_list (line 65) | def _construct_image_list(self, anno_list):
method get_name (line 75) | def get_name(self):
method has_segmentation_info (line 78) | def has_segmentation_info(self):
method get_image_info (line 81) | def get_image_info(self, im_id):
method _get_image (line 93) | def _get_image(self, im_id):
method get_meta_info (line 99) | def get_meta_info(self, im_id):
method get_image (line 107) | def get_image(self, image_id, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/synthetic_video.py
class SyntheticVideo (line 6) | class SyntheticVideo(BaseVideoDataset):
method __init__ (line 10) | def __init__(self, base_image_dataset, transform=None):
method get_name (line 21) | def get_name(self):
method is_video_sequence (line 24) | def is_video_sequence(self):
method has_class_info (line 27) | def has_class_info(self):
method has_occlusion_info (line 30) | def has_occlusion_info(self):
method get_num_sequences (line 33) | def get_num_sequences(self):
method get_num_classes (line 36) | def get_num_classes(self):
method get_sequences_in_class (line 39) | def get_sequences_in_class(self, class_name):
method get_sequence_info (line 42) | def get_sequence_info(self, seq_id):
method get_class_name (line 48) | def get_class_name(self, seq_id):
method get_frames (line 51) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/synthetic_video_blend.py
class SyntheticVideoBlend (line 8) | class SyntheticVideoBlend(BaseVideoDataset):
method __init__ (line 13) | def __init__(self, foreground_image_dataset, background_image_dataset,...
method get_name (line 33) | def get_name(self):
method is_video_sequence (line 36) | def is_video_sequence(self):
method has_class_info (line 39) | def has_class_info(self):
method has_occlusion_info (line 42) | def has_occlusion_info(self):
method get_num_sequences (line 45) | def get_num_sequences(self):
method get_num_classes (line 48) | def get_num_classes(self):
method get_sequences_in_class (line 51) | def get_sequences_in_class(self, class_name):
method get_sequence_info (line 54) | def get_sequence_info(self, seq_id):
method get_class_name (line 60) | def get_class_name(self, seq_id):
method _paste_target (line 63) | def _paste_target(self, fg_image, fg_box, fg_mask, bg_image, paste_loc):
method get_frames (line 100) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/tracking_net.py
function list_sequences (line 14) | def list_sequences(root, set_ids):
class TrackingNet (line 35) | class TrackingNet(BaseVideoDataset):
method __init__ (line 46) | def __init__(self, root=None, image_loader=jpeg4py_loader, set_ids=Non...
method _load_class_info (line 77) | def _load_class_info(self):
method get_name (line 94) | def get_name(self):
method has_class_info (line 97) | def has_class_info(self):
method get_sequences_in_class (line 100) | def get_sequences_in_class(self, class_name):
method _read_bb_anno (line 103) | def _read_bb_anno(self, seq_id):
method get_sequence_info (line 111) | def get_sequence_info(self, seq_id):
method _get_frame (line 118) | def _get_frame(self, seq_id, frame_id):
method _get_class (line 124) | def _get_class(self, seq_id):
method get_class_name (line 128) | def get_class_name(self, seq_id):
method get_frames (line 133) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/vos_base.py
class VOSMeta (line 13) | class VOSMeta:
method __init__ (line 14) | def __init__(self, data=None, filename=None):
method save (line 22) | def save(self, gen_meta: Path):
method load (line 26) | def load(self, gen_meta: Path):
method generate (line 34) | def generate(cls, dset_name: str, dset_images_path: Path, dset_annos_p...
method _mask_to_bbox (line 108) | def _mask_to_bbox(mask: np.ndarray):
method _transpose_nested_dict (line 122) | def _transpose_nested_dict(d):
method select_split (line 130) | def select_split(self, dataset_name, split):
method get_sequence_names (line 138) | def get_sequence_names(self):
method get_shape (line 141) | def get_shape(self, seq_name):
method get_obj_ids (line 146) | def get_obj_ids(self, seq_name):
method get_frame_names (line 150) | def get_frame_names(self, seq_name):
method enable_all_frames (line 154) | def enable_all_frames(self, dset_images_path):
method get_aspect_ratio (line 179) | def get_aspect_ratio(self, seq_name):
method get_obj_sizes_per_frame (line 184) | def get_obj_sizes_per_frame(self, seq_name):
method get_bboxes_per_frame (line 188) | def get_bboxes_per_frame(self, seq_name):
method get_obj_sizes_per_object (line 192) | def get_obj_sizes_per_object(self, seq_name):
method get_bboxes_per_object (line 196) | def get_bboxes_per_object(self, seq_name):
method generate_datasets_meta (line 201) | def generate_datasets_meta(src, dst=Path("~/vosdataset_meta").expandus...
class VOSDatasetBase (line 205) | class VOSDatasetBase(BaseVideoDataset):
method __init__ (line 209) | def __init__(self, name: str, root: Path, version=None, split='train',
method _load_image (line 234) | def _load_image(self, path):
method _load_anno (line 241) | def _load_anno(path):
method get_num_sequences (line 248) | def get_num_sequences(self):
method get_sequence_info (line 251) | def get_sequence_info(self, sample_id):
method get_paths_and_bboxes (line 286) | def get_paths_and_bboxes(self, sequence_info):
method _construct_sequence (line 308) | def _construct_sequence(self, sequence_info):
method get_sequence_list (line 311) | def get_sequence_list(self):
method __len__ (line 317) | def __len__(self):
method _get_image_path (line 320) | def _get_image_path(self, meta, frame_id):
method _get_anno_path (line 323) | def _get_anno_path(self, meta, frame_id):
method get_frames (line 326) | def get_frames(self, sample_id, frame_ids, anno=None):
method get_name (line 379) | def get_name(self):
method has_class_info (line 382) | def has_class_info(self):
method has_occlusion_info (line 385) | def has_occlusion_info(self):
method get_num_classes (line 388) | def get_num_classes(self):
method get_class_list (line 391) | def get_class_list(self):
method get_sequences_in_class (line 394) | def get_sequences_in_class(self, class_name):
method has_segmentation_info (line 397) | def has_segmentation_info(self):
FILE: artrackv2_mindspore/external/AR/ltr/dataset/youtubevos.py
class YouTubeVOSMeta (line 10) | class YouTubeVOSMeta:
method __init__ (line 32) | def __init__(self, dset_split_path):
method sequences (line 35) | def sequences(self):
method seq_frames (line 38) | def seq_frames(self, seq_name):
method object_ids (line 46) | def object_ids(self, seq_name):
method object_category (line 50) | def object_category(self, seq_name, obj_id):
method object_frames (line 53) | def object_frames(self, seq_name, obj_id):
method object_first_frame (line 56) | def object_first_frame(self, seq_name, obj_id):
class YouTubeVOS (line 60) | class YouTubeVOS(VOSDatasetBase):
method __init__ (line 72) | def __init__(self, root=None, version='2019', split='train', cleanup=N...
method _construct_sequence (line 168) | def _construct_sequence(self, sequence_info):
FILE: artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/functional.py
function _import_prroi_pooling (line 21) | def _import_prroi_pooling():
class PrRoIPool2DFunction (line 41) | class PrRoIPool2DFunction(ag.Function):
method forward (line 43) | def forward(ctx, features, rois, pooled_height, pooled_width, spatial_...
method backward (line 68) | def backward(ctx, grad_output):
FILE: artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/prroi_pool.py
class PrRoIPool2D (line 19) | class PrRoIPool2D(nn.Module):
method __init__ (line 20) | def __init__(self, pooled_height, pooled_width, spatial_scale):
method forward (line 27) | def forward(self, features, rois):
method extra_repr (line 30) | def extra_repr(self):
FILE: artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c
function output (line 28) | auto output = at::zeros({nr_rois, nr_channels, pooled_height, pooled_wid...
FILE: artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/pytorch/tests/test_prroi_pooling2d.py
class TestPrRoIPool2D (line 20) | class TestPrRoIPool2D(TorchTestCase):
method test_forward (line 21) | def test_forward(self):
method test_backward_shapeonly (line 37) | def test_backward_shapeonly(self):
FILE: artrackv2_mindspore/external/AR/ltr/models/AR_seg_mask/AR_seg_mask.py
class ARnet_seg_mask (line 14) | class ARnet_seg_mask(nn.Module):
method __init__ (line 16) | def __init__(self, feature_extractor, neck_module, head_module, used_l...
method forward (line 38) | def forward(self, train_imgs, test_imgs, train_bb, mode='train'):
method forward_ref (line 47) | def forward_ref(self, train_imgs, train_bb):
method forward_test (line 63) | def forward_test(self, test_imgs, mode='train'):
method extract_backbone_features (line 84) | def extract_backbone_features(self, im, layers=None):
method extract_features (line 89) | def extract_features(self, im, layers):
function ARnet_seg_mask_resnet50 (line 95) | def ARnet_seg_mask_resnet50(backbone_pretrained=True,used_layers=('layer...
FILE: artrackv2_mindspore/external/AR/ltr/models/backbone/base.py
class Backbone (line 5) | class Backbone(nn.Module):
method __init__ (line 10) | def __init__(self, frozen_layers=()):
method train (line 23) | def train(self, mode=True):
method _set_frozen_to_eval (line 32) | def _set_frozen_to_eval(self):
method _set_frozen_to_nograd (line 40) | def _set_frozen_to_nograd(self):
FILE: artrackv2_mindspore/external/AR/ltr/models/backbone/resnet.py
function conv3x3 (line 9) | def conv3x3(in_planes, out_planes, stride=1, dilation=1):
class BasicBlock (line 15) | class BasicBlock(nn.Module):
method __init__ (line 18) | def __init__(self, inplanes, planes, stride=1, downsample=None, dilati...
method forward (line 33) | def forward(self, x):
class Bottleneck (line 56) | class Bottleneck(nn.Module):
method __init__ (line 59) | def __init__(self, inplanes, planes, stride=1, downsample=None, dilati...
method forward (line 72) | def forward(self, x):
class ResNet (line 95) | class ResNet(Backbone):
method __init__ (line 97) | def __init__(self, block, layers, output_layers, num_classes=1000, inp...
method out_feature_strides (line 141) | def out_feature_strides(self, layer=None):
method out_feature_channels (line 147) | def out_feature_channels(self, layer=None):
method _make_layer (line 153) | def _make_layer(self, block, planes, blocks, stride=1, dilation=1):
method _add_output_and_check (line 170) | def _add_output_and_check(self, name, x, outputs, output_layers):
method forward (line 175) | def forward(self, x, output_layers=None):
function resnet_baby (line 224) | def resnet_baby(output_layers=None, pretrained=False, inplanes=16, **kwa...
function resnet18 (line 242) | def resnet18(output_layers=None, pretrained=False, **kwargs):
function resnet50 (line 260) | def resnet50(output_layers=None, pretrained=False, **kwargs):
FILE: artrackv2_mindspore/external/AR/ltr/models/backbone/resnet18_vggm.py
class SpatialCrossMapLRN (line 9) | class SpatialCrossMapLRN(nn.Module):
method __init__ (line 10) | def __init__(self, local_size=1, alpha=1.0, beta=0.75, k=1, ACROSS_CHA...
method forward (line 25) | def forward(self, x):
class ResNetVGGm1 (line 38) | class ResNetVGGm1(Backbone):
method __init__ (line 40) | def __init__(self, block, layers, output_layers, num_classes=1000, fro...
method _make_layer (line 67) | def _make_layer(self, block, planes, blocks, stride=1):
method _add_output_and_check (line 85) | def _add_output_and_check(self, name, x, outputs, output_layers):
method forward (line 91) | def forward(self, x, output_layers=None):
function resnet18_vggmconv1 (line 144) | def resnet18_vggmconv1(output_layers=None, path=None, **kwargs):
FILE: artrackv2_mindspore/external/AR/ltr/models/backbone/resnet_seg.py
function conv3x3 (line 10) | def conv3x3(in_planes, out_planes, stride=1, dilation=1):
class BasicBlock (line 16) | class BasicBlock(nn.Module):
method __init__ (line 19) | def __init__(self, inplanes, planes, stride=1, downsample=None, dilati...
method forward (line 29) | def forward(self, x):
class Bottleneck (line 48) | class Bottleneck(nn.Module):
method __init__ (line 51) | def __init__(self, inplanes, planes, stride=1, downsample=None, dilati...
method forward (line 64) | def forward(self, x):
class ResNet (line 87) | class ResNet(nn.Module):
method __init__ (line 89) | def __init__(self, block, layers, output_layers, num_classes=1000, inp...
method _make_layer (line 121) | def _make_layer(self, block, planes, blocks, stride=1, dilation=1):
method _add_output_and_check (line 138) | def _add_output_and_check(self, name, x, outputs, output_layers):
method forward (line 143) | def forward(self, x, output_layers=None):
method get_out_channels (line 190) | def get_out_channels(self):
function resnet18 (line 194) | def resnet18(output_layers=None, pretrained=False, dilation_factor=1):
function resnet50 (line 212) | def resnet50(output_layers=None, pretrained=False, dilation_factor=1):
function resnet101 (line 229) | def resnet101(output_layers=None, pretrained=False, dilation_factor=1):
FILE: artrackv2_mindspore/external/AR/ltr/models/bbreg/atom.py
class ATOMnet (line 7) | class ATOMnet(nn.Module):
method __init__ (line 9) | def __init__(self, feature_extractor, bb_regressor, bb_regressor_layer...
method forward (line 28) | def forward(self, train_imgs, test_imgs, train_bb, test_proposals):
method extract_backbone_features (line 50) | def extract_backbone_features(self, im, layers=None):
method extract_features (line 55) | def extract_features(self, im, layers):
function atom_resnet18 (line 61) | def atom_resnet18(iou_input_dim=(256,256), iou_inter_dim=(256,256), back...
function atom_resnet50 (line 75) | def atom_resnet50(iou_input_dim=(256,256), iou_inter_dim=(256,256), back...
FILE: artrackv2_mindspore/external/AR/ltr/models/bbreg/atom_iou_net.py
function conv (line 7) | def conv(in_planes, out_planes, kernel_size=3, stride=1, padding=1, dila...
class AtomIoUNet (line 15) | class AtomIoUNet(nn.Module):
method __init__ (line 23) | def __init__(self, input_dim=(128,256), pred_input_dim=(256,256), pred...
method forward (line 66) | def forward(self, feat1, feat2, bb1, proposals2):
method predict_iou (line 96) | def predict_iou(self, modulation, feat, proposals):
method get_modulation (line 138) | def get_modulation(self, feat, bb):
method get_iou_feat (line 172) | def get_iou_feat(self, feat2):
FILE: artrackv2_mindspore/external/AR/ltr/models/head/seg_network.py
class TSE (line 7) | class TSE(nn.Module):
method __init__ (line 9) | def __init__(self, fc, ic, oc):
method forward (line 16) | def forward(self, ft, score, x=None):
class CAB (line 24) | class CAB(nn.Module):
method __init__ (line 26) | def __init__(self, oc, deepest):
method forward (line 32) | def forward(self, deeper, shallower, att_vec=None):
class RRB (line 47) | class RRB(nn.Module):
method __init__ (line 49) | def __init__(self, oc, use_bn=False):
method forward (line 57) | def forward(self, x):
class Upsampler (line 62) | class Upsampler(nn.Module):
method __init__ (line 64) | def __init__(self, in_channels=64):
method forward (line 70) | def forward(self, x, image_size):
class PyrUpBicubic2d (line 79) | class PyrUpBicubic2d(nn.Module):
method __init__ (line 81) | def __init__(self, channels):
method forward (line 108) | def forward(self, input):
class BackwardCompatibleUpsampler (line 133) | class BackwardCompatibleUpsampler(nn.Module):
method __init__ (line 136) | def __init__(self, in_channels=64):
method forward (line 144) | def forward(self, x, image_size):
class SegNetwork (line 153) | class SegNetwork(nn.Module):
method __init__ (line 155) | def __init__(self, in_channels=1, out_channels=32, ft_channels=None, u...
method forward (line 180) | def forward(self, scores, features, image_size):
FILE: artrackv2_mindspore/external/AR/ltr/models/head/utils.py
function text_bargraph (line 9) | def text_bargraph(values):
class ModuleWrapper (line 25) | class ModuleWrapper:
method __init__ (line 31) | def __init__(self, wrapped_module):
method __getattr__ (line 34) | def __getattr__(self, attr):
method __call__ (line 48) | def __call__(self, *args, **kwargs):
function conv (line 52) | def conv(ic, oc, ksize, bias=True, dilation=1, stride=1):
function relu (line 56) | def relu(negative_slope=0.0, inplace=False):
function interpolate (line 60) | def interpolate(t, sz):
function adaptive_cat (line 65) | def adaptive_cat(seq, dim=0, ref_tensor=0):
function get_out_channels (line 71) | def get_out_channels(layer):
function is_finite (line 89) | def is_finite(t):
class AverageMeter (line 93) | class AverageMeter:
method __init__ (line 96) | def __init__(self):
method reset (line 103) | def reset(self):
method update (line 106) | def update(self, val, n=1):
method update_multi (line 113) | def update_multi(self, val):
FILE: artrackv2_mindspore/external/AR/ltr/models/layers/activation.py
function softmax_reg (line 7) | def softmax_reg(x: torch.Tensor, dim, reg=None):
class MLU (line 20) | class MLU(nn.Module):
method __init__ (line 23) | def __init__(self, min_val, inplace=False):
method forward (line 28) | def forward(self, input):
class LeakyReluPar (line 32) | class LeakyReluPar(nn.Module):
method forward (line 36) | def forward(self, x, a):
class LeakyReluParDeriv (line 39) | class LeakyReluParDeriv(nn.Module):
method forward (line 43) | def forward(self, x, a):
class BentIdentPar (line 47) | class BentIdentPar(nn.Module):
method __init__ (line 50) | def __init__(self, b=1.0):
method forward (line 54) | def forward(self, x, a):
class BentIdentParDeriv (line 58) | class BentIdentParDeriv(nn.Module):
method __init__ (line 61) | def __init__(self, b=1.0):
method forward (line 65) | def forward(self, x, a):
FILE: artrackv2_mindspore/external/AR/ltr/models/layers/blocks.py
function conv_block (line 4) | def conv_block(in_planes, out_planes, kernel_size=3, stride=1, padding=1...
class LinearBlock (line 23) | class LinearBlock(nn.Module):
method __init__ (line 24) | def __init__(self, in_planes, out_planes, input_sz, bias=True, batch_n...
method forward (line 30) | def forward(self, x):
FILE: artrackv2_mindspore/external/AR/ltr/models/layers/distance.py
class DistanceMap (line 6) | class DistanceMap(nn.Module):
method __init__ (line 12) | def __init__(self, num_bins, bin_displacement=1.0):
method forward (line 17) | def forward(self, center, output_sz):
FILE: artrackv2_mindspore/external/AR/ltr/models/layers/filter.py
function apply_filter (line 5) | def apply_filter(feat, filter, dilation_factors=None):
function apply_feat_transpose (line 57) | def apply_feat_transpose(feat, input, filter_ksz, training=True, groups=1):
function _apply_feat_transpose_v1 (line 76) | def _apply_feat_transpose_v1(feat, input, filter_ksz):
function _apply_feat_transpose_v2 (line 95) | def _apply_feat_transpose_v2(feat, input, filter_ksz):
function _apply_feat_transpose_v3 (line 124) | def _apply_feat_transpose_v3(feat, input, filter_ksz):
function _apply_feat_transpose_v4 (line 151) | def _apply_feat_transpose_v4(feat, input, filter_ksz):
function filter_gradient (line 169) | def filter_gradient(feat, filter, label=None, training=True):
FILE: artrackv2_mindspore/external/AR/ltr/models/layers/normalization.py
class InstanceL2Norm (line 6) | class InstanceL2Norm(nn.Module):
method __init__ (line 9) | def __init__(self, size_average=True, eps=1e-5, scale=1.0):
method forward (line 15) | def forward(self, input):
FILE: artrackv2_mindspore/external/AR/ltr/models/layers/transform.py
function interpolate (line 7) | def interpolate(x, sz):
class InterpCat (line 13) | class InterpCat(nn.Module):
method forward (line 16) | def forward(self, input):
FILE: artrackv2_mindspore/external/AR/ltr/models/loss/kl_regression.py
class KLRegression (line 7) | class KLRegression(nn.Module):
method __init__ (line 11) | def __init__(self, eps=0.0):
method forward (line 15) | def forward(self, scores, sample_density, gt_density, mc_dim=-1):
class MLRegression (line 30) | class MLRegression(nn.Module):
method __init__ (line 34) | def __init__(self, eps=0.0):
method forward (line 38) | def forward(self, scores, sample_density, gt_density=None, mc_dim=-1):
class KLRegressionGrid (line 55) | class KLRegressionGrid(nn.Module):
method forward (line 59) | def forward(self, scores, gt_density, grid_dim=-1, grid_scale=1.0):
FILE: artrackv2_mindspore/external/AR/ltr/models/loss/target_classification.py
class LBHinge (line 6) | class LBHinge(nn.Module):
method __init__ (line 15) | def __init__(self, error_metric=nn.MSELoss(), threshold=None, clip=None):
method forward (line 21) | def forward(self, prediction, label, target_bb=None):
FILE: artrackv2_mindspore/external/AR/ltr/models/meta/steepestdescent.py
class GNSteepestDescent (line 8) | class GNSteepestDescent(nn.Module):
method __init__ (line 10) | def __init__(self, residual_module, num_iter=1, compute_losses=False, ...
method _sqr_norm (line 24) | def _sqr_norm(self, x: TensorList, batch_dim=0):
method _compute_loss (line 29) | def _compute_loss(self, res):
method forward (line 33) | def forward(self, meta_parameter: TensorList, num_iter=None, *args, **...
FILE: artrackv2_mindspore/external/AR/ltr/models/neck/CorrNL.py
class CorrNL (line 7) | class CorrNL(nn.Module):
method __init__ (line 15) | def __init__(self, pool_size=8, use_NL=True):
method forward (line 22) | def forward(self, feat1, feat2, bb1):
method get_ref_kernel (line 58) | def get_ref_kernel(self, feat1, bb1):
method fuse_feat (line 80) | def fuse_feat(self, feat2):
method corr_fun (line 98) | def corr_fun(self, Kernel_tmp, Feature, KERs=None):
FILE: artrackv2_mindspore/external/AR/ltr/models/neck/neck_utils.py
function conv (line 5) | def conv(in_planes, out_planes, kernel_size=3, stride=1, padding=1, dila...
class SEModule (line 13) | class SEModule(nn.Module):
method __init__ (line 15) | def __init__(self, channels, reduction=4):
method forward (line 25) | def forward(self, x):
class _NonLocalBlockND (line 34) | class _NonLocalBlockND(nn.Module):
method __init__ (line 35) | def __init__(self, in_channels, inter_channels=None, dimension=3, sub_...
method forward (line 97) | def forward(self, x, return_nl_map=False):
class NONLocalBlock2D (line 125) | class NONLocalBlock2D(_NonLocalBlockND):
method __init__ (line 126) | def __init__(self, in_channels, inter_channels=None, sub_sample=True, ...
FILE: artrackv2_mindspore/external/AR/ltr/models/target_classifier/features.py
function residual_basic_block (line 9) | def residual_basic_block(feature_dim=256, num_blocks=1, l2norm=True, fin...
function residual_basic_block_pool (line 31) | def residual_basic_block_pool(feature_dim=256, num_blocks=1, l2norm=True...
function residual_bottleneck (line 50) | def residual_bottleneck(feature_dim=256, num_blocks=1, l2norm=True, fina...
FILE: artrackv2_mindspore/external/AR/ltr/models/target_classifier/initializer.py
class FilterPool (line 9) | class FilterPool(nn.Module):
method __init__ (line 16) | def __init__(self, filter_size=1, feature_stride=16, pool_square=False):
method forward (line 21) | def forward(self, feat, bb):
class FilterInitializer (line 49) | class FilterInitializer(nn.Module):
method __init__ (line 60) | def __init__(self, filter_size=1, feature_dim=256, feature_stride=16, ...
method forward (line 92) | def forward(self, feat, bb):
class FilterInitializerLinear (line 118) | class FilterInitializerLinear(nn.Module):
method __init__ (line 128) | def __init__(self, filter_size=1, feature_dim=256, feature_stride=16, ...
method forward (line 151) | def forward(self, feat, bb):
class FilterInitializerZero (line 177) | class FilterInitializerZero(nn.Module):
method __init__ (line 183) | def __init__(self, filter_size=1, feature_dim=256):
method forward (line 188) | def forward(self, feat, bb):
class FilterInitializerSiamese (line 202) | class FilterInitializerSiamese(nn.Module):
method __init__ (line 210) | def __init__(self, filter_size=1, feature_stride=16, pool_square=False...
method forward (line 228) | def forward(self, feat, bb):
FILE: artrackv2_mindspore/external/AR/ltr/models/target_classifier/linear_filter.py
class LinearFilter (line 6) | class LinearFilter(nn.Module):
method __init__ (line 14) | def __init__(self, filter_size, filter_initializer, filter_optimizer=N...
method forward (line 35) | def forward(self, train_feat, test_feat, train_bb, *args, **kwargs):
method extract_classification_feat (line 68) | def extract_classification_feat(self, feat, num_sequences=None):
method classify (line 78) | def classify(self, weights, feat):
method get_filter (line 85) | def get_filter(self, feat, bb, *args, **kwargs):
method train_classifier (line 107) | def train_classifier(self, backbone_feat, bb):
method track_frame (line 120) | def track_frame(self, filter_weights, backbone_feat):
FILE: artrackv2_mindspore/external/AR/ltr/models/target_classifier/optimizer.py
class DiMPSteepestDescentGN (line 11) | class DiMPSteepestDescentGN(nn.Module):
method __init__ (line 31) | def __init__(self, num_iter=1, feat_stride=16, init_step_length=1.0,
method forward (line 85) | def forward(self, weights, feat, bb, sample_weight=None, num_iter=None...
class DiMPL2SteepestDescentGN (line 174) | class DiMPL2SteepestDescentGN(nn.Module):
method __init__ (line 187) | def __init__(self, num_iter=1, feat_stride=16, init_step_length=1.0, g...
method get_label (line 201) | def get_label(self, center, output_sz):
method forward (line 211) | def forward(self, weights, feat, bb, sample_weight=None, num_iter=None...
class PrDiMPSteepestDescentNewton (line 294) | class PrDiMPSteepestDescentNewton(nn.Module):
method __init__ (line 312) | def __init__(self, num_iter=1, feat_stride=16, init_step_length=1.0,
method get_label_density (line 331) | def get_label_density(self, center, output_sz):
method forward (line 355) | def forward(self, weights, feat, bb, sample_weight=None, num_iter=None...
FILE: artrackv2_mindspore/external/AR/ltr/models/target_classifier/residual_modules.py
class LinearFilterLearnGen (line 10) | class LinearFilterLearnGen(nn.Module):
method __init__ (line 11) | def __init__(self, feat_stride=16, init_filter_reg=1e-2, init_gauss_si...
method forward (line 52) | def forward(self, meta_parameter: TensorList, feat, bb, sample_weight=...
FILE: artrackv2_mindspore/external/AR/ltr/models/tracking/dimpnet.py
class DiMPnet (line 15) | class DiMPnet(nn.Module):
method __init__ (line 24) | def __init__(self, feature_extractor, classifier, bb_regressor, classi...
method forward (line 35) | def forward(self, train_imgs, test_imgs, train_bb, test_proposals, *ar...
method get_backbone_clf_feat (line 70) | def get_backbone_clf_feat(self, backbone_feat):
method get_backbone_bbreg_feat (line 76) | def get_backbone_bbreg_feat(self, backbone_feat):
method extract_classification_feat (line 79) | def extract_classification_feat(self, backbone_feat):
method extract_backbone_features (line 82) | def extract_backbone_features(self, im, layers=None):
method extract_features (line 87) | def extract_features(self, im, layers=None):
function dimpnet18 (line 100) | def dimpnet18(filter_size=1, optim_iter=5, optim_init_step=1.0, optim_in...
function dimpnet50 (line 146) | def dimpnet50(filter_size=1, optim_iter=5, optim_init_step=1.0, optim_in...
function L2dimpnet18 (line 202) | def L2dimpnet18(filter_size=1, optim_iter=5, optim_init_step=1.0, optim_...
function klcedimpnet18 (line 242) | def klcedimpnet18(filter_size=1, optim_iter=5, optim_init_step=1.0, opti...
function klcedimpnet50 (line 295) | def klcedimpnet50(filter_size=1, optim_iter=5, optim_init_step=1.0, opti...
FILE: artrackv2_mindspore/external/AR/ltr/run_training.py
function run_training (line 16) | def run_training(train_module, train_name, cudnn_benchmark=True):
function main (line 42) | def main():
FILE: artrackv2_mindspore/external/AR/ltr/train_settings/bbreg/atom.py
function run (line 11) | def run(settings):
FILE: artrackv2_mindspore/external/AR/ltr/train_settings/bbreg/atom_gmm_sampl.py
function run (line 11) | def run(settings):
FILE: artrackv2_mindspore/external/AR/ltr/train_settings/bbreg/atom_paper.py
function run (line 11) | def run(settings):
FILE: artrackv2_mindspore/external/AR/ltr/train_settings/bbreg/atom_prob_ml.py
function run (line 11) | def run(settings):
FILE: artrackv2_mindspore/external/AR/ltr/train_settings/dimp/dimp18.py
function run (line 13) | def run(settings):
FILE: artrackv2_mindspore/external/AR/ltr/train_settings/dimp/dimp50.py
function run (line 13) | def run(settings):
FILE: artrackv2_mindspore/external/AR/ltr/train_settings/dimp/prdimp18.py
function run (line 13) | def run(settings):
FILE: artrackv2_mindspore/external/AR/ltr/train_settings/dimp/prdimp50.py
function run (line 13) | def run(settings):
FILE: artrackv2_mindspore/external/AR/ltr/train_settings/dimp/super_dimp.py
function run (line 13) | def run(settings):
FILE: artrackv2_mindspore/external/AR/ltr/trainers/base_trainer.py
class BaseTrainer (line 8) | class BaseTrainer:
method __init__ (line 12) | def __init__(self, actor, loaders, optimizer, settings, lr_scheduler=N...
method update_settings (line 38) | def update_settings(self, settings=None):
method train (line 52) | def train(self, max_epochs, load_latest=False, fail_safe=True):
method train_epoch (line 91) | def train_epoch(self):
method save_checkpoint (line 95) | def save_checkpoint(self):
method load_checkpoint (line 129) | def load_checkpoint(self, checkpoint = None, fields = None, ignore_fie...
FILE: artrackv2_mindspore/external/AR/ltr/trainers/ltr_trainer.py
class LTRTrainer (line 10) | class LTRTrainer(BaseTrainer):
method __init__ (line 11) | def __init__(self, actor, loaders, optimizer, settings, lr_scheduler=N...
method _set_default_settings (line 34) | def _set_default_settings(self):
method cycle_dataset (line 44) | def cycle_dataset(self, loader):
method train_epoch (line 76) | def train_epoch(self):
method _init_timing (line 85) | def _init_timing(self):
method _update_stats (line 90) | def _update_stats(self, new_stats: OrderedDict, batch_size, loader):
method _print_stats (line 100) | def _print_stats(self, i, loader, batch_size):
method _stats_new_epoch (line 114) | def _stats_new_epoch(self):
method _write_tensorboard (line 132) | def _write_tensorboard(self):
FILE: artrackv2_mindspore/external/AR/pytracking/ARcm_seg.py
function mask_torch2numpy (line 14) | def mask_torch2numpy(Pmask):
class ARcm_seg (line 19) | class ARcm_seg(object):
method __init__ (line 20) | def __init__(self, refine_net_dir, search_factor=2.0, input_sz=256):
method initialize (line 27) | def initialize(self, frame1, bbox1):
method get_mask (line 45) | def get_mask(self, Cframe, Cbbox, dtm=None, vis=False):
method get_network (line 70) | def get_network(self,checkpoint_dir):
method img_preprocess (line 76) | def img_preprocess(self,img_arr):
method gt_preprocess (line 87) | def gt_preprocess(self,gt_arr):
function add_frame_mask (line 95) | def add_frame_mask(frame, mask, threshold=0.5):
function add_frame_bbox (line 103) | def add_frame_bbox(frame, refined_box, color):
FILE: artrackv2_mindspore/external/AR/pytracking/VOT/vot.py
class VOT (line 25) | class VOT(object):
method __init__ (line 27) | def __init__(self, region_format, channels=None):
method region (line 59) | def region(self):
method report (line 70) | def report(self, region, confidence = None):
method frame (line 87) | def frame(self):
method quit (line 110) | def quit(self):
method __del__ (line 114) | def __del__(self):
FILE: artrackv2_mindspore/external/AR/pytracking/VOT2020_super_only_mask_384_HP/dimp_alpha_seg_class.py
class DIMP_ALPHA (line 22) | class DIMP_ALPHA(object):
method __init__ (line 23) | def __init__(self, tracker_name='dimp', para_name='dimp50_vot19',
method initialize (line 41) | def initialize(self, img_RGB, mask):
method track (line 53) | def track(self, img_RGB):
function run_vot_exp (line 80) | def run_vot_exp(tracker_name, para_name, refine_model_name, threshold, V...
FILE: artrackv2_mindspore/external/AR/pytracking/VOT2020_super_only_mask_384_HP/mixformer_alpha_seg_class.py
class MIXFORMER_ALPHA_SEG (line 19) | class MIXFORMER_ALPHA_SEG(object):
method __init__ (line 20) | def __init__(self, tracker,
method initialize (line 32) | def initialize(self, image, mask):
method track (line 45) | def track(self, img_RGB):
function make_full_size (line 56) | def make_full_size(x, output_sz):
FILE: artrackv2_mindspore/external/AR/pytracking/VOT2020_super_only_mask_384_HP/mixformer_large_alpha_seg_class.py
class MIXFORMER_ALPHA_SEG (line 19) | class MIXFORMER_ALPHA_SEG(object):
method __init__ (line 20) | def __init__(self, tracker,
method initialize (line 32) | def initialize(self, image, mask):
method track (line 45) | def track(self, img_RGB):
function make_full_size (line 56) | def make_full_size(x, output_sz):
FILE: artrackv2_mindspore/external/AR/pytracking/VOT2020_super_only_mask_384_HP/vot.py
class VOT (line 22) | class VOT(object):
method __init__ (line 24) | def __init__(self, region_format, channels=None):
method region (line 58) | def region(self):
method report (line 68) | def report(self, region, confidence = None):
method frame (line 86) | def frame(self):
method quit (line 108) | def quit(self):
method __del__ (line 112) | def __del__(self):
FILE: artrackv2_mindspore/external/AR/pytracking/analysis/evaluate_vos.py
function evaluate_sequence (line 14) | def evaluate_sequence(seq_name, segmentations, annotations, object_info,...
function evaluate_dataset (line 47) | def evaluate_dataset(results_path, dset_name, measure='J', to_file=True,...
function evaluate_vos (line 140) | def evaluate_vos(trackers, dataset='yt2019_jjval', force=False):
FILE: artrackv2_mindspore/external/AR/pytracking/analysis/extract_results.py
function calc_err_center (line 17) | def calc_err_center(pred_bb, anno_bb, normalized=False):
function calc_iou_overlap (line 29) | def calc_iou_overlap(pred_bb, anno_bb):
function calc_seq_err_robust (line 41) | def calc_seq_err_robust(pred_bb, anno_bb, dataset, target_visible=None):
function extract_results (line 103) | def extract_results(trackers, dataset, report_name, skip_missing_seq=Fal...
FILE: artrackv2_mindspore/external/AR/pytracking/analysis/playback_results.py
class Display (line 19) | class Display:
method __init__ (line 20) | def __init__(self, sequence_length, plot_draw_styles, sequence_name):
method key_callback_fn (line 34) | def key_callback_fn(self, event):
method _get_speed (line 68) | def _get_speed(self):
method step (line 77) | def step(self):
method show (line 86) | def show(self, image, bb_list, trackers, gt=None):
function read_image (line 118) | def read_image(image_file: str):
function _get_display_name (line 123) | def _get_display_name(tracker):
function playback_results (line 133) | def playback_results(trackers, sequence):
FILE: artrackv2_mindspore/external/AR/pytracking/analysis/plot_results.py
function get_plot_draw_styles (line 12) | def get_plot_draw_styles():
function check_eval_data_is_valid (line 34) | def check_eval_data_is_valid(eval_data, trackers, dataset):
function merge_multiple_runs (line 45) | def merge_multiple_runs(eval_data):
function get_tracker_display_name (line 89) | def get_tracker_display_name(tracker):
function plot_draw_save (line 102) | def plot_draw_save(y, x, scores, trackers, plot_draw_styles, result_plot...
function check_and_load_precomputed_results (line 160) | def check_and_load_precomputed_results(trackers, dataset, report_name, f...
function get_auc_curve (line 187) | def get_auc_curve(ave_success_rate_plot_overlap, valid_sequence):
function get_prec_curve (line 195) | def get_prec_curve(ave_success_rate_plot_center, valid_sequence):
function plot_results (line 203) | def plot_results(trackers, dataset, report_name, merge_results=False,
function generate_formatted_report (line 280) | def generate_formatted_report(row_labels, scores, table_name=''):
function print_results (line 306) | def print_results(trackers, dataset, report_name, merge_results=False,
function plot_got_success (line 364) | def plot_got_success(trackers, report_name):
function print_per_sequence_results (line 425) | def print_per_sequence_results(trackers, dataset, report_name, merge_res...
FILE: artrackv2_mindspore/external/AR/pytracking/analysis/vos_utils.py
function text_bargraph (line 7) | def text_bargraph(values):
function davis_jaccard_measure (line 34) | def davis_jaccard_measure(fg_mask, gt_mask):
function davis_jaccard_measure_torch (line 52) | def davis_jaccard_measure_torch(fg_mask, gt_mask):
function davis_f_measure (line 70) | def davis_f_measure(foreground_mask, gt_mask, bound_th=0.008):
function seg2bmap (line 128) | def seg2bmap(seg, width=None, height=None):
function nanmean (line 189) | def nanmean(*args, **kwargs):
function mean (line 195) | def mean(X):
function recall (line 202) | def recall(X, threshold=0.5):
function decay (line 213) | def decay(X, n_bins=4):
function std (line 229) | def std(X):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/data.py
class BaseDataset (line 7) | class BaseDataset:
method __init__ (line 9) | def __init__(self):
method __len__ (line 12) | def __len__(self):
method get_sequence_list (line 16) | def get_sequence_list(self):
class Sequence (line 21) | class Sequence:
method __init__ (line 23) | def __init__(self, name, frames, dataset, ground_truth_rect, ground_tr...
method _ensure_start_frame (line 37) | def _ensure_start_frame(self):
method _construct_init_data (line 56) | def _construct_init_data(self, init_data):
method init_info (line 92) | def init_info(self):
method frame_info (line 96) | def frame_info(self, frame_num):
method init_bbox (line 100) | def init_bbox(self, frame_num=0):
method init_mask (line 103) | def init_mask(self, frame_num=0):
method get_info (line 106) | def get_info(self, keys, frame_num=None):
method object_init_data (line 114) | def object_init_data(self, frame_num=None) -> dict:
method target_class (line 139) | def target_class(self, frame_num=None):
method get (line 142) | def get(self, name, frame_num=None):
method __repr__ (line 145) | def __repr__(self):
class SequenceList (line 150) | class SequenceList(list):
method __getitem__ (line 152) | def __getitem__(self, item):
method __add__ (line 165) | def __add__(self, other):
method copy (line 168) | def copy(self):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/datasets.py
function load_dataset (line 44) | def load_dataset(name: str):
function get_dataset (line 56) | def get_dataset(*args):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/environment.py
class EnvSettings (line 5) | class EnvSettings:
method __init__ (line 6) | def __init__(self):
function create_default_local_file (line 29) | def create_default_local_file():
function env_settings (line 55) | def env_settings():
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/got10kdataset.py
class GOT10KDataset (line 7) | class GOT10KDataset(BaseDataset):
method __init__ (line 18) | def __init__(self, split):
method get_sequence_list (line 29) | def get_sequence_list(self):
method _construct_sequence (line 32) | def _construct_sequence(self, sequence_name):
method __len__ (line 44) | def __len__(self):
method _get_sequence_list (line 47) | def _get_sequence_list(self, split):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/lasotdataset.py
class LaSOTDataset (line 6) | class LaSOTDataset(BaseDataset):
method __init__ (line 18) | def __init__(self):
method clean_seq_list (line 24) | def clean_seq_list(self):
method get_sequence_list (line 31) | def get_sequence_list(self):
method _construct_sequence (line 34) | def _construct_sequence(self, sequence_name):
method __len__ (line 58) | def __len__(self):
method _get_sequence_list (line 61) | def _get_sequence_list(self):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/mobifacedataset.py
class MobifaceDataset (line 9) | class MobifaceDataset(BaseDataset):
method __init__ (line 19) | def __init__(self, split):
method get_sequence_list (line 29) | def get_sequence_list(self):
method _get_sequence_list (line 32) | def _get_sequence_list(self, split):
method _construct_sequence (line 55) | def _construct_sequence(self, sequence_name):
method __len__ (line 67) | def __len__(self):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/multi_object_wrapper.py
class MultiObjectWrapper (line 7) | class MultiObjectWrapper:
method __init__ (line 8) | def __init__(self, base_tracker_class, params, visdom=None, fast_load=...
method create_tracker (line 22) | def create_tracker(self):
method _split_info (line 34) | def _split_info(self, info):
method _set_defaults (line 52) | def _set_defaults(self, tracker_out: dict, defaults=None):
method default_merge (line 61) | def default_merge(self, out_all):
method merge_outputs (line 90) | def merge_outputs(self, out_all):
method initialize (line 98) | def initialize(self, image, info: dict) -> dict:
method track (line 131) | def track(self, image, info: dict = None) -> dict:
method visdom_draw_tracking (line 179) | def visdom_draw_tracking(self, image, box, segmentation):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/nfsdataset.py
class NFSDataset (line 6) | class NFSDataset(BaseDataset):
method __init__ (line 17) | def __init__(self):
method get_sequence_list (line 22) | def get_sequence_list(self):
method _construct_sequence (line 25) | def _construct_sequence(self, sequence_info):
method __len__ (line 46) | def __len__(self):
method _get_sequence_info_list (line 49) | def _get_sequence_info_list(self):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/otbdataset.py
class OTBDataset (line 6) | class OTBDataset(BaseDataset):
method __init__ (line 17) | def __init__(self):
method get_sequence_list (line 22) | def get_sequence_list(self):
method _construct_sequence (line 25) | def _construct_sequence(self, sequence_info):
method __len__ (line 47) | def __len__(self):
method _get_sequence_info_list (line 50) | def _get_sequence_info_list(self):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/running.py
function _save_tracker_output (line 11) | def _save_tracker_output(seq: Sequence, tracker: Tracker, output: dict):
function run_sequence (line 76) | def run_sequence(seq: Sequence, tracker: Tracker, debug=False, visdom_in...
function run_dataset (line 119) | def run_dataset(dataset, trackers, debug=False, threads=0, visdom_info=N...
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/tpldataset.py
class TPLDataset (line 6) | class TPLDataset(BaseDataset):
method __init__ (line 18) | def __init__(self, exclude_otb=False):
method get_sequence_list (line 27) | def get_sequence_list(self):
method _construct_sequence (line 30) | def _construct_sequence(self, sequence_info):
method __len__ (line 50) | def __len__(self):
method _get_sequence_info_list (line 53) | def _get_sequence_info_list(self, exclude_otb=False):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/tracker.py
function trackerlist (line 23) | def trackerlist(name: str, parameter_name: str, run_ids = None, display_...
class Tracker (line 36) | class Tracker:
method __init__ (line 45) | def __init__(self, name: str, parameter_name: str, run_id: int = None,...
method _init_visdom (line 71) | def _init_visdom(self, visdom_info, debug):
method _visdom_ui_handler (line 91) | def _visdom_ui_handler(self, data):
method create_tracker (line 100) | def create_tracker(self, params):
method run_sequence (line 105) | def run_sequence(self, seq, visualization=None, debug=None, visdom_inf...
method _track_sequence (line 150) | def _track_sequence(self, tracker, seq, init_info):
method run_video (line 229) | def run_video(self, videofilepath, optional_box=None, debug=None, visd...
method run_webcam (line 336) | def run_webcam(self, debug=None, visdom_info=None):
method run_vot2020 (line 471) | def run_vot2020(self, debug=None, visdom_info=None):
method run_vot (line 563) | def run_vot(self, debug=None, visdom_info=None):
method get_parameters (line 633) | def get_parameters(self):
method init_visualization (line 640) | def init_visualization(self):
method visualize (line 647) | def visualize(self, image, state, segmentation=None):
method reset_tracker (line 677) | def reset_tracker(self):
method press (line 680) | def press(self, event):
method _read_image (line 688) | def _read_image(self, image_file: str):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/trackingnetdataset.py
class TrackingNetDataset (line 7) | class TrackingNetDataset(BaseDataset):
method __init__ (line 18) | def __init__(self):
method get_sequence_list (line 31) | def get_sequence_list(self):
method _construct_sequence (line 34) | def _construct_sequence(self, set, sequence_name):
method __len__ (line 46) | def __len__(self):
method _list_sequences (line 49) | def _list_sequences(self, root, set_ids):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/uavdataset.py
class UAVDataset (line 6) | class UAVDataset(BaseDataset):
method __init__ (line 17) | def __init__(self):
method get_sequence_list (line 22) | def get_sequence_list(self):
method _construct_sequence (line 25) | def _construct_sequence(self, sequence_info):
method __len__ (line 46) | def __len__(self):
method _get_sequence_info_list (line 49) | def _get_sequence_info_list(self):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/vot.py
function parse_region (line 27) | def parse_region(string):
function encode_region (line 35) | def encode_region(region):
function convert_region (line 43) | def convert_region(region, to):
class VOT (line 82) | class VOT(object):
method __init__ (line 84) | def __init__(self, region_format):
method region (line 109) | def region(self):
method report (line 120) | def report(self, region, confidence = 0):
method frame (line 138) | def frame(self):
method quit (line 163) | def quit(self):
method __del__ (line 172) | def __del__(self):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/vot2020.py
function make_full_size (line 23) | def make_full_size(x, output_sz):
class VOT (line 48) | class VOT(object):
method __init__ (line 50) | def __init__(self, region_format, channels=None):
method region (line 85) | def region(self):
method report (line 96) | def report(self, region, confidence = None):
method frame (line 115) | def frame(self):
method quit (line 138) | def quit(self):
method __del__ (line 142) | def __del__(self):
FILE: artrackv2_mindspore/external/AR/pytracking/evaluation/votdataset.py
class VOTDataset (line 5) | class VOTDataset(BaseDataset):
method __init__ (line 18) | def __init__(self):
method get_sequence_list (line 23) | def get_sequence_list(self):
method _construct_sequence (line 26) | def _construct_sequence(self, sequence_name):
method __len__ (line 57) | def __len__(self):
method _get_sequence_list (line 60) | def _get_sequence_list(self):
FILE: artrackv2_mindspore/external/AR/pytracking/experiments/myexperiments.py
function atom_nfs_uav (line 4) | def atom_nfs_uav():
function uav_test (line 12) | def uav_test():
FILE: artrackv2_mindspore/external/AR/pytracking/features/augmentation.py
class Transform (line 10) | class Transform:
method __init__ (line 13) | def __init__(self, output_sz = None, shift = None):
method __call__ (line 17) | def __call__(self, image, is_mask=False):
method crop_to_output (line 20) | def crop_to_output(self, image):
class Identity (line 39) | class Identity(Transform):
method __call__ (line 41) | def __call__(self, image, is_mask=False):
class FlipHorizontal (line 44) | class FlipHorizontal(Transform):
method __call__ (line 46) | def __call__(self, image, is_mask=False):
class FlipVertical (line 52) | class FlipVertical(Transform):
method __call__ (line 54) | def __call__(self, image: torch.Tensor, is_mask=False):
class Translation (line 60) | class Translation(Transform):
method __init__ (line 62) | def __init__(self, translation, output_sz = None, shift = None):
method __call__ (line 66) | def __call__(self, image, is_mask=False):
class Scale (line 72) | class Scale(Transform):
method __init__ (line 74) | def __init__(self, scale_factor, output_sz = None, shift = None):
method __call__ (line 78) | def __call__(self, image, is_mask=False):
class Affine (line 98) | class Affine(Transform):
method __init__ (line 100) | def __init__(self, transform_matrix, output_sz = None, shift = None):
method __call__ (line 104) | def __call__(self, image, is_mask=False):
class Rotate (line 111) | class Rotate(Transform):
method __init__ (line 113) | def __init__(self, angle, output_sz = None, shift = None):
method __call__ (line 117) | def __call__(self, image, is_mask=False):
class Blur (line 128) | class Blur(Transform):
method __init__ (line 130) | def __init__(self, sigma, output_sz = None, shift = None):
method __call__ (line 141) | def __call__(self, image, is_mask=False):
class RandomAffine (line 150) | class RandomAffine(Transform):
method __init__ (line 152) | def __init__(self, p_flip=0.0, max_rotation=0.0, max_shear=0.0, max_sc...
method roll (line 171) | def roll(self):
method _construct_t_mat (line 183) | def _construct_t_mat(self, image_shape, do_flip, theta, shear_values, ...
method __call__ (line 212) | def __call__(self, image, is_mask=False):
FILE: artrackv2_mindspore/external/AR/pytracking/features/color.py
class RGB (line 5) | class RGB(FeatureBase):
method dim (line 7) | def dim(self):
method stride (line 10) | def stride(self):
method extract (line 13) | def extract(self, im: torch.Tensor):
class Grayscale (line 17) | class Grayscale(FeatureBase):
method dim (line 19) | def dim(self):
method stride (line 22) | def stride(self):
method extract (line 25) | def extract(self, im: torch.Tensor):
FILE: artrackv2_mindspore/external/AR/pytracking/features/deep.py
class ResNet18m1 (line 14) | class ResNet18m1(MultiFeatureBase):
method __init__ (line 22) | def __init__(self, output_layers, net_path=None, use_gpu=True, *args, ...
method initialize (line 33) | def initialize(self):
method dim (line 68) | def dim(self):
method stride (line 71) | def stride(self):
method extract (line 74) | def extract(self, im: torch.Tensor):
class ATOMResNet18 (line 86) | class ATOMResNet18(MultiFeatureBase):
method __init__ (line 94) | def __init__(self, output_layers=('layer3',), net_path='atom_iou', use...
method initialize (line 101) | def initialize(self):
method dim (line 125) | def dim(self):
method stride (line 128) | def stride(self):
method extract (line 131) | def extract(self, im: torch.Tensor):
FILE: artrackv2_mindspore/external/AR/pytracking/features/extractor.py
class ExtractorBase (line 5) | class ExtractorBase:
method __init__ (line 10) | def __init__(self, features):
method initialize (line 13) | def initialize(self):
class SingleResolutionExtractor (line 18) | class SingleResolutionExtractor(ExtractorBase):
method __init__ (line 23) | def __init__(self, features):
method stride (line 30) | def stride(self):
method size (line 33) | def size(self, input_sz):
method extract (line 36) | def extract(self, im, pos, scales, image_sz):
class MultiResolutionExtractor (line 49) | class MultiResolutionExtractor(ExtractorBase):
method __init__ (line 54) | def __init__(self, features, patch_mode='replicate', max_scale_change=...
method stride (line 60) | def stride(self):
method size (line 63) | def size(self, input_sz):
method dim (line 66) | def dim(self):
method get_fparams (line 69) | def get_fparams(self, name: str = None):
method get_attribute (line 74) | def get_attribute(self, name: str, ignore_missing: bool = False):
method get_unique_attribute (line 80) | def get_unique_attribute(self, name: str):
method _return_feature (line 91) | def _return_feature(self, f):
method set_is_color (line 94) | def set_is_color(self, is_color: bool):
method extract (line 97) | def extract(self, im, pos, scales, image_sz, return_patches=False):
method extract_transformed (line 124) | def extract_transformed(self, im, pos, scale, image_sz, transforms):
FILE: artrackv2_mindspore/external/AR/pytracking/features/featurebase.py
class FeatureBase (line 6) | class FeatureBase:
method __init__ (line 16) | def __init__(self, fparams = None, pool_stride = None, output_size = N...
method initialize (line 24) | def initialize(self):
method dim (line 27) | def dim(self):
method stride (line 30) | def stride(self):
method size (line 33) | def size(self, im_sz):
method extract (line 40) | def extract(self, im):
method get_feature (line 44) | def get_feature(self, im: torch.Tensor):
class MultiFeatureBase (line 72) | class MultiFeatureBase(FeatureBase):
method size (line 76) | def size(self, im_sz):
method get_feature (line 82) | def get_feature(self, im: torch.Tensor):
FILE: artrackv2_mindspore/external/AR/pytracking/features/net_wrappers.py
class NetWrapper (line 5) | class NetWrapper:
method __init__ (line 9) | def __init__(self, net_path, use_gpu=True, initialize=False, **kwargs):
method __getattr__ (line 17) | def __getattr__(self, name):
method load_network (line 30) | def load_network(self):
method initialize (line 36) | def initialize(self):
class NetWithBackbone (line 40) | class NetWithBackbone(NetWrapper):
method __init__ (line 44) | def __init__(self, net_path, use_gpu=True, initialize=False, image_for...
method initialize (line 52) | def initialize(self, image_format='rgb', mean=(0.485, 0.456, 0.406), s...
method preprocess_image (line 55) | def preprocess_image(self, im: torch.Tensor):
method extract_backbone (line 71) | def extract_backbone(self, im: torch.Tensor):
FILE: artrackv2_mindspore/external/AR/pytracking/features/preprocessing.py
function numpy_to_torch (line 6) | def numpy_to_torch(a: np.ndarray):
function torch_to_numpy (line 10) | def torch_to_numpy(a: torch.Tensor):
function sample_patch_transformed (line 14) | def sample_patch_transformed(im, pos, scale, image_sz, transforms, is_ma...
function sample_patch_multiscale (line 33) | def sample_patch_multiscale(im, pos, scales, image_sz, mode: str='replic...
function sample_patch (line 55) | def sample_patch(im: torch.Tensor, pos: torch.Tensor, sample_sz: torch.T...
FILE: artrackv2_mindspore/external/AR/pytracking/features/util.py
class Concatenate (line 5) | class Concatenate(FeatureBase):
method __init__ (line 10) | def __init__(self, features, pool_stride = None, normalize_power = Non...
method dim (line 20) | def dim(self):
method stride (line 23) | def stride(self):
method extract (line 26) | def extract(self, im: torch.Tensor):
FILE: artrackv2_mindspore/external/AR/pytracking/libs/complex.py
function is_complex (line 5) | def is_complex(a: torch.Tensor) -> bool:
function is_real (line 9) | def is_real(a: torch.Tensor) -> bool:
function mult (line 14) | def mult(a: torch.Tensor, b: torch.Tensor):
function mult_conj (line 36) | def mult_conj(a: torch.Tensor, b: torch.Tensor):
function mult_real_cplx (line 58) | def mult_real_cplx(a: torch.Tensor, b: torch.Tensor):
function div (line 68) | def div(a: torch.Tensor, b: torch.Tensor):
function div_cplx_real (line 81) | def div_cplx_real(a: torch.Tensor, b: torch.Tensor):
function abs_sqr (line 91) | def abs_sqr(a: torch.Tensor):
function abs (line 101) | def abs(a: torch.Tensor):
function conj (line 111) | def conj(a: torch.Tensor):
function real (line 122) | def real(a: torch.Tensor):
function imag (line 132) | def imag(a: torch.Tensor):
function complex (line 142) | def complex(a: torch.Tensor, b: torch.Tensor = None):
function mtimes (line 154) | def mtimes(a: torch.Tensor, b: torch.Tensor, conj_a=False, conj_b=False):
function mtimes_real_complex (line 182) | def mtimes_real_complex(a: torch.Tensor, b: torch.Tensor, conj_b=False):
function mtimes_complex_real (line 193) | def mtimes_complex_real(a: torch.Tensor, b: torch.Tensor, conj_a=False):
function exp_imag (line 204) | def exp_imag(a: torch.Tensor):
FILE: artrackv2_mindspore/external/AR/pytracking/libs/dcf.py
function hann1d (line 8) | def hann1d(sz: int, centered = True) -> torch.Tensor:
function hann2d (line 16) | def hann2d(sz: torch.Tensor, centered = True) -> torch.Tensor:
function hann2d_clipped (line 21) | def hann2d_clipped(sz: torch.Tensor, effective_sz: torch.Tensor, centere...
function gauss_fourier (line 40) | def gauss_fourier(sz: int, sigma: float, half: bool = False) -> torch.Te...
function gauss_spatial (line 48) | def gauss_spatial(sz, sigma, center=0, end_pad=0):
function label_function (line 53) | def label_function(sz: torch.Tensor, sigma: torch.Tensor):
function label_function_spatial (line 56) | def label_function_spatial(sz: torch.Tensor, sigma: torch.Tensor, center...
function cubic_spline_fourier (line 62) | def cubic_spline_fourier(f, a):
function get_interp_fourier (line 74) | def get_interp_fourier(sz: torch.Tensor, method='ideal', bicubic_param=0...
function interpolate_dft (line 97) | def interpolate_dft(a: torch.Tensor, interp_fs) -> torch.Tensor:
function get_reg_filter (line 106) | def get_reg_filter(sz: torch.Tensor, target_sz: torch.Tensor, params):
function max2d (line 156) | def max2d(a: torch.Tensor) -> (torch.Tensor, torch.Tensor):
FILE: artrackv2_mindspore/external/AR/pytracking/libs/fourier.py
function rfftshift2 (line 8) | def rfftshift2(a: torch.Tensor):
function irfftshift2 (line 14) | def irfftshift2(a: torch.Tensor):
function cfft2 (line 20) | def cfft2(a):
function cifft2 (line 28) | def cifft2(a, signal_sizes=None):
function sample_fs (line 35) | def sample_fs(a: torch.Tensor, grid_sz: torch.Tensor = None, rescale = T...
function get_frequency_coord (line 64) | def get_frequency_coord(sz, add_complex_dim = False, device='cpu'):
function shift_fs (line 78) | def shift_fs(a: torch.Tensor, shift: torch.Tensor):
function sum_fs (line 95) | def sum_fs(a: TensorList) -> torch.Tensor:
function sum_fs12 (line 117) | def sum_fs12(a: TensorList) -> torch.Tensor:
function inner_prod_fs (line 140) | def inner_prod_fs(a: torch.Tensor, b: torch.Tensor):
FILE: artrackv2_mindspore/external/AR/pytracking/libs/operation.py
function conv2d (line 7) | def conv2d(input: torch.Tensor, weight: torch.Tensor, bias: torch.Tensor...
function conv1x1 (line 36) | def conv1x1(input: torch.Tensor, weight: torch.Tensor):
FILE: artrackv2_mindspore/external/AR/pytracking/libs/optimization.py
class L2Problem (line 9) | class L2Problem:
method __call__ (line 12) | def __call__(self, x: TensorList) -> TensorList:
method ip_input (line 16) | def ip_input(self, a, b):
method ip_output (line 20) | def ip_output(self, a, b):
method M1 (line 24) | def M1(self, x):
method M2 (line 28) | def M2(self, x):
class MinimizationProblem (line 32) | class MinimizationProblem:
method __call__ (line 34) | def __call__(self, x: TensorList) -> TensorList:
method ip_input (line 38) | def ip_input(self, a, b):
method M1 (line 42) | def M1(self, x):
method M2 (line 45) | def M2(self, x):
class ConjugateGradientBase (line 49) | class ConjugateGradientBase:
method __init__ (line 52) | def __init__(self, fletcher_reeves = True, standard_alpha = True, dire...
method reset_state (line 66) | def reset_state(self):
method run_CG (line 72) | def run_CG(self, num_iter, x=None, eps=0.0):
method A (line 166) | def A(self, x):
method ip (line 170) | def ip(self, a, b):
method residual_norm (line 174) | def residual_norm(self, r):
method check_zero (line 180) | def check_zero(self, s, eps = 0.0):
method M1 (line 186) | def M1(self, x):
method M2 (line 190) | def M2(self, x):
method evaluate_CG_iteration (line 194) | def evaluate_CG_iteration(self, x):
class ConjugateGradient (line 199) | class ConjugateGradient(ConjugateGradientBase):
method __init__ (line 202) | def __init__(self, problem: L2Problem, variable: TensorList, cg_eps = ...
method clear_temp (line 221) | def clear_temp(self):
method run (line 227) | def run(self, num_cg_iter):
method A (line 278) | def A(self, x):
method ip (line 282) | def ip(self, a, b):
method M1 (line 285) | def M1(self, x):
method M2 (line 288) | def M2(self, x):
class GaussNewtonCG (line 293) | class GaussNewtonCG(ConjugateGradientBase):
method __init__ (line 296) | def __init__(self, problem: L2Problem, variable: TensorList, cg_eps = ...
method clear_temp (line 318) | def clear_temp(self):
method run_GN (line 324) | def run_GN(self, *args, **kwargs):
method run (line 328) | def run(self, num_cg_iter, num_gn_iter=None):
method run_GN_iter (line 377) | def run_GN_iter(self, num_cg_iter):
method A (line 410) | def A(self, x):
method ip (line 414) | def ip(self, a, b):
method M1 (line 417) | def M1(self, x):
method M2 (line 420) | def M2(self, x):
method evaluate_CG_iteration (line 423) | def evaluate_CG_iteration(self, delta_x):
class GradientDescentL2 (line 438) | class GradientDescentL2:
method __init__ (line 441) | def __init__(self, problem: L2Problem, variable: TensorList, step_leng...
method clear_temp (line 460) | def clear_temp(self):
method run (line 465) | def run(self, num_iter, dummy = None):
class NewtonCG (line 522) | class NewtonCG(ConjugateGradientBase):
method __init__ (line 525) | def __init__(self, problem: MinimizationProblem, variable: TensorList,...
method clear_temp (line 547) | def clear_temp(self):
method run (line 552) | def run(self, num_cg_iter, num_newton_iter=None):
method run_newton_iter (line 589) | def run_newton_iter(self, num_cg_iter):
method A (line 615) | def A(self, x):
method ip (line 618) | def ip(self, a, b):
method M1 (line 622) | def M1(self, x):
method M2 (line 625) | def M2(self, x):
method evaluate_CG_iteration (line 628) | def evaluate_CG_iteration(self, delta_x):
class GradientDescent (line 642) | class GradientDescent:
method __init__ (line 645) | def __init__(self, problem: MinimizationProblem, variable: TensorList,...
method clear_temp (line 665) | def clear_temp(self):
method run (line 669) | def run(self, num_iter, dummy = None):
FILE: artrackv2_mindspore/external/AR/pytracking/libs/tensordict.py
class TensorDict (line 6) | class TensorDict(OrderedDict):
method concat (line 9) | def concat(self, other):
method copy (line 13) | def copy(self):
method __deepcopy__ (line 16) | def __deepcopy__(self, memodict={}):
method __getattr__ (line 19) | def __getattr__(self, name):
method attribute (line 27) | def attribute(self, attr: str, *args):
method apply (line 30) | def apply(self, fn, *args, **kwargs):
method _iterable (line 34) | def _iterable(a):
FILE: artrackv2_mindspore/external/AR/pytracking/libs/tensorlist.py
class TensorList (line 6) | class TensorList(list):
method __init__ (line 9) | def __init__(self, list_of_tensors = None):
method __deepcopy__ (line 14) | def __deepcopy__(self, memodict={}):
method __getitem__ (line 17) | def __getitem__(self, item):
method __add__ (line 25) | def __add__(self, other):
method __radd__ (line 30) | def __radd__(self, other):
method __iadd__ (line 35) | def __iadd__(self, other):
method __sub__ (line 44) | def __sub__(self, other):
method __rsub__ (line 49) | def __rsub__(self, other):
method __isub__ (line 54) | def __isub__(self, other):
method __mul__ (line 63) | def __mul__(self, other):
method __rmul__ (line 68) | def __rmul__(self, other):
method __imul__ (line 73) | def __imul__(self, other):
method __truediv__ (line 82) | def __truediv__(self, other):
method __rtruediv__ (line 87) | def __rtruediv__(self, other):
method __itruediv__ (line 92) | def __itruediv__(self, other):
method __matmul__ (line 101) | def __matmul__(self, other):
method __rmatmul__ (line 106) | def __rmatmul__(self, other):
method __imatmul__ (line 111) | def __imatmul__(self, other):
method __mod__ (line 120) | def __mod__(self, other):
method __rmod__ (line 125) | def __rmod__(self, other):
method __pos__ (line 130) | def __pos__(self):
method __neg__ (line 133) | def __neg__(self):
method __le__ (line 136) | def __le__(self, other):
method __ge__ (line 141) | def __ge__(self, other):
method concat (line 146) | def concat(self, other):
method copy (line 149) | def copy(self):
method unroll (line 152) | def unroll(self):
method list (line 164) | def list(self):
method attribute (line 167) | def attribute(self, attr: str, *args):
method apply (line 170) | def apply(self, fn):
method __getattr__ (line 173) | def __getattr__(self, name):
method _iterable (line 183) | def _iterable(a):
function tensor_operation (line 188) | def tensor_operation(op):
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/atom/atom_gmm_sampl.py
function parameters (line 6) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/atom/atom_prob_ml.py
function parameters (line 6) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/atom/default.py
function parameters (line 6) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/atom/default_vot.py
function parameters (line 6) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/atom/multiscale_no_iounet.py
function parameters (line 6) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/dimp/dimp18.py
function parameters (line 4) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/dimp/dimp18_vot.py
function parameters (line 4) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/dimp/dimp50.py
function parameters (line 4) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/dimp/dimp50_vot.py
function parameters (line 4) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/dimp/dimp50_vot19.py
function parameters (line 4) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/dimp/prdimp18.py
function parameters (line 4) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/dimp/prdimp50.py
function parameters (line 4) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/dimp/super_dimp.py
function parameters (line 4) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/parameter/eco/default.py
function parameters (line 6) | def parameters():
FILE: artrackv2_mindspore/external/AR/pytracking/tracker/atom/__init__.py
function get_tracker_class (line 3) | def get_tracker_class():
FILE: artrackv2_mindspore/external/AR/pytracking/tracker/atom/atom.py
class ATOM (line 16) | class ATOM(BaseTracker):
method initialize_features (line 20) | def initialize_features(self):
method initialize (line 26) | def initialize(self, image, info: dict) -> dict:
method init_optimization (line 138) | def init_optimization(self, train_x, init_y):
method track (line 225) | def track(self, image, info: dict = None) -> dict:
method apply_filter (line 301) | def apply_filter(self, sample_x: TensorList):
method localize_target (line 304) | def localize_target(self, scores_raw):
method localize_advanced (line 341) | def localize_advanced(self, scores):
method extract_sample (line 409) | def extract_sample(self, im: torch.Tensor, pos: torch.Tensor, scales, ...
method get_iou_features (line 412) | def get_iou_features(self):
method get_iou_backbone_features (line 415) | def get_iou_backbone_features(self):
method extract_processed_sample (line 418) | def extract_processed_sample(self, im: torch.Tensor, pos: torch.Tensor...
method preprocess_sample (line 422) | def preprocess_sample(self, x: TensorList) -> (TensorList, TensorList):
method project_sample (line 427) | def project_sample(self, x: TensorList, proj_matrix = None):
method init_learning (line 433) | def init_learning(self):
method generate_init_samples (line 473) | def generate_init_samples(self, im: torch.Tensor) -> TensorList:
method init_projection_matrix (line 527) | def init_projection_matrix(self, x):
method init_label_function (line 550) | def init_label_function(self, train_x):
method init_memory (line 572) | def init_memory(self, train_x):
method update_memory (line 590) | def update_memory(self, sample_x: TensorList, sample_y: TensorList, le...
method update_sample_weights (line 603) | def update_sample_weights(self, sample_weights, previous_replace_ind, ...
method get_label_function (line 641) | def get_label_function(self, sample_pos, sample_scale):
method update_state (line 650) | def update_state(self, new_pos, new_scale = None):
method get_iounet_box (line 661) | def get_iounet_box(self, pos, sz, sample_pos, sample_scale):
method init_iou_net (line 668) | def init_iou_net(self):
method refine_target_box (line 701) | def refine_target_box(self, sample_pos, sample_scale, scale_ind, updat...
method optimize_boxes (line 758) | def optimize_boxes(self, iou_features, init_boxes):
FILE: artrackv2_mindspore/external/AR/pytracking/tracker/atom/optim.py
class FactorizedConvProblem (line 6) | class FactorizedConvProblem(optimization.L2Problem):
method __init__ (line 7) | def __init__(self, training_samples: TensorList, y:TensorList, filter_...
method __call__ (line 20) | def __call__(self, x: TensorList):
method ip_input (line 49) | def ip_input(self, a: TensorList, b: TensorList):
method M1 (line 67) | def M1(self, x: TensorList):
class ConvProblem (line 71) | class ConvProblem(optimization.L2Problem):
method __init__ (line 72) | def __init__(self, training_samples: TensorList, y:TensorList, filter_...
method __call__ (line 79) | def __call__(self, x: TensorList):
method ip_input (line 96) | def ip_input(self, a: TensorList, b: TensorList):
FILE: artrackv2_mindspore/external/AR/pytracking/tracker/base/basetracker.py
class BaseTracker (line 3) | class BaseTracker:
method __init__ (line 6) | def __init__(self, params):
method initialize (line 11) | def initialize(self, image, info: dict) -> dict:
method track (line 16) | def track(self, image, info: dict = None) -> dict:
method visdom_draw_tracking (line 21) | def visdom_draw_tracking(self, image, box, segmentation=None):
FILE: artrackv2_mindspore/external/AR/pytracking/tracker/dimp/__init__.py
function get_tracker_class (line 3) | def get_tracker_class():
FILE: artrackv2_mindspore/external/AR/pytracking/tracker/dimp/dimp.py
class DiMP (line 16) | class DiMP(BaseTracker):
method initialize_features (line 20) | def initialize_features(self):
method initialize (line 25) | def initialize(self, image, info: dict) -> dict:
method track (line 94) | def track(self, image, info: dict = None) -> dict:
method get_sample_location (line 179) | def get_sample_location(self, sample_coord):
method get_centered_sample_pos (line 186) | def get_centered_sample_pos(self):
method classify_target (line 191) | def classify_target(self, sample_x: TensorList):
method localize_target (line 197) | def localize_target(self, scores, sample_pos, sample_scales):
method localize_advanced (line 239) | def localize_advanced(self, scores, sample_pos, sample_scales):
method extract_backbone_features (line 306) | def extract_backbone_features(self, im: torch.Tensor, pos: torch.Tenso...
method get_classification_features (line 314) | def get_classification_features(self, backbone_feat):
method get_iou_backbone_features (line 318) | def get_iou_backbone_features(self, backbone_feat):
method get_iou_features (line 321) | def get_iou_features(self, backbone_feat):
method get_iou_modulation (line 325) | def get_iou_modulation(self, iou_backbone_feat, target_boxes):
method generate_init_samples (line 330) | def generate_init_samples(self, im: torch.Tensor) -> TensorList:
method init_target_boxes (line 400) | def init_target_boxes(self):
method init_memory (line 411) | def init_memory(self, train_x: TensorList):
method update_memory (line 431) | def update_memory(self, sample_x: TensorList, target_box, learning_rat...
method update_sample_weights (line 446) | def update_sample_weights(self, sample_weights, previous_replace_ind, ...
method update_state (line 487) | def update_state(self, new_pos, new_scale = None):
method get_iounet_box (line 499) | def get_iounet_box(self, pos, sz, sample_pos, sample_scale):
method init_iou_net (line 508) | def init_iou_net(self, backbone_feat):
method init_classifier (line 537) | def init_classifier(self, init_backbone_feat):
method _overwrite_classifier_params (line 590) | def _overwrite_classifier_params(self, feature_dim):
method update_classifier (line 606) | def update_classifier(self, train_x, target_box, learning_rate=None, s...
method refine_target_box (line 651) | def refine_target_box(self, backbone_feat, sample_pos, sample_scale, s...
method optimize_boxes (line 717) | def optimize_boxes(self, iou_features, init_boxes):
method optimize_boxes_default (line 726) | def optimize_boxes_default(self, iou_features, init_boxes):
method optimize_boxes_relative (line 754) | def optimize_boxes_relative(self, iou_features, init_boxes):
method direct_box_regression (line 791) | def direct_box_regression(self, backbone_feat, sample_pos, sample_scal...
method visualize_iou_pred (line 830) | def visualize_iou_pred(self, iou_features, center_box):
method visdom_draw_tracking (line 862) | def visdom_draw_tracking(self, image, box, segmentation=None):
FILE: artrackv2_mindspore/external/AR/pytracking/tracker/eco/__init__.py
function get_tracker_class (line 3) | def get_tracker_class():
FILE: artrackv2_mindspore/external/AR/pytracking/tracker/eco/eco.py
class ECO (line 15) | class ECO(BaseTracker):
method initialize_features (line 19) | def initialize_features(self):
method initialize (line 25) | def initialize(self, image, info: dict) -> dict:
method track (line 181) | def track(self, image, info: dict = None) -> dict:
method apply_filter (line 244) | def apply_filter(self, sample_xf: TensorList) -> torch.Tensor:
method localize_target (line 247) | def localize_target(self, sf: TensorList):
method extract_sample (line 290) | def extract_sample(self, im: torch.Tensor, pos: torch.Tensor, scales, ...
method extract_fourier_sample (line 293) | def extract_fourier_sample(self, im: torch.Tensor, pos: torch.Tensor, ...
method preprocess_sample (line 297) | def preprocess_sample(self, x: TensorList) -> TensorList:
method project_sample (line 302) | def project_sample(self, x: TensorList):
method generate_init_samples (line 311) | def generate_init_samples(self, im: torch.Tensor) -> TensorList:
method update_memory (line 339) | def update_memory(self, sample_xf: TensorList):
method update_sample_weights (line 346) | def update_sample_weights(self):
method update_state (line 372) | def update_state(self, new_pos, new_scale):
method symmetrize_filter (line 382) | def symmetrize_filter(self):
FILE: artrackv2_mindspore/external/AR/pytracking/tracker/eco/optim.py
class FactorizedConvProblem (line 8) | class FactorizedConvProblem(optimization.L2Problem):
method __init__ (line 9) | def __init__(self, training_samples: TensorList, yf:TensorList, reg_fi...
method __call__ (line 34) | def __call__(self, x: TensorList):
method ip_input (line 77) | def ip_input(self, a: TensorList, b: TensorList):
method ip_output (line 94) | def ip_output(self, a: TensorList, b: TensorList):
method M1 (line 117) | def M1(self, x: TensorList):
class FilterOptim (line 121) | class FilterOptim(optimization.ConjugateGradientBase):
method __init__ (line 122) | def __init__(self, params, reg_energy):
method register (line 134) | def register(self, filter, training_samples, yf, sample_weights, reg_f...
method run (line 142) | def run(self, num_iter, new_xf: TensorList = None):
method A (line 168) | def A(self, hf: TensorList):
method ip (line 203) | def ip(self, a: torch.Tensor, b: torch.Tensor):
method M1 (line 207) | def M1(self, hf):
FILE: artrackv2_mindspore/external/AR/pytracking/util_scripts/download_results.py
function _download_file (line 57) | def _download_file(file_id, path):
function download_results (line 62) | def download_results(download_path, trackers='all'):
function unpack_tracking_results (line 111) | def unpack_tracking_results(download_path, output_path=None):
function main (line 150) | def main():
FILE: artrackv2_mindspore/external/AR/pytracking/util_scripts/pack_got10k_results.py
function pack_got10k_results (line 7) | def pack_got10k_results(tracker_name, param_name, output_name):
FILE: artrackv2_mindspore/external/AR/pytracking/util_scripts/pack_trackingnet_results.py
function pack_trackingnet_results (line 8) | def pack_trackingnet_results(tracker_name, param_name, run_id=None, outp...
FILE: artrackv2_mindspore/external/AR/pytracking/utils/convert_vot_anno_to_rect.py
function convert_vot_anno_to_rect (line 4) | def convert_vot_anno_to_rect(vot_anno, type):
FILE: artrackv2_mindspore/external/AR/pytracking/utils/load_text.py
function load_text_numpy (line 5) | def load_text_numpy(path, delimiter, dtype):
function load_text_pandas (line 20) | def load_text_pandas(path, delimiter, dtype):
function load_text (line 37) | def load_text(path, delimiter=' ', dtype=np.float32, backend='numpy'):
FILE: artrackv2_mindspore/external/AR/pytracking/utils/loading.py
function load_network (line 6) | def load_network(net_path, **kwargs):
FILE: artrackv2_mindspore/external/AR/pytracking/utils/params.py
class TrackerParams (line 5) | class TrackerParams:
method set_default_values (line 7) | def set_default_values(self, default_vals: dict):
method get (line 12) | def get(self, name: str, *default):
method has (line 23) | def has(self, name: str):
class FeatureParams (line 28) | class FeatureParams:
method __init__ (line 30) | def __init__(self, *args, **kwargs):
function Choice (line 41) | def Choice(*args):
FILE: artrackv2_mindspore/external/AR/pytracking/utils/plotting.py
function draw_figure (line 7) | def draw_figure(fig):
function show_tensor (line 13) | def show_tensor(a: torch.Tensor, fig_num = None, title = None, range=(No...
function plot_graph (line 43) | def plot_graph(a: torch.Tensor, fig_num = None, title = None):
function show_image_with_boxes (line 61) | def show_image_with_boxes(im, boxes, iou_pred=None, disp_ids=None):
function _pascal_color_map (line 86) | def _pascal_color_map(N=256, normalized=False):
function overlay_mask (line 113) | def overlay_mask(im, ann, alpha=0.5, colors=None, contour_thickness=None):
FILE: artrackv2_mindspore/external/AR/pytracking/utils/visdom.py
class VisBase (line 12) | class VisBase:
method __init__ (line 13) | def __init__(self, visdom, show_data, title):
method update (line 19) | def update(self, data, **kwargs):
method save_data (line 25) | def save_data(self, data, **kwargs):
method draw_data (line 28) | def draw_data(self):
method toggle_display (line 31) | def toggle_display(self, new_mode=None):
class VisImage (line 43) | class VisImage(VisBase):
method __init__ (line 44) | def __init__(self, visdom, show_data, title):
method save_data (line 47) | def save_data(self, data):
method draw_data (line 51) | def draw_data(self):
class VisHeatmap (line 55) | class VisHeatmap(VisBase):
method __init__ (line 56) | def __init__(self, visdom, show_data, title):
method save_data (line 59) | def save_data(self, data):
method draw_data (line 63) | def draw_data(self):
class VisFeaturemap (line 67) | class VisFeaturemap(VisBase):
method __init__ (line 68) | def __init__(self, visdom, show_data, title):
method block_list_callback_handler (line 72) | def block_list_callback_handler(self, data):
method save_data (line 77) | def save_data(self, data):
method draw_data (line 91) | def draw_data(self):
class VisCostVolume (line 100) | class VisCostVolume(VisBase):
method __init__ (line 101) | def __init__(self, visdom, show_data, title, flip=False):
method show_cost_volume (line 107) | def show_cost_volume(self):
method set_zoom_pos (line 118) | def set_zoom_pos(self, slice_pos):
method toggle_show_slice (line 121) | def toggle_show_slice(self, new_mode=None):
method show_cost_volume_slice (line 127) | def show_cost_volume_slice(self):
method save_data (line 139) | def save_data(self, data):
method draw_data (line 143) | def draw_data(self):
class VisCostVolumeUI (line 150) | class VisCostVolumeUI(VisBase):
method cv_ui_handler (line 151) | def cv_ui_handler(self, data):
method __init__ (line 178) | def __init__(self, visdom, show_data, title, feat_shape, registered_bl...
method draw_grid (line 187) | def draw_grid(self, data):
method shade_cell (line 200) | def shade_cell(self, data):
method show_image (line 214) | def show_image(self, data=None):
method save_data (line 222) | def save_data(self, data):
method draw_data (line 228) | def draw_data(self):
class VisInfoDict (line 232) | class VisInfoDict(VisBase):
method __init__ (line 233) | def __init__(self, visdom, show_data, title):
method generate_display_text (line 237) | def generate_display_text(self, data):
method save_data (line 250) | def save_data(self, data):
method draw_data (line 254) | def draw_data(self):
class VisText (line 260) | class VisText(VisBase):
method __init__ (line 261) | def __init__(self, visdom, show_data, title):
method save_data (line 264) | def save_data(self, data):
method draw_data (line 267) | def draw_data(self):
class VisLinePlot (line 272) | class VisLinePlot(VisBase):
method __init__ (line 273) | def __init__(self, visdom, show_data, title):
method save_data (line 276) | def save_data(self, data):
method draw_data (line 279) | def draw_data(self):
class VisTracking (line 290) | class VisTracking(VisBase):
method __init__ (line 291) | def __init__(self, visdom, show_data, title):
method save_data (line 294) | def save_data(self, data):
method draw_data (line 313) | def draw_data(self):
class VisBBReg (line 337) | class VisBBReg(VisBase):
method __init__ (line 338) | def __init__(self, visdom, show_data, title):
method block_list_callback_handler (line 342) | def block_list_callback_handler(self, data):
method save_data (line 347) | def save_data(self, data):
method draw_data (line 353) | def draw_data(self):
class Visdom (line 370) | class Visdom:
method __init__ (line 371) | def __init__(self, debug=0, ui_info=None, visdom_info=None):
method block_list_callback_handler (line 383) | def block_list_callback_handler(self, data):
method register (line 392) | def register(self, data, mode, debug_level=0, title='Data', **kwargs):
FILE: artrackv2_mindspore/external/AR/pytracking/vot20_utils.py
function make_full_size (line 4) | def make_full_size(x, output_sz):
function rect_from_mask (line 25) | def rect_from_mask(mask):
function mask_from_rect (line 39) | def mask_from_rect(rect, output_sz):
function bbox_clip (line 54) | def bbox_clip(x1, y1, x2, y2, boundary, min_sz=10):
FILE: artrackv2_mindspore/external/PreciseRoIPooling/pytorch/prroi_pool/functional.py
function _import_prroi_pooling (line 21) | def _import_prroi_pooling():
class PrRoIPool2DFunction (line 41) | class PrRoIPool2DFunction(ag.Function):
method forward (line 43) | def forward(ctx, features, rois, pooled_height, pooled_width, spatial_...
method backward (line 68) | def backward(ctx, grad_output):
FILE: artrackv2_mindspore/external/PreciseRoIPooling/pytorch/prroi_pool/prroi_pool.py
class PrRoIPool2D (line 19) | class PrRoIPool2D(nn.Module):
method __init__ (line 20) | def __init__(self, pooled_height, pooled_width, spatial_scale):
method forward (line 27) | def forward(self, features, rois):
method extra_repr (line 30) | def extra_repr(self):
FILE: artrackv2_mindspore/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c
function output (line 26) | auto output = at::zeros({nr_rois, nr_channels, pooled_height, pooled_wid...
FILE: artrackv2_mindspore/external/PreciseRoIPooling/pytorch/tests/test_prroi_pooling2d.py
class TestPrRoIPool2D (line 20) | class TestPrRoIPool2D(TorchTestCase):
method test_forward (line 21) | def test_forward(self):
method test_backward_shapeonly (line 37) | def test_backward_shapeonly(self):
FILE: artrackv2_mindspore/lib/config/ostrack/config.py
function _edict2dict (line 129) | def _edict2dict(dest_dict, src_edict):
function gen_config (line 141) | def gen_config(config_file):
function _update_config (line 148) | def _update_config(base_cfg, exp_cfg):
function update_config_from_file (line 162) | def update_config_from_file(filename, base_cfg=None):
FILE: artrackv2_mindspore/lib/models/component/attention.py
class Attention (line 15) | class Attention(nn.Cell):
method __init__ (line 16) | def __init__(self, dim, num_heads=8, qkv_bias=False, attn_drop=0., pro...
method construct (line 27) | def construct(self, x, padding_mask=None, **kwargs):
class ClsMixAttention (line 48) | class ClsMixAttention(nn.Cell):
method __init__ (line 49) | def __init__(self,
method construct (line 66) | def construct(self, x, t_h, t_w, s_h, s_w, online_size=1, padding_mask...
class MixAttention (line 111) | class MixAttention(nn.Cell):
method __init__ (line 112) | def __init__(self,
method construct (line 129) | def construct(self, x, t_h, t_w, s_h, s_w, padding_mask=None):
class NottAttention (line 165) | class NottAttention(nn.Cell):
method __init__ (line 166) | def __init__(self,
method construct (line 183) | def construct(self, x, t_h, t_w, s_h, s_w, padding_mask=None):
class NossAttention (line 219) | class NossAttention(nn.Cell):
method __init__ (line 220) | def __init__(self,
method construct (line 237) | def construct(self, x, t_h, t_w, s_h, s_w, padding_mask=None):
class CrossAttention (line 273) | class CrossAttention(nn.Cell):
method __init__ (line 274) | def __init__(self,
method construct (line 291) | def construct(self, x, t_h, t_w, s_h, s_w):
FILE: artrackv2_mindspore/lib/models/component/block.py
class Block (line 11) | class Block(nn.Cell):
method __init__ (line 12) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, drop=...
method construct (line 31) | def construct(self, x, **kwargs):
FILE: artrackv2_mindspore/lib/models/component/drop.py
function drop_block_2d (line 21) | def drop_block_2d(
function drop_block_fast_2d (line 69) | def drop_block_fast_2d(
class DropBlock2d (line 108) | class DropBlock2d(nn.Cell):
method __init__ (line 111) | def __init__(self,
method construct (line 128) | def construct(self, x):
function drop_path (line 139) | def drop_path(x, drop_prob: float = 0., training: bool = False):
class DropPath (line 158) | class DropPath(nn.Cell):
method __init__ (line 161) | def __init__(self, drop_prob=None):
method construct (line 165) | def construct(self, x):
FILE: artrackv2_mindspore/lib/models/component/mlp.py
class Mlp (line 9) | class Mlp(nn.Cell):
method __init__ (line 12) | def __init__(self, in_features, hidden_features=None, out_features=Non...
method construct (line 21) | def construct(self, x):
class MultiLayerMlp (line 29) | class MultiLayerMlp(nn.Cell):
method __init__ (line 32) | def __init__(self, input_dim, hidden_dim, output_dim, num_layers, BN=F...
method construct (line 43) | def construct(self, x):
class GluMlp (line 48) | class GluMlp(nn.Cell):
method __init__ (line 52) | def __init__(self, in_features, hidden_features=None, out_features=Non...
method init_weights (line 62) | def init_weights(self):
method construct (line 68) | def construct(self, x):
class GatedMlp (line 78) | class GatedMlp(nn.Cell):
method __init__ (line 81) | def __init__(self, in_features, hidden_features=None, out_features=Non...
method construct (line 97) | def construct(self, x):
class ConvMlp (line 107) | class ConvMlp(nn.Cell):
method __init__ (line 110) | def __init__(
method construct (line 121) | def construct(self, x):
FILE: artrackv2_mindspore/lib/models/component/norm.py
class FrozenBatchNorm2d (line 8) | class FrozenBatchNorm2d(torch.nn.Module):
method __init__ (line 17) | def __init__(self, n):
method _load_from_state_dict (line 24) | def _load_from_state_dict(self, state_dict, prefix, local_metadata, st...
method forward (line 34) | def forward(self, x):
FILE: artrackv2_mindspore/lib/models/component/patch_embed.py
function _ntuple (line 17) | def _ntuple(n):
class PatchEmbed (line 32) | class PatchEmbed(nn.Module):
method __init__ (line 35) | def __init__(self, patch_size=16, in_chans=3, embed_dim=768, norm_laye...
method forward (line 41) | def forward(self, x):
FILE: artrackv2_mindspore/lib/models/component/pos_embed.py
function get_2d_sincos_pos_embed (line 18) | def get_2d_sincos_pos_embed(embed_dim, grid_size, cls_token=False):
function get_2d_sincos_pos_embed_from_grid (line 36) | def get_2d_sincos_pos_embed_from_grid(embed_dim, grid):
function get_1d_sincos_pos_embed_from_grid (line 47) | def get_1d_sincos_pos_embed_from_grid(embed_dim, pos):
function interpolate_pos_embed (line 74) | def interpolate_pos_embed(model, checkpoint_model):
FILE: artrackv2_mindspore/lib/models/component/weight_init.py
function _no_grad_trunc_normal_ (line 7) | def _no_grad_trunc_normal_(tensor, mean, std, a, b):
function trunc_normal_ (line 43) | def trunc_normal_(tensor, mean=0., std=1., a=-2., b=2.):
function variance_scaling_ (line 64) | def variance_scaling_(tensor, scale=1.0, mode='fan_in', distribution='no...
function lecun_normal_ (line 87) | def lecun_normal_(tensor):
FILE: artrackv2_mindspore/lib/models/layers/attn.py
class Attention (line 11) | class Attention(nn.Cell):
method __init__ (line 12) | def __init__(self, dim, num_heads=8, qkv_bias=False, attn_drop=0., pro...
method construct (line 36) | def construct(self, x, mask=None, return_attention=False):
class Attention_talking_head (line 72) | class Attention_talking_head(nn.Cell):
method __init__ (line 75) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at...
method construct (line 106) | def construct(self, x, mask=None):
FILE: artrackv2_mindspore/lib/models/layers/attn_blocks.py
function candidate_elimination (line 9) | def candidate_elimination(attn: torch.Tensor, tokens: torch.Tensor, lens...
class CEBlock (line 77) | class CEBlock(nn.Module):
method __init__ (line 79) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, drop=...
method forward (line 92) | def forward(self, x, global_index_template, global_index_search, mask=...
class Block (line 106) | class Block(nn.Module):
method __init__ (line 108) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, drop=...
method forward (line 119) | def forward(self, x, mask=None):
FILE: artrackv2_mindspore/lib/models/layers/head.py
function top_k_top_p_filtering_batch (line 14) | def top_k_top_p_filtering_batch(logits, top_k=0, top_p=0.0, filter_value...
function conv (line 47) | def conv(in_planes, out_planes, kernel_size=3, stride=1, padding=1, dila...
class Corner_Predictor (line 57) | class Corner_Predictor(nn.Cell):
method __init__ (line 60) | def __init__(self, inplanes=64, channel=256, feat_sz=20, stride=16, fr...
method construct (line 85) | def construct(self, x, return_dist=False, softmax=True):
method get_score_map (line 97) | def get_score_map(self, x):
method soft_argmax (line 113) | def soft_argmax(self, score_map, return_dist=False, softmax=True):
class CenterPredictor (line 128) | class CenterPredictor(nn.Cell, ):
method __init__ (line 129) | def __init__(self, inplanes=64, channel=256, feat_sz=20, stride=16, fr...
method construct (line 160) | def construct(self, x, gt_score_map=None):
method cal_bbox (line 172) | def cal_bbox(self, score_map_ctr, size_map, offset_map, return_score=F...
method get_pred (line 192) | def get_pred(self, score_map_ctr, size_map, offset_map):
method get_score_map (line 205) | def get_score_map(self, x):
class MLP (line 234) | class MLP(nn.Cell):
method __init__ (line 237) | def __init__(self, input_dim, hidden_dim, output_dim, num_layers, BN=F...
method construct (line 248) | def construct(self, x):
class SelfAttention (line 253) | class SelfAttention(nn.Cell):
method __init__ (line 254) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at...
method construct (line 276) | def construct(self, x, q_ape, k_ape, attn_pos):
class CrossAttention (line 314) | class CrossAttention(nn.Cell):
method __init__ (line 315) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at...
method construct (line 338) | def construct(self, q, kv, q_ape, k_ape, attn_pos):
class Mlp (line 377) | class Mlp(nn.Cell):
method __init__ (line 380) | def __init__(self, in_features, hidden_features=None, out_features=Non...
method construct (line 389) | def construct(self, x):
class FeatureFusion (line 403) | class FeatureFusion(nn.Cell):
method __init__ (line 404) | def __init__(self,
method construct (line 430) | def construct(self, z, x, z_self_attn_pos, x_self_attn_pos, z_x_cross_...
class FeatureFusionEncoder (line 442) | class FeatureFusionEncoder(nn.Cell):
method __init__ (line 443) | def __init__(self, feature_fusion_layers, z_pos_enc, x_pos_enc,
method construct (line 464) | def construct(self, z, x, z_pos, x_pos):
class Learned2DPositionalEncoder (line 507) | class Learned2DPositionalEncoder(nn.Cell):
method __init__ (line 508) | def __init__(self, dim, w, h):
method construct (line 515) | def construct(self):
class Untied2DPositionalEncoder (line 520) | class Untied2DPositionalEncoder(nn.Cell):
method __init__ (line 521) | def __init__(self, dim, num_heads, w, h, scale=None, with_q=True, with...
method construct (line 537) | def construct(self):
function generate_2d_relative_positional_encoding_index (line 553) | def generate_2d_relative_positional_encoding_index(z_shape, x_shape):
class RelativePosition2DEncoder (line 573) | class RelativePosition2DEncoder(nn.Cell):
method __init__ (line 574) | def __init__(self, num_heads, embed_size):
method construct (line 579) | def construct(self, attn_rpe_index):
class DropPathAllocator (line 588) | class DropPathAllocator:
method __init__ (line 589) | def __init__(self, max_drop_path_rate, stochastic_depth_decay = True):
method __enter__ (line 595) | def __enter__(self):
method __exit__ (line 598) | def __exit__(self, exc_type, exc_val, exc_tb):
method __len__ (line 616) | def __len__(self):
method increase_depth (line 624) | def increase_depth(self):
method get_depth (line 628) | def get_depth(self):
method allocate (line 631) | def allocate(self):
method get_all_allocated (line 639) | def get_all_allocated(self):
function build_encoder (line 646) | def build_encoder(encoder_layer, num_heads, mlp_ratio, qkv_bias, drop_ra...
class TargetQueryDecoderLayer (line 677) | class TargetQueryDecoderLayer(nn.Cell):
method __init__ (line 678) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc...
method construct (line 704) | def construct(self, query, memoryz, query_pos, tgt_mask: Optional[Tens...
function _get_clones (line 735) | def _get_clones(module, N):
class TargetQueryDecoderBlock (line 738) | class TargetQueryDecoderBlock(nn.Cell):
method __init__ (line 739) | def __init__(self, dim, decoder_layers, num_layer):
method construct (line 745) | def construct(self, tgt, z, query_pos: Optional[Tensor] = None,
function build_decoder (line 768) | def build_decoder(decoder_layer, drop_path, dim, num_heads, mlp_ratio, q...
function generate_square_subsequent_mask (line 781) | def generate_square_subsequent_mask(sz):
class Pix2Track (line 794) | class Pix2Track(nn.Cell):
method __init__ (line 795) | def __init__(self, in_channel=64, feat_sz=20, feat_tz=10, stride=16, e...
method construct (line 820) | def construct(self, zx_feat, pos_z, pos_x, identity, seqs_input=None, ...
function build_box_head (line 974) | def build_box_head(cfg, hidden_dim):
FILE: artrackv2_mindspore/lib/models/layers/mask_decoder.py
class MaskDecoder (line 19) | class MaskDecoder(nn.Cell):
method __init__ (line 20) | def __init__(self, mask_ratio=0.75, patch_size=16, num_patches=8 ** 2,...
method random_masking (line 47) | def random_masking(self, x):
method forward_decoder (line 79) | def forward_decoder(self, x, eval=False):
method unpatchify (line 101) | def unpatchify(self, x):
method patchify (line 115) | def patchify(self, imgs):
method forward_loss (line 130) | def forward_loss(self, imgs, pred, mask=None):
method construct (line 150) | def construct(self, x, images=None, gt_bboxes=None, eval=False,):
function mask_decoder (line 165) | def mask_decoder():
function build_maskdecoder (line 172) | def build_maskdecoder(cfg):
FILE: artrackv2_mindspore/lib/models/layers/patch_embed.py
class PatchEmbed (line 8) | class PatchEmbed(nn.Cell):
method __init__ (line 12) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=...
method construct (line 25) | def construct(self, x):
FILE: artrackv2_mindspore/lib/models/layers/rpe.py
function generate_2d_relative_positional_encoding_index (line 6) | def generate_2d_relative_positional_encoding_index(z_shape, x_shape):
function generate_2d_concatenated_self_attention_relative_positional_encoding_index (line 27) | def generate_2d_concatenated_self_attention_relative_positional_encoding...
function generate_2d_concatenated_cross_attention_relative_positional_encoding_index (line 59) | def generate_2d_concatenated_cross_attention_relative_positional_encodin...
class RelativePosition2DEncoder (line 91) | class RelativePosition2DEncoder(nn.Module):
method __init__ (line 92) | def __init__(self, num_heads, embed_size):
method forward (line 97) | def forward(self, attn_rpe_index):
FILE: artrackv2_mindspore/lib/models/ostrack/base_backbone.py
function generate_square_subsequent_mask (line 16) | def generate_square_subsequent_mask(sz, sx, ss):
class BaseBackbone (line 33) | class BaseBackbone(nn.Cell):
method __init__ (line 34) | def __init__(self):
method finetune_track (line 68) | def finetune_track(self, cfg, patch_start_index=1):
method forward_features (line 144) | def forward_features(self, z_0, z_1_feat, x, identity, seqs_input):
method construct (line 237) | def construct(self, z_0, z_1_feat, x, identity, seqs_input, **kwargs):
FILE: artrackv2_mindspore/lib/models/ostrack/load_parameter_test.py
function get_keymap_txt (line 6) | def get_keymap_txt(pth_file):
FILE: artrackv2_mindspore/lib/models/ostrack/ostrack.py
class OSTrack (line 20) | class OSTrack(nn.Cell):
method __init__ (line 23) | def __init__(self, transformer,
method construct (line 44) | def construct(self, template: ms.Tensor,
method forward_head (line 92) | def forward_head(self, cat_feature, pos_z, pos_x, identity, seq_input=...
class MlpScoreDecoder (line 123) | class MlpScoreDecoder(nn.Cell):
method __init__ (line 124) | def __init__(self, in_dim, hidden_dim, num_layers, bn=False):
method construct (line 140) | def construct(self, reg_tokens):
function build_score_decoder (line 148) | def build_score_decoder(cfg):
function build_ostrack (line 156) | def build_ostrack(cfg, training=True):
FILE: artrackv2_mindspore/lib/models/ostrack/utils.py
function combine_tokens (line 6) | def combine_tokens(template_tokens, search_tokens, mode='direct', return...
function recover_tokens (line 48) | def recover_tokens(merged_tokens, len_template_token, len_search_token, ...
function window_partition (line 69) | def window_partition(x, window_size: int):
function window_reverse (line 84) | def window_reverse(windows, window_size: int, H: int, W: int):
FILE: artrackv2_mindspore/lib/models/ostrack/vit.py
class Attention (line 40) | class Attention(msnn.Cell):
method __init__ (line 41) | def __init__(self, dim, num_heads=8, qkv_bias=False, attn_drop=0., pro...
method construct (line 52) | def construct(self, x, return_attention=False,padding_mask=None):
class Block (line 81) | class Block(msnn.Cell):
method __init__ (line 83) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, drop=...
method construct (line 97) | def construct(self, x, return_attention=False,padding_mask=None):
class VisionTransformer (line 109) | class VisionTransformer(BaseBackbone):
method __init__ (line 117) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe...
method init_weights (line 190) | def init_weights(self, mode=''):
method _init_weights (line 203) | def _init_weights(self, m):
method load_pretrained (line 208) | def load_pretrained(self, checkpoint_path, prefix=''):
method no_weight_decay (line 212) | def no_weight_decay(self):
method get_classifier (line 215) | def get_classifier(self):
method reset_classifier (line 221) | def reset_classifier(self, num_classes, global_pool=''):
function _init_vit_weights (line 228) | def _init_vit_weights(Cell: msnn.Cell, name: str = '', head_bias: float ...
function _load_weights (line 269) | def _load_weights(model: VisionTransformer, checkpoint_path: str, prefix...
function resize_pos_embed (line 348) | def resize_pos_embed(posemb, posemb_new, num_tokens=1, gs_new=()):
function checkpoint_filter_fn (line 370) | def checkpoint_filter_fn(state_dict, model):
function _create_vision_transformer (line 389) | def _create_vision_transformer(variant, pretrained=False, default_cfg=No...
function vit_base_patch16_224 (line 405) | def vit_base_patch16_224(pretrained=False, **kwargs):
function vit_large_patch16_224 (line 414) | def vit_large_patch16_224(pretrained=False, **kwargs):
FILE: artrackv2_mindspore/lib/models/ostrack/vit_ce.py
class VisionTransformerCE (line 21) | class VisionTransformerCE(VisionTransformer):
method __init__ (line 31) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe...
method forward_features (line 102) | def forward_features(self, z, x, mask_z=None, mask_x=None,
method forward (line 187) | def forward(self, z, x, ce_template_mask=None, ce_keep_rate=None,
function _create_vision_transformer (line 196) | def _create_vision_transformer(pretrained=False, **kwargs):
function vit_base_patch16_224_ce (line 210) | def vit_base_patch16_224_ce(pretrained=False, **kwargs):
function vit_large_patch16_224_ce (line 219) | def vit_large_patch16_224_ce(pretrained=False, **kwargs):
FILE: artrackv2_mindspore/lib/models/timm.py
function to_2tuple (line 6) | def to_2tuple(input):
class Mlp (line 19) | class Mlp(nn.Cell):
method __init__ (line 22) | def __init__(self, in_features, hidden_features=None, out_features=Non...
method construct (line 35) | def construct(self, x):
function drop_path (line 43) | def drop_path(x, drop_prob: float = 0., training: bool = False, scale_by...
class DropPath (line 63) | class DropPath(nn.Cell):
method __init__ (line 66) | def __init__(self, drop_prob: float = 0., scale_by_keep: bool = True):
method construct (line 71) | def construct(self, x):
method extra_repr (line 74) | def extra_repr(self):
function _trunc_normal_ (line 76) | def _trunc_normal_(tensor, mean, std, a, b):
function trunc_normal_ (line 115) | def trunc_normal_(tensor, mean=0., std=1., a=-2., b=2.):
function trunc_normal_tf_ (line 140) | def trunc_normal_tf_(tensor, mean=0., std=1., a=-2., b=2.):
function variance_scaling_ (line 166) | def variance_scaling_(tensor, scale=1.0, mode='fan_in', distribution='no...
function lecun_normal_ (line 187) | def lecun_normal_(tensor):
function adapt_input_conv (line 189) | def adapt_input_conv(in_chans, conv_weight):
FILE: artrackv2_mindspore/lib/train/_init_paths.py
function add_path (line 9) | def add_path(path):
FILE: artrackv2_mindspore/lib/train/actors/base_actor.py
class BaseActor (line 4) | class BaseActor:
method __init__ (line 7) | def __init__(self, net, objective):
method __call__ (line 16) | def __call__(self, data: TensorDict):
method to (line 28) | def to(self, device):
method train (line 35) | def train(self, mode=True):
method eval (line 42) | def eval(self):
FILE: artrackv2_mindspore/lib/train/actors/ostrack.py
function IoU (line 17) | def IoU(rect1, rect2):
function fp16_clamp (line 43) | def fp16_clamp(x, min=None, max=None):
function generate_sa_simdr (line 50) | def generate_sa_simdr(joints):
function SIoU_loss (line 100) | def SIoU_loss(test1, test2, theta=4):
function ciou (line 148) | def ciou(pred, target, eps=1e-7):
class OSTrackActor (line 192) | class OSTrackActor(BaseActor):
method __init__ (line 195) | def __init__(self, net, objective, loss_weight, settings, bins, search...
method __call__ (line 212) | def __call__(self, data):
method _bbox_clip (line 230) | def _bbox_clip(self, cx, cy, width, height, boundary):
method get_subwindow (line 237) | def get_subwindow(self, im, pos, model_sz, original_sz, avg_chans):
method batch_init (line 298) | def batch_init(self, images, template_bbox, initial_bbox) -> dict:
method batch_track (line 362) | def batch_track(self, img, gt_boxes, template, dz_feat, action_mode='m...
method explore (line 515) | def explore(self, data):
method forward_pass (line 662) | def forward_pass(self, data):
method compute_sequence_losses (line 721) | def compute_sequence_losses(self, data):
method compute_losses (line 868) | def compute_losses(self, pred_dict, gt_dict, return_status=True):
FILE: artrackv2_mindspore/lib/train/admin/environment.py
function create_default_local_file (line 6) | def create_default_local_file():
function create_default_local_file_ITP_train (line 45) | def create_default_local_file_ITP_train(workspace_dir, data_dir):
function env_settings (line 93) | def env_settings():
FILE: artrackv2_mindspore/lib/train/admin/local.py
class EnvironmentSettings (line 1) | class EnvironmentSettings:
method __init__ (line 2) | def __init__(self):
FILE: artrackv2_mindspore/lib/train/admin/settings.py
class Settings (line 4) | class Settings:
method __init__ (line 6) | def __init__(self):
method set_default (line 9) | def set_default(self):
FILE: artrackv2_mindspore/lib/train/admin/stats.py
class StatValue (line 3) | class StatValue:
method __init__ (line 4) | def __init__(self):
method reset (line 7) | def reset(self):
method clear (line 10) | def clear(self):
method update (line 14) | def update(self, val):
class AverageMeter (line 19) | class AverageMeter(object):
method __init__ (line 21) | def __init__(self):
method reset (line 25) | def reset(self):
method clear (line 31) | def clear(self):
method update (line 35) | def update(self, val, n=1):
method new_epoch (line 41) | def new_epoch(self):
function topk_accuracy (line 50) | def topk_accuracy(output, target, topk=(1,)):
FILE: artrackv2_mindspore/lib/train/base_functions.py
function update_settings (line 11) | def update_settings(settings, cfg):
function names2datasets (line 27) | def names2datasets(name_list: list, settings, image_loader):
function build_dataloaders (line 85) | def build_dataloaders(cfg, settings):
function get_optimizer_scheduler (line 153) | def get_optimizer_scheduler(net, cfg):
FILE: artrackv2_mindspore/lib/train/data/bounding_box_utils.py
function batch_center2corner (line 4) | def batch_center2corner(boxes):
function batch_corner2center (line 15) | def batch_corner2center(boxes):
function batch_xywh2center (line 26) | def batch_xywh2center(boxes):
function batch_xywh2center2 (line 37) | def batch_xywh2center2(boxes):
function batch_xywh2corner (line 49) | def batch_xywh2corner(boxes):
function rect_to_rel (line 60) | def rect_to_rel(bb, sz_norm=None):
function rel_to_rect (line 77) | def rel_to_rect(bb, sz_norm=None):
function masks_to_bboxes (line 89) | def masks_to_bboxes(mask, fmt='c'):
function masks_to_bboxes_multi (line 126) | def masks_to_bboxes_multi(mask, ids, fmt='c'):
FILE: artrackv2_mindspore/lib/train/data/image_loader.py
function default_image_loader (line 15) | def default_image_loader(path):
function jpeg4py_loader (line 34) | def jpeg4py_loader(path):
function opencv_loader (line 44) | def opencv_loader(path):
function jpeg4py_loader_w_failsafe (line 57) | def jpeg4py_loader_w_failsafe(path):
function opencv_seg_loader (line 73) | def opencv_seg_loader(path):
function imread_indexed (line 83) | def imread_indexed(filename):
function imwrite_indexed (line 92) | def imwrite_indexed(filename, array, color_palette=None):
FILE: artrackv2_mindspore/lib/train/data/loader.py
function _check_use_shared_memory (line 19) | def _check_use_shared_memory():
function ltr_collate (line 28) | def ltr_collate(batch):
function ltr_collate_stack1 (line 79) | def ltr_collate_stack1(batch):
class LTRLoader (line 130) | class LTRLoader(torch.utils.data.dataloader.DataLoader):
method __init__ (line 182) | def __init__(self, name, dataset, training=True, batch_size=1, shuffle...
FILE: artrackv2_mindspore/lib/train/data/processing.py
function stack_tensors (line 8) | def stack_tensors(x):
class BaseProcessing (line 14) | class BaseProcessing:
method __init__ (line 18) | def __init__(self, transform=transforms.ToTensor(), template_transform...
method __call__ (line 34) | def __call__(self, data: TensorDict):
class STARKProcessing (line 38) | class STARKProcessing(BaseProcessing):
method __init__ (line 48) | def __init__(self, search_area_factor, output_sz, center_jitter_factor...
method _get_jittered_box (line 69) | def _get_jittered_box(self, box, mode):
method __call__ (line 85) | def __call__(self, data: TensorDict):
FILE: artrackv2_mindspore/lib/train/data/processing_utils.py
function sample_target (line 12) | def sample_target(im, target_bb, search_area_factor, output_sz=None, mas...
function transform_image_to_crop (line 82) | def transform_image_to_crop(box_in: ms.Tensor, box_extract: ms.Tensor, r...
function jittered_center_crop (line 108) | def jittered_center_crop(frames, box_extract, box_gt, search_area_factor...
function transform_box_to_crop (line 146) | def transform_box_to_crop(box: ms.Tensor, crop_box: ms.Tensor, crop_sz: ...
FILE: artrackv2_mindspore/lib/train/data/sampler.py
function no_processing (line 7) | def no_processing(data):
class TrackingSampler (line 11) | class TrackingSampler(torch.utils.data.Dataset):
method __init__ (line 23) | def __init__(self, datasets, p_datasets, samples_per_epoch, max_gap,
method __len__ (line 57) | def __len__(self):
method _sample_visible_ids (line 60) | def _sample_visible_ids(self, visible, num_ids=1, min_id=None, max_id=...
method __getitem__ (line 94) | def __getitem__(self, index):
method getitem (line 100) | def getitem(self):
method getitem_cls (line 174) | def getitem_cls(self):
method get_center_box (line 258) | def get_center_box(self, H, W, ratio=1/8):
method sample_seq_from_dataset (line 262) | def sample_seq_from_dataset(self, dataset, is_video_dataset):
method get_one_search (line 280) | def get_one_search(self):
method get_frame_ids_trident (line 300) | def get_frame_ids_trident(self, visible):
method get_frame_ids_stark (line 327) | def get_frame_ids_stark(self, visible, valid):
FILE: artrackv2_mindspore/lib/train/data/sequence_sampler.py
class SequenceSampler (line 7) | class SequenceSampler(torch.utils.data.Dataset):
method __init__ (line 12) | def __init__(self, datasets, p_datasets, samples_per_epoch, max_gap,
method __len__ (line 47) | def __len__(self):
method _sample_visible_ids (line 50) | def _sample_visible_ids(self, visible, num_ids=1, min_id=None, max_id=...
method _sequential_sample (line 78) | def _sequential_sample(self, visible):
method _random_interval_sample (line 111) | def _random_interval_sample(self, visible):
method __getitem__ (line 191) | def __getitem__(self, index):
FILE: artrackv2_mindspore/lib/train/data/transforms.py
class Transform (line 10) | class Transform:
method __init__ (line 35) | def __init__(self, *transforms):
method __call__ (line 43) | def __call__(self, **inputs):
method _split_inputs (line 65) | def _split_inputs(self, inputs):
method __repr__ (line 77) | def __repr__(self):
class TransformBase (line 86) | class TransformBase:
method __init__ (line 88) | def __init__(self):
method __call__ (line 95) | def __call__(self, **inputs):
method _get_image_size (line 123) | def _get_image_size(self, inputs):
method roll (line 139) | def roll(self):
method transform_image (line 142) | def transform_image(self, image, *rand_params):
method transform_coords (line 146) | def transform_coords(self, coords, image_shape, *rand_params):
method transform_bbox (line 150) | def transform_bbox(self, bbox, image_shape, *rand_params):
method transform_mask (line 172) | def transform_mask(self, mask, *rand_params):
method transform_att (line 176) | def transform_att(self, att, *rand_params):
class ToTensor (line 181) | class ToTensor(TransformBase):
method transform_image (line 184) | def transform_image(self, image):
method transfrom_mask (line 196) | def transfrom_mask(self, mask):
method transform_att (line 200) | def transform_att(self, att):
class ToTensorAndJitter (line 209) | class ToTensorAndJitter(TransformBase):
method __init__ (line 211) | def __init__(self, brightness_jitter=0.0, normalize=True):
method roll (line 216) | def roll(self):
method transform_image (line 219) | def transform_image(self, image, brightness_factor):
method transform_mask (line 229) | def transform_mask(self, mask, brightness_factor):
method transform_att (line 234) | def transform_att(self, att, brightness_factor):
class Normalize (line 243) | class Normalize(TransformBase):
method __init__ (line 245) | def __init__(self, mean, std, inplace=False):
method transform_image (line 251) | def transform_image(self, image):
class ToGrayscale (line 255) | class ToGrayscale(TransformBase):
method __init__ (line 257) | def __init__(self, probability = 0.5):
method roll (line 262) | def roll(self):
method transform_image (line 265) | def transform_image(self, image, do_grayscale):
class ToBGR (line 275) | class ToBGR(TransformBase):
method transform_image (line 277) | def transform_image(self, image):
class RandomHorizontalFlip (line 284) | class RandomHorizontalFlip(TransformBase):
method __init__ (line 286) | def __init__(self, probability = 0.5):
method roll (line 290) | def roll(self):
method transform_image (line 293) | def transform_image(self, image, do_flip):
method transform_coords (line 300) | def transform_coords(self, coords, image_shape, do_flip):
method transform_mask (line 307) | def transform_mask(self, mask, do_flip):
method transform_att (line 314) | def transform_att(self, att, do_flip):
class RandomHorizontalFlip_Norm (line 322) | class RandomHorizontalFlip_Norm(RandomHorizontalFlip):
method __init__ (line 325) | def __init__(self, probability = 0.5):
method transform_coords (line 329) | def transform_coords(self, coords, image_shape, do_flip):
FILE: artrackv2_mindspore/lib/train/data/wandb_logger.py
class WandbWriter (line 10) | class WandbWriter:
method __init__ (line 11) | def __init__(self, exp_name, cfg, output_dir, cur_step=0, step_interva...
method write_log (line 17) | def write_log(self, stats: OrderedDict, epoch=-1):
FILE: artrackv2_mindspore/lib/train/dataset/COCO_tool.py
function _isArrayLike (line 66) | def _isArrayLike(obj):
class COCO (line 70) | class COCO:
method __init__ (line 71) | def __init__(self, dataset):
method createIndex (line 85) | def createIndex(self):
method info (line 116) | def info(self):
method getAnnIds (line 124) | def getAnnIds(self, imgIds=[], catIds=[], areaRng=[], iscrowd=None):
method getCatIds (line 152) | def getCatIds(self, catNms=[], supNms=[], catIds=[]):
method getImgIds (line 174) | def getImgIds(self, imgIds=[], catIds=[]):
method loadAnns (line 195) | def loadAnns(self, ids=[]):
method loadCats (line 206) | def loadCats(self, ids=[]):
method loadImgs (line 217) | def loadImgs(self, ids=[]):
method showAnns (line 228) | def showAnns(self, anns, draw_bbox=False):
method loadRes (line 300) | def loadRes(self, resFile):
method download (line 362) | def download(self, tarDir = None, imgIds = [] ):
method loadNumpyAnnotations (line 386) | def loadNumpyAnnotations(self, data):
method annToRLE (line 409) | def annToRLE(self, ann):
method annToMask (line 430) | def annToMask(self, ann):
FILE: artrackv2_mindspore/lib/train/dataset/base_image_dataset.py
class BaseImageDataset (line 5) | class BaseImageDataset(torch.utils.data.Dataset):
method __init__ (line 8) | def __init__(self, name, root, image_loader=jpeg4py_loader):
method __len__ (line 22) | def __len__(self):
method __getitem__ (line 29) | def __getitem__(self, index):
method get_name (line 34) | def get_name(self):
method get_num_images (line 42) | def get_num_images(self):
method has_class_info (line 49) | def has_class_info(self):
method get_class_name (line 52) | def get_class_name(self, image_id):
method get_num_classes (line 55) | def get_num_classes(self):
method get_class_list (line 58) | def get_class_list(self):
method get_images_in_class (line 61) | def get_images_in_class(self, class_name):
method has_segmentation_info (line 64) | def has_segmentation_info(self):
method get_image_info (line 67) | def get_image_info(self, seq_id):
method get_image (line 78) | def get_image(self, image_id, anno=None):
FILE: artrackv2_mindspore/lib/train/dataset/base_video_dataset.py
class BaseVideoDataset (line 6) | class BaseVideoDataset(torch.utils.data.Dataset):
method __init__ (line 9) | def __init__(self, name, root, image_loader=jpeg4py_loader_w_failsafe):
method __len__ (line 23) | def __len__(self):
method __getitem__ (line 30) | def __getitem__(self, index):
method is_video_sequence (line 35) | def is_video_sequence(self):
method is_synthetic_video_dataset (line 43) | def is_synthetic_video_dataset(self):
method get_name (line 51) | def get_name(self):
method get_num_sequences (line 59) | def get_num_sequences(self):
method has_class_info (line 66) | def has_class_info(self):
method has_occlusion_info (line 69) | def has_occlusion_info(self):
method get_num_classes (line 72) | def get_num_classes(self):
method get_class_list (line 75) | def get_class_list(self):
method get_sequences_in_class (line 78) | def get_sequences_in_class(self, class_name):
method has_segmentation_info (line 81) | def has_segmentation_info(self):
method get_sequence_info (line 84) | def get_sequence_info(self, seq_id):
method get_frames (line 95) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/lib/train/dataset/coco.py
class MSCOCO (line 11) | class MSCOCO(BaseImageDataset):
method __init__ (line 34) | def __init__(self, root=None, image_loader=jpeg4py_loader, data_fracti...
method _get_image_list (line 65) | def _get_image_list(self, min_area=None):
method get_num_classes (line 74) | def get_num_classes(self):
method get_name (line 77) | def get_name(self):
method has_class_info (line 80) | def has_class_info(self):
method has_segmentation_info (line 83) | def has_segmentation_info(self):
method get_class_list (line 86) | def get_class_list(self):
method _build_im_per_class (line 92) | def _build_im_per_class(self):
method get_images_in_class (line 103) | def get_images_in_class(self, class_name):
method get_image_info (line 106) | def get_image_info(self, im_id):
method _get_anno (line 118) | def _get_anno(self, im_id):
method _get_image (line 123) | def _get_image(self, im_id):
method get_meta_info (line 128) | def get_meta_info(self, im_id):
method get_class_name (line 144) | def get_class_name(self, im_id):
method get_image (line 148) | def get_image(self, image_id, anno=None):
FILE: artrackv2_mindspore/lib/train/dataset/coco_seq.py
class MSCOCOSeq (line 11) | class MSCOCOSeq(BaseVideoDataset):
method __init__ (line 34) | def __init__(self, root=None, image_loader=jpeg4py_loader, data_fracti...
method _get_sequence_list (line 65) | def _get_sequence_list(self):
method is_video_sequence (line 71) | def is_video_sequence(self):
method get_num_classes (line 74) | def get_num_classes(self):
method get_name (line 77) | def get_name(self):
method has_class_info (line 80) | def has_class_info(self):
method get_class_list (line 83) | def get_class_list(self):
method has_segmentation_info (line 89) | def has_segmentation_info(self):
method get_num_sequences (line 92) | def get_num_sequences(self):
method _build_seq_per_class (line 95) | def _build_seq_per_class(self):
method get_sequences_in_class (line 106) | def get_sequences_in_class(self, class_name):
method get_sequence_info (line 109) | def get_sequence_info(self, seq_id):
method _get_anno (line 123) | def _get_anno(self, seq_id):
method _get_frames (line 128) | def _get_frames(self, seq_id):
method get_meta_info (line 133) | def get_meta_info(self, seq_id):
method get_class_name (line 150) | def get_class_name(self, seq_id):
method get_frames (line 154) | def get_frames(self, seq_id=None, frame_ids=None, anno=None):
FILE: artrackv2_mindspore/lib/train/dataset/coco_seq_lmdb.py
class MSCOCOSeq_lmdb (line 12) | class MSCOCOSeq_lmdb(BaseVideoDataset):
method __init__ (line 35) | def __init__(self, root=None, image_loader=jpeg4py_loader, data_fracti...
method _get_sequence_list (line 71) | def _get_sequence_list(self):
method is_video_sequence (line 77) | def is_video_sequence(self):
method get_num_classes (line 80) | def get_num_classes(self):
method get_name (line 83) | def get_name(self):
method has_class_info (line 86) | def has_class_info(self):
method get_class_list (line 89) | def get_class_list(self):
method has_segmentation_info (line 95) | def has_segmentation_info(self):
method get_num_sequences (line 98) | def get_num_sequences(self):
method _build_seq_per_class (line 101) | def _build_seq_per_class(self):
method get_sequences_in_class (line 112) | def get_sequences_in_class(self, class_name):
method get_sequence_info (line 115) | def get_sequence_info(self, seq_id):
method _get_anno (line 129) | def _get_anno(self, seq_id):
method _get_frames (line 134) | def _get_frames(self, seq_id):
method get_meta_info (line 140) | def get_meta_info(self, seq_id):
method get_class_name (line 157) | def get_class_name(self, seq_id):
method get_frames (line 161) | def get_frames(self, seq_id=None, frame_ids=None, anno=None):
FILE: artrackv2_mindspore/lib/train/dataset/got10k.py
class Got10k (line 14) | class Got10k(BaseVideoDataset):
method __init__ (line 26) | def __init__(self, root=None, image_loader=jpeg4py_loader, split=None,...
method get_name (line 78) | def get_name(self):
method has_class_info (line 81) | def has_class_info(self):
method has_occlusion_info (line 84) | def has_occlusion_info(self):
method _load_meta_info (line 87) | def _load_meta_info(self):
method _read_meta (line 91) | def _read_meta(self, seq_path):
method _build_seq_per_class (line 108) | def _build_seq_per_class(self):
method get_sequences_in_class (line 120) | def get_sequences_in_class(self, class_name):
method _get_sequence_list (line 123) | def _get_sequence_list(self):
method _read_bb_anno (line 129) | def _read_bb_anno(self, seq_path):
method _read_target_visible (line 134) | def _read_target_visible(self, seq_path):
method _get_sequence_path (line 149) | def _get_sequence_path(self, seq_id):
method get_sequence_info (line 152) | def get_sequence_info(self, seq_id):
method _get_frame_path (line 162) | def _get_frame_path(self, seq_path, frame_id):
method _get_frame (line 165) | def _get_frame(self, seq_path, frame_id):
method get_class_name (line 168) | def get_class_name(self, seq_id):
method get_frames (line 173) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/lib/train/dataset/got10k_lmdb.py
class Got10k_lmdb (line 17) | class Got10k_lmdb(BaseVideoDataset):
method __init__ (line 19) | def __init__(self, root=None, image_loader=jpeg4py_loader, split=None,...
method get_name (line 71) | def get_name(self):
method has_class_info (line 74) | def has_class_info(self):
method has_occlusion_info (line 77) | def has_occlusion_info(self):
method _load_meta_info (line 80) | def _load_meta_info(self):
method _build_seq_per_class (line 103) | def _build_seq_per_class(self):
method get_sequences_in_class (line 115) | def get_sequences_in_class(self, class_name):
method _get_sequence_list (line 118) | def _get_sequence_list(self):
method _read_bb_anno (line 123) | def _read_bb_anno(self, seq_path):
method _read_target_visible (line 131) | def _read_target_visible(self, seq_path):
method _get_sequence_path (line 146) | def _get_sequence_path(self, seq_id):
method get_sequence_info (line 149) | def get_sequence_info(self, seq_id):
method _get_frame_path (line 159) | def _get_frame_path(self, seq_path, frame_id):
method _get_frame (line 162) | def _get_frame(self, seq_path, frame_id):
method get_class_name (line 165) | def get_class_name(self, seq_id):
method get_frames (line 170) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/lib/train/dataset/imagenetvid.py
function get_target_to_image_ratio (line 11) | def get_target_to_image_ratio(seq):
class ImagenetVID (line 17) | class ImagenetVID(BaseVideoDataset):
method __init__ (line 29) | def __init__(self, root=None, image_loader=jpeg4py_loader, min_length=...
method get_name (line 61) | def get_name(self):
method get_num_sequences (line 64) | def get_num_sequences(self):
method get_sequence_info (line 67) | def get_sequence_info(self, seq_id):
method _get_frame (line 73) | def _get_frame(self, sequence, frame_id):
method get_frames (line 81) | def get_frames(self, seq_id, frame_ids, anno=None):
method _process_anno (line 103) | def _process_anno(self, root):
FILE: artrackv2_mindspore/lib/train/dataset/imagenetvid_lmdb.py
function get_target_to_image_ratio (line 10) | def get_target_to_image_ratio(seq):
class ImagenetVID_lmdb (line 16) | class ImagenetVID_lmdb(BaseVideoDataset):
method __init__ (line 28) | def __init__(self, root=None, image_loader=jpeg4py_loader, min_length=...
method get_name (line 49) | def get_name(self):
method get_num_sequences (line 52) | def get_num_sequences(self):
method get_sequence_info (line 55) | def get_sequence_info(self, seq_id):
method _get_frame (line 61) | def _get_frame(self, sequence, frame_id):
method get_frames (line 69) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/lib/train/dataset/lasot.py
class Lasot (line 14) | class Lasot(BaseVideoDataset):
method __init__ (line 26) | def __init__(self, root=None, image_loader=jpeg4py_loader, vid_ids=Non...
method _build_sequence_list (line 52) | def _build_sequence_list(self, vid_ids=None, split=None):
method _build_class_list (line 70) | def _build_class_list(self):
method get_name (line 81) | def get_name(self):
method has_class_info (line 84) | def has_class_info(self):
method has_occlusion_info (line 87) | def has_occlusion_info(self):
method get_num_sequences (line 90) | def get_num_sequences(self):
method get_num_classes (line 93) | def get_num_classes(self):
method get_sequences_in_class (line 96) | def get_sequences_in_class(self, class_name):
method _read_bb_anno (line 99) | def _read_bb_anno(self, seq_path):
method _read_target_visible (line 104) | def _read_target_visible(self, seq_path):
method _get_sequence_path (line 118) | def _get_sequence_path(self, seq_id):
method get_sequence_info (line 125) | def get_sequence_info(self, seq_id):
method _get_frame_path (line 134) | def _get_frame_path(self, seq_path, frame_id):
method _get_frame (line 137) | def _get_frame(self, seq_path, frame_id):
method _get_class (line 140) | def _get_class(self, seq_path):
method get_class_name (line 144) | def get_class_name(self, seq_id):
method get_frames (line 150) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/lib/train/dataset/lasot_lmdb.py
class Lasot_lmdb (line 16) | class Lasot_lmdb(BaseVideoDataset):
method __init__ (line 18) | def __init__(self, root=None, image_loader=jpeg4py_loader, vid_ids=Non...
method _build_sequence_list (line 47) | def _build_sequence_list(self, vid_ids=None, split=None):
method _build_class_list (line 64) | def _build_class_list(self):
method get_name (line 75) | def get_name(self):
method has_class_info (line 78) | def has_class_info(self):
method has_occlusion_info (line 81) | def has_occlusion_info(self):
method get_num_sequences (line 84) | def get_num_sequences(self):
method get_num_classes (line 87) | def get_num_classes(self):
method get_sequences_in_class (line 90) | def get_sequences_in_class(self, class_name):
method _read_bb_anno (line 93) | def _read_bb_anno(self, seq_path):
method _read_target_visible (line 100) | def _read_target_visible(self, seq_path):
method _get_sequence_path (line 114) | def _get_sequence_path(self, seq_id):
method get_sequence_info (line 121) | def get_sequence_info(self, seq_id):
method _get_frame_path (line 130) | def _get_frame_path(self, seq_path, frame_id):
method _get_frame (line 133) | def _get_frame(self, seq_path, frame_id):
method _get_class (line 136) | def _get_class(self, seq_path):
method get_class_name (line 140) | def get_class_name(self, seq_id):
method get_frames (line 146) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/lib/train/dataset/tracking_net.py
function list_sequences (line 14) | def list_sequences(root, set_ids):
class TrackingNet (line 35) | class TrackingNet(BaseVideoDataset):
method __init__ (line 46) | def __init__(self, root=None, image_loader=jpeg4py_loader, set_ids=Non...
method _load_class_info (line 77) | def _load_class_info(self):
method get_name (line 94) | def get_name(self):
method has_class_info (line 97) | def has_class_info(self):
method get_sequences_in_class (line 100) | def get_sequences_in_class(self, class_name):
method _read_bb_anno (line 103) | def _read_bb_anno(self, seq_id):
method get_sequence_info (line 111) | def get_sequence_info(self, seq_id):
method _get_frame (line 118) | def _get_frame(self, seq_id, frame_id):
method _get_class (line 124) | def _get_class(self, seq_id):
method get_class_name (line 128) | def get_class_name(self, seq_id):
method get_frames (line 133) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/lib/train/dataset/tracking_net_lmdb.py
function list_sequences (line 15) | def list_sequences(root):
class TrackingNet_lmdb (line 30) | class TrackingNet_lmdb(BaseVideoDataset):
method __init__ (line 41) | def __init__(self, root=None, image_loader=jpeg4py_loader, set_ids=Non...
method _load_class_info (line 72) | def _load_class_info(self):
method get_name (line 89) | def get_name(self):
method has_class_info (line 92) | def has_class_info(self):
method get_sequences_in_class (line 95) | def get_sequences_in_class(self, class_name):
method _read_bb_anno (line 98) | def _read_bb_anno(self, seq_id):
method get_sequence_info (line 107) | def get_sequence_info(self, seq_id):
method _get_frame (line 114) | def _get_frame(self, seq_id, frame_id):
method _get_class (line 120) | def _get_class(self, seq_id):
method get_class_name (line 124) | def get_class_name(self, seq_id):
method get_frames (line 129) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: artrackv2_mindspore/lib/train/run_training.py
function init_seeds (line 17) | def init_seeds(seed):
function run_training (line 29) | def run_training(script_name, config_name, cudnn_benchmark=True, local_r...
function main (line 82) | def main():
FILE: artrackv2_mindspore/lib/train/train_script.py
function names2datasets (line 26) | def names2datasets(name_list: list, settings, image_loader):
function slt_collate (line 83) | def slt_collate(batch):
class SLTLoader (line 93) | class SLTLoader(torch.utils.data.dataloader.DataLoader):
method __init__ (line 101) | def __init__(self, name, dataset, training=True, batch_size=1, shuffle...
function run (line 117) | def run(settings):
FILE: artrackv2_mindspore/lib/train/train_script_distill.py
function build_network (line 21) | def build_network(script_name, cfg):
function run (line 34) | def run(settings):
FILE: artrackv2_mindspore/lib/train/trainers/base_trainer.py
class BaseTrainer (line 9) | class BaseTrainer:
method __init__ (line 13) | def __init__(self, actor, loaders, optimizer, settings, lr_scheduler=N...
method update_settings (line 40) | def update_settings(self, settings=None):
method train (line 62) | def train(self, max_epochs, load_latest=False, fail_safe=True, load_pr...
method train_epoch (line 113) | def train_epoch(self):
method save_checkpoint (line 116) | def save_checkpoint(self):
method load_checkpoint (line 150) | def load_checkpoint(self, checkpoint = None, fields = None, ignore_fie...
method load_state_dict (line 232) | def load_state_dict(self, checkpoint=None, distill=False):
FILE: artrackv2_mindspore/lib/train/trainers/ltr_trainer.py
class LTRTrainer (line 20) | class LTRTrainer(BaseTrainer):
method __init__ (line 21) | def __init__(self, actor, loaders, optimizer, settings, lr_scheduler=N...
method _set_default_settings (line 59) | def _set_default_settings(self):
method cycle_dataset (line 70) | def cycle_dataset(self, loader):
method train_epoch (line 224) | def train_epoch(self):
method _init_timing (line 237) | def _init_timing(self):
method _update_stats (line 245) | def _update_stats(self, new_stats: OrderedDict, batch_size, loader):
method _print_stats (line 264) | def _print_stats(self, i, loader, batch_size):
method _stats_new_epoch (line 300) | def _stats_new_epoch(self):
FILE: artrackv2_mindspore/lib/utils/box_ops.py
function box_xywh_to_cxywh (line 4) | def box_xywh_to_cxywh(x):
function box_cxcywh_to_xyxy (line 9) | def box_cxcywh_to_xyxy(x):
function box_xywh_to_xyxy (line 16) | def box_xywh_to_xyxy(x):
function box_xyxy_to_xywh (line 22) | def box_xyxy_to_xywh(x):
function box_xyxy_to_cxcywh (line 28) | def box_xyxy_to_cxcywh(x):
function box_iou (line 39) | def box_iou(boxes1, boxes2):
function generalized_box_iou (line 64) | def generalized_box_iou(boxes1, boxes2):
function giou_loss (line 89) | def giou_loss(boxes1, boxes2):
function clip_box (line 100) | def clip_box(box: list, H, W, margin=0):
FILE: artrackv2_mindspore/lib/utils/ce_utils.py
function generate_bbox_mask (line 1) | def generate_bbox_mask(bbox_mask, bbox):
function generate_mask_cond (line 9) | def generate_mask_cond(cfg, bs, device, gt_bbox):
function adjust_keep_rate (line 62) | def adjust_keep_rate(epoch, warmup_epochs, total_epochs, ITERS_PER_EPOCH...
FILE: artrackv2_mindspore/lib/utils/focal_loss.py
class FocalLoss (line 8) | class FocalLoss(nn.Module, ABC):
method __init__ (line 9) | def __init__(self, alpha=2, beta=4):
method forward (line 14) | def forward(self, prediction, target):
class LBHinge (line 38) | class LBHinge(nn.Module):
method __init__ (line 47) | def __init__(self, error_metric=nn.MSELoss(), threshold=None, clip=None):
method forward (line 53) | def forward(self, prediction, label, target_bb=None):
FILE: artrackv2_mindspore/lib/utils/heapmap_utils.py
function generate_heatmap (line 5) | def generate_heatmap(bboxes, patch_size=320, stride=16):
class CenterNetHeatMap (line 29) | class CenterNetHeatMap(object):
method generate_score_map (line 31) | def generate_score_map(fmap, gt_class, gt_wh, centers_int, min_overlap):
method get_gaussian_radius (line 40) | def get_gaussian_radius(box_size, min_overlap):
method gaussian2D (line 71) | def gaussian2D(radius, sigma=1):
method draw_gaussian (line 81) | def draw_gaussian(fmap, center, radius, k=1):
function compute_grids (line 99) | def compute_grids(features, strides):
function get_center3x3 (line 123) | def get_center3x3(locations, centers, strides, range=3):
function get_pred (line 143) | def get_pred(score_map_ctr, size_map, offset_map, feat_size):
FILE: artrackv2_mindspore/lib/utils/lmdb_utils.py
function get_lmdb_handle (line 11) | def get_lmdb_handle(name):
function decode_img (line 23) | def decode_img(lmdb_fname, key_name):
function decode_str (line 33) | def decode_str(lmdb_fname, key_name):
function decode_json (line 40) | def decode_json(lmdb_fname, key_name):
FILE: artrackv2_mindspore/lib/utils/merge.py
function merge_template_search (line 4) | def merge_template_search(inp_list, return_search=False, return_template...
function get_qkv (line 18) | def get_qkv(inp_list):
FILE: artrackv2_mindspore/lib/utils/misc.py
class SmoothedValue (line 27) | class SmoothedValue(object):
method __init__ (line 32) | def __init__(self, window_size=20, fmt=None):
method update (line 40) | def update(self, value, n=1):
method synchronize_between_processes (line 45) | def synchronize_between_processes(self):
method median (line 59) | def median(self):
method avg (line 64) | def avg(self):
method global_avg (line 69) | def global_avg(self):
method max (line 73) | def max(self):
method value (line 77) | def value(self):
method __str__ (line 80) | def __str__(self):
function all_gather (line 89) | def all_gather(data):
function reduce_dict (line 132) | def reduce_dict(input_dict, average=True):
class MetricLogger (line 159) | class MetricLogger(object):
method __init__ (line 160) | def __init__(self, delimiter="\t"):
method update (line 164) | def update(self, **kwargs):
method __getattr__ (line 171) | def __getattr__(self, attr):
method __str__ (line 179) | def __str__(self):
method synchronize_between_processes (line 187) | def synchronize_between_processes(self):
method add_meter (line 191) | def add_meter(self, name, meter):
method log_every (line 194) | def log_every(self, iterable, print_freq, header=None):
function get_sha (line 249) | def get_sha():
function collate_fn (line 269) | def collate_fn(batch):
function _max_by_axis (line 275) | def _max_by_axis(the_list):
class NestedTensor (line 284) | class NestedTensor(object):
method __init__ (line 285) | def __init__(self, tensors, mask: Optional[Tensor]):
method to (line 289) | def to(self, device):
method decompose (line 300) | def decompose(self):
method __repr__ (line 303) | def __repr__(self):
function nested_tensor_from_tensor_list (line 307) | def nested_tensor_from_tensor_list(tensor_list: List[Tensor]):
function _onnx_nested_tensor_from_tensor_list (line 335) | def _onnx_nested_tensor_from_tensor_list(tensor_list: List[Tensor]) -> N...
function setup_for_distributed (line 363) | def setup_for_distributed(is_master):
function is_dist_avail_and_initialized (line 378) | def is_dist_avail_and_initialized():
function get_world_size (line 386) | def get_world_size():
function get_rank (line 392) | def get_rank():
function is_main_process (line 398) | def is_main_process():
function save_on_master (line 402) | def save_on_master(*args, **kwargs):
function init_distributed_mode (line 407) | def init_distributed_mode(args):
function accuracy (line 433) | def accuracy(output, target, topk=(1,)):
function interpolate (line 451) | def interpolate(input, size=None, scale_factor=None, mode="nearest", ali...
FILE: artrackv2_mindspore/lib/utils/tensor.py
class TensorDict (line 7) | class TensorDict(OrderedDict):
method concat (line 10) | def concat(self, other):
method copy (line 14) | def copy(self):
method __deepcopy__ (line 17) | def __deepcopy__(self, memodict={}):
method __getattr__ (line 20) | def __getattr__(self, name):
method attribute (line 28) | def attribute(self, attr: str, *args):
method apply (line 31) | def apply(self, fn, *args, **kwargs):
method _iterable (line 35) | def _iterable(a):
class TensorList (line 39) | class TensorList(list):
method __init__ (line 42) | def __init__(self, list_of_tensors = None):
method __deepcopy__ (line 47) | def __deepcopy__(self, memodict={}):
method __getitem__ (line 50) | def __getitem__(self, item):
method __add__ (line 58) | def __add__(self, other):
method __radd__ (line 63) | def __radd__(self, other):
method __iadd__ (line 68) | def __iadd__(self, other):
method __sub__ (line 77) | def __sub__(self, other):
method __rsub__ (line 82) | def __rsub__(self, other):
method __isub__ (line 87) | def __isub__(self, other):
method __mul__ (line 96) | def __mul__(self, other):
method __rmul__ (line 101) | def __rmul__(self, other):
method __imul__ (line 106) | def __imul__(self, other):
method __truediv__ (line 115) | def __truediv__(self, other):
method __rtruediv__ (line 120) | def __rtruediv__(self, other):
method __itruediv__ (line 125) | def __itruediv__(self, other):
method __matmul__ (line 134) | def __matmul__(self, other):
method __rmatmul__ (line 139) | def __rmatmul__(self, other):
method __imatmul__ (line 144) | def __imatmul__(self, other):
method __mod__ (line 153) | def __mod__(self, other):
method __rmod__ (line 158) | def __rmod__(self, other):
method __pos__ (line 163) | def __pos__(self):
method __neg__ (line 166) | def __neg__(self):
method __le__ (line 169) | def __le__(self, other):
method __ge__ (line 174) | def __ge__(self, other):
method concat (line 179) | def concat(self, other):
method copy (line 182) | def copy(self):
method unroll (line 185) | def unroll(self):
method list (line 197) | def list(self):
method attribute (line 200) | def attribute(self, attr: str, *args):
method apply (line 203) | def apply(self, fn):
method __getattr__ (line 206) | def __getattr__(self, name):
method _iterable (line 216) | def _iterable(a):
function tensor_operation (line 220) | def tensor_operation(op):
FILE: artrackv2_mindspore/lib/utils/variable_hook.py
class get_local (line 5) | class get_local(object):
method __init__ (line 9) | def __init__(self, varname):
method __call__ (line 12) | def __call__(self, func):
method clear (line 44) | def clear(cls):
method activate (line 49) | def activate(cls):
FILE: artrackv2_mindspore/lib/vis/plotting.py
function draw_figure (line 7) | def draw_figure(fig):
function show_tensor (line 13) | def show_tensor(a: torch.Tensor, fig_num = None, title = None, range=(No...
function plot_graph (line 43) | def plot_graph(a: torch.Tensor, fig_num = None, title = None):
function show_image_with_boxes (line 61) | def show_image_with_boxes(im, boxes, iou_pred=None, disp_ids=None):
function _pascal_color_map (line 86) | def _pascal_color_map(N=256, normalized=False):
function overlay_mask (line 113) | def overlay_mask(im, ann, alpha=0.5, colors=None, contour_thickness=None):
FILE: artrackv2_mindspore/lib/vis/utils.py
function numpy_to_torch (line 5) | def numpy_to_torch(a: np.ndarray):
FILE: artrackv2_mindspore/tracking/_init_paths.py
function add_path (line 9) | def add_path(path):
FILE: artrackv2_mindspore/tracking/analysis_results_ITP.py
function parse_args (line 7) | def parse_args():
FILE: artrackv2_mindspore/tracking/create_default_local_file.py
function parse_args (line 8) | def parse_args():
FILE: artrackv2_mindspore/tracking/download_pytracking_results.py
function _download_file (line 52) | def _download_file(file_id, path):
function download_results (line 57) | def download_results(download_path, trackers='pytracking'):
function unpack_tracking_results (line 117) | def unpack_tracking_results(download_path, output_path=None):
function main (line 155) | def main():
FILE: artrackv2_mindspore/tracking/pre_read_datasets.py
function parse_args (line 10) | def parse_args():
function get_trknet_dict (line 22) | def get_trknet_dict(trknet_dir):
function target (line 34) | def target(lmdb_dir, key_name):
FILE: artrackv2_mindspore/tracking/profile_model.py
function parse_args (line 17) | def parse_args():
function evaluate_vit (line 31) | def evaluate_vit(model, template, search, seq_input, stage):
function evaluate_vit_separate (line 65) | def evaluate_vit_separate(model, template, search):
function get_data (line 86) | def get_data(bs, sz):
FILE: artrackv2_mindspore/tracking/test.py
function run_tracker (line 17) | def run_tracker(tracker_name, tracker_param, run_id=None, dataset_name='...
function main (line 39) | def main():
FILE: artrackv2_mindspore/tracking/test_exp.py
function run_tracker (line 14) | def run_tracker(tracker_name, tracker_param, run_id=None, dataset_name='...
function main (line 37) | def main():
FILE: artrackv2_mindspore/tracking/train.py
function parse_args (line 7) | def parse_args():
function main (line 39) | def main():
FILE: artrackv2_mindspore/tracking/video_demo.py
function run_video (line 12) | def run_video(tracker_name, tracker_param, videofile, optional_box=None,...
function main (line 23) | def main():
FILE: artrackv2_mindspore/tracking/vis_results.py
class VisResults (line 20) | class VisResults(object):
method __init__ (line 21) | def __init__(self):
method vis_dataset (line 24) | def vis_dataset(self, dataset, trackers, skip_missing_seq=False, seq_l...
method update_boxes (line 79) | def update_boxes(self, data, caption):
method update_seg_result (line 83) | def update_seg_result(self, frame_img, frame_path):
method _init_visdom (line 97) | def _init_visdom(self, visdom_info=None):
method _visdom_ui_handler (line 118) | def _visdom_ui_handler(self, data):
FILE: external/AR/ltr/actors/base_actor.py
class BaseActor (line 4) | class BaseActor:
method __init__ (line 7) | def __init__(self, net, objective):
method __call__ (line 16) | def __call__(self, data: TensorDict):
method to (line 28) | def to(self, device):
method train (line 35) | def train(self, mode=True):
method eval (line 42) | def eval(self):
FILE: external/AR/ltr/actors/bbreg.py
class AtomActor (line 4) | class AtomActor(BaseActor):
method __call__ (line 6) | def __call__(self, data):
class AtomBBKLActor (line 32) | class AtomBBKLActor(BaseActor):
method __call__ (line 34) | def __call__(self, data):
FILE: external/AR/ltr/actors/tracking.py
class DiMPActor (line 5) | class DiMPActor(BaseActor):
method __init__ (line 7) | def __init__(self, net, objective, loss_weight=None):
method __call__ (line 13) | def __call__(self, data):
class KLDiMPActor (line 73) | class KLDiMPActor(BaseActor):
method __init__ (line 75) | def __init__(self, net, objective, loss_weight=None):
method __call__ (line 81) | def __call__(self, data):
FILE: external/AR/ltr/admin/environment.py
function create_default_local_file (line 6) | def create_default_local_file():
function env_settings (line 44) | def env_settings():
FILE: external/AR/ltr/admin/loading.py
function load_trained_network (line 10) | def load_trained_network(workspace_dir, network_path, checkpoint=None):
function load_pretrained (line 19) | def load_pretrained(module, name, checkpoint=None, **kwargs):
function load_network (line 34) | def load_network(network_dir=None, checkpoint=None, constructor_fun_name...
function load_weights (line 111) | def load_weights(net, path, strict=True):
function torch_load_legacy (line 118) | def torch_load_legacy(path):
function _setup_legacy_env (line 133) | def _setup_legacy_env():
function _cleanup_legacy_env (line 144) | def _cleanup_legacy_env():
FILE: external/AR/ltr/admin/model_constructor.py
function model_constructor (line 5) | def model_constructor(f):
class NetConstructor (line 24) | class NetConstructor:
method __init__ (line 28) | def __init__(self, fun_name, fun_module, args, kwds):
method get (line 41) | def get(self):
FILE: external/AR/ltr/admin/multigpu.py
function is_multi_gpu (line 4) | def is_multi_gpu(net):
class MultiGPU (line 8) | class MultiGPU(nn.DataParallel):
method __getattr__ (line 10) | def __getattr__(self, item):
FILE: external/AR/ltr/admin/settings.py
class Settings (line 4) | class Settings:
method __init__ (line 6) | def __init__(self):
method set_default (line 9) | def set_default(self):
FILE: external/AR/ltr/admin/stats.py
class StatValue (line 3) | class StatValue:
method __init__ (line 4) | def __init__(self):
method reset (line 7) | def reset(self):
method clear (line 10) | def clear(self):
method update (line 14) | def update(self, val):
class AverageMeter (line 19) | class AverageMeter(object):
method __init__ (line 21) | def __init__(self):
method reset (line 25) | def reset(self):
method clear (line 31) | def clear(self):
method update (line 35) | def update(self, val, n=1):
method new_epoch (line 41) | def new_epoch(self):
function topk_accuracy (line 50) | def topk_accuracy(output, target, topk=(1,)):
FILE: external/AR/ltr/admin/tensorboard.py
class TensorboardWriter (line 10) | class TensorboardWriter:
method __init__ (line 11) | def __init__(self, directory, loader_names):
method write_info (line 15) | def write_info(self, module_name, script_name, description):
method write_epoch (line 22) | def write_epoch(self, stats: OrderedDict, epoch: int, ind=-1):
FILE: external/AR/ltr/data/bounding_box_utils.py
function rect_to_rel (line 4) | def rect_to_rel(bb, sz_norm=None):
function rel_to_rect (line 21) | def rel_to_rect(bb, sz_norm=None):
function masks_to_bboxes (line 33) | def masks_to_bboxes(mask, fmt='c'):
function masks_to_bboxes_multi (line 70) | def masks_to_bboxes_multi(mask, ids, fmt='c'):
FILE: external/AR/ltr/data/image_loader.py
function default_image_loader (line 15) | def default_image_loader(path):
function jpeg4py_loader (line 34) | def jpeg4py_loader(path):
function opencv_loader (line 44) | def opencv_loader(path):
function jpeg4py_loader_w_failsafe (line 57) | def jpeg4py_loader_w_failsafe(path):
function opencv_seg_loader (line 73) | def opencv_seg_loader(path):
function imread_indexed (line 83) | def imread_indexed(filename):
function imwrite_indexed (line 92) | def imwrite_indexed(filename, array, color_palette=None):
FILE: external/AR/ltr/data/loader.py
function _check_use_shared_memory (line 9) | def _check_use_shared_memory():
function ltr_collate (line 18) | def ltr_collate(batch):
function ltr_collate_stack1 (line 69) | def ltr_collate_stack1(batch):
class LTRLoader (line 120) | class LTRLoader(torch.utils.data.dataloader.DataLoader):
method __init__ (line 172) | def __init__(self, name, dataset, training=True, batch_size=1, shuffle...
FILE: external/AR/ltr/data/processing.py
function stack_tensors (line 7) | def stack_tensors(x):
class BaseProcessing (line 13) | class BaseProcessing:
method __init__ (line 17) | def __init__(self, transform=transforms.ToTensor(), train_transform=No...
method __call__ (line 33) | def __call__(self, data: TensorDict):
class ATOMProcessing (line 37) | class ATOMProcessing(BaseProcessing):
method __init__ (line 47) | def __init__(self, search_area_factor, output_sz, center_jitter_factor...
method _get_jittered_box (line 69) | def _get_jittered_box(self, box, mode):
method _generate_proposals (line 85) | def _generate_proposals(self, box):
method __call__ (line 114) | def __call__(self, data: TensorDict):
class KLBBregProcessing (line 157) | class KLBBregProcessing(BaseProcessing):
method __init__ (line 162) | def __init__(self, search_area_factor, output_sz, center_jitter_factor...
method _get_jittered_box (line 184) | def _get_jittered_box(self, box, mode):
method _generate_proposals (line 200) | def _generate_proposals(self, box):
method __call__ (line 213) | def __call__(self, data: TensorDict):
class ATOMwKLProcessing (line 257) | class ATOMwKLProcessing(BaseProcessing):
method __init__ (line 259) | def __init__(self, search_area_factor, output_sz, center_jitter_factor...
method _get_jittered_box (line 269) | def _get_jittered_box(self, box, mode):
method _generate_proposals (line 285) | def _generate_proposals(self, box):
method __call__ (line 296) | def __call__(self, data: TensorDict):
class DiMPProcessing (line 334) | class DiMPProcessing(BaseProcessing):
method __init__ (line 347) | def __init__(self, search_area_factor, output_sz, center_jitter_factor...
method _get_jittered_box (line 378) | def _get_jittered_box(self, box, mode):
method _generate_proposals (line 394) | def _generate_proposals(self, box):
method _generate_label_function (line 426) | def _generate_label_function(self, target_bb):
method __call__ (line 442) | def __call__(self, data: TensorDict):
class KLDiMPProcessing (line 491) | class KLDiMPProcessing(BaseProcessing):
method __init__ (line 496) | def __init__(self, search_area_factor, output_sz, center_jitter_factor...
method _get_jittered_box (line 530) | def _get_jittered_box(self, box, mode):
method _generate_proposals (line 546) | def _generate_proposals(self, box):
method _generate_label_function (line 560) | def _generate_label_function(self, target_bb):
method _generate_label_density (line 576) | def _generate_label_density(self, target_bb):
method __call__ (line 605) | def __call__(self, data: TensorDict):
FILE: external/AR/ltr/data/processing_utils.py
function sample_target (line 9) | def sample_target(im, target_bb, search_area_factor, output_sz=None, mas...
function transform_image_to_crop (line 68) | def transform_image_to_crop(box_in: torch.Tensor, box_extract: torch.Ten...
function jittered_center_crop (line 91) | def jittered_center_crop(frames, box_extract, box_gt, search_area_factor...
function sample_target_adaptive (line 128) | def sample_target_adaptive(im, target_bb, search_area_factor, output_sz,...
function crop_and_resize (line 240) | def crop_and_resize(im, box, crop_bb, output_sz, mask=None):
function transform_box_to_crop (line 298) | def transform_box_to_crop(box: torch.Tensor, crop_box: torch.Tensor, cro...
function target_image_crop (line 319) | def target_image_crop(frames, box_extract, box_gt, search_area_factor, o...
function iou (line 371) | def iou(reference, proposals):
function rand_uniform (line 394) | def rand_uniform(a, b, shape=1):
function perturb_box (line 407) | def perturb_box(box, min_iou=0.5, sigma_factor=0.1):
function gauss_1d (line 469) | def gauss_1d(sz, sigma, center, end_pad=0, density=False):
function gauss_2d (line 477) | def gauss_2d(sz, sigma, center, end_pad=(0, 0), density=False):
function gaussian_label_function (line 484) | def gaussian_label_function(target_bb, sigma_factor, kernel_sz, feat_sz,...
function gauss_density_centered (line 520) | def gauss_density_centered(x, std):
function gmm_density_centered (line 529) | def gmm_density_centered(x, std):
function sample_gmm_centered (line 542) | def sample_gmm_centered(std, num_samples=1):
function sample_gmm (line 564) | def sample_gmm(mean, std, num_samples=1):
function sample_box_gmm (line 589) | def sample_box_gmm(mean_box, proposal_sigma, gt_sigma=None, num_samples=...
FILE: external/AR/ltr/data/processing_utils_SE.py
function stack_tensors (line 8) | def stack_tensors(x):
function sample_target_SE (line 15) | def sample_target_SE(im, target_bb, search_area_factor, output_sz=None, ...
function map_mask_back (line 66) | def map_mask_back(im, target_bb, search_area_factor, mask, mode=cv.BORDE...
function transform_image_to_crop_SE (line 114) | def transform_image_to_crop_SE(box_in: torch.Tensor, box_extract: torch....
function centered_crop (line 146) | def centered_crop(frames, anno, area_factor, output_sz):
function jittered_center_crop_SE (line 162) | def jittered_center_crop_SE(frames, box_extract, box_gt, search_area_fac...
function sample_target_nopad (line 196) | def sample_target_nopad(im, target_bb, search_area_factor, output_sz):
function transform_box_to_crop (line 255) | def transform_box_to_crop(box: torch.Tensor, crop_box: torch.Tensor, cro...
function jittered_center_crop_nopad (line 276) | def jittered_center_crop_nopad(frames, box_extract, box_gt, search_area_...
function iou (line 312) | def iou(reference, proposals):
function rand_uniform (line 335) | def rand_uniform(a, b, shape=1):
function perturb_box (line 348) | def perturb_box(box, min_iou=0.5, sigma_factor=0.1):
function gauss_1d (line 410) | def gauss_1d(sz, sigma, center, end_pad=0):
function gauss_2d (line 415) | def gauss_2d(sz, sigma, center, end_pad=(0, 0)):
function gaussian_label_function (line 422) | def gaussian_label_function(target_bb, sigma_factor, kernel_sz, feat_sz,...
FILE: external/AR/ltr/data/sampler.py
function no_processing (line 6) | def no_processing(data):
class TrackingSampler (line 10) | class TrackingSampler(torch.utils.data.Dataset):
method __init__ (line 25) | def __init__(self, datasets, p_datasets, samples_per_epoch, max_gap,
method __len__ (line 56) | def __len__(self):
method _sample_visible_ids (line 59) | def _sample_visible_ids(self, visible, num_ids=1, min_id=None, max_id=...
method __getitem__ (line 86) | def __getitem__(self, index):
class DiMPSampler (line 172) | class DiMPSampler(TrackingSampler):
method __init__ (line 175) | def __init__(self, datasets, p_datasets, samples_per_epoch, max_gap,
class ATOMSampler (line 182) | class ATOMSampler(TrackingSampler):
method __init__ (line 185) | def __init__(self, datasets, p_datasets, samples_per_epoch, max_gap,
FILE: external/AR/ltr/data/transforms.py
class Transform (line 10) | class Transform:
method __init__ (line 35) | def __init__(self, *transforms):
method __call__ (line 43) | def __call__(self, **inputs):
method _split_inputs (line 65) | def _split_inputs(self, inputs):
method __repr__ (line 77) | def __repr__(self):
class TransformBase (line 86) | class TransformBase:
method __init__ (line 88) | def __init__(self):
method __call__ (line 94) | def __call__(self, **inputs):
method _get_image_size (line 122) | def _get_image_size(self, inputs):
method roll (line 138) | def roll(self):
method transform_image (line 141) | def transform_image(self, image, *rand_params):
method transform_coords (line 145) | def transform_coords(self, coords, image_shape, *rand_params):
method transform_bbox (line 149) | def transform_bbox(self, bbox, image_shape, *rand_params):
method transform_mask (line 171) | def transform_mask(self, mask, *rand_params):
class ToTensor (line 176) | class ToTensor(TransformBase):
method transform_image (line 179) | def transform_image(self, image):
method transfrom_mask (line 191) | def transfrom_mask(self, mask):
class ToTensorAndJitter (line 197) | class ToTensorAndJitter(TransformBase):
method __init__ (line 199) | def __init__(self, brightness_jitter=0.0, normalize=True):
method roll (line 204) | def roll(self):
method transform_image (line 207) | def transform_image(self, image, brightness_factor):
method transform_mask (line 217) | def transform_mask(self, mask, brightness_factor):
class Normalize (line 224) | class Normalize(TransformBase):
method __init__ (line 226) | def __init__(self, mean, std, inplace=False):
method transform_image (line 232) | def transform_image(self, image):
class ToGrayscale (line 236) | class ToGrayscale(TransformBase):
method __init__ (line 238) | def __init__(self, probability = 0.5):
method roll (line 243) | def roll(self):
method transform_image (line 246) | def transform_image(self, image, do_grayscale):
class ToBGR (line 256) | class ToBGR(TransformBase):
method transform_image (line 258) | def transform_image(self, image):
class RandomHorizontalFlip (line 265) | class RandomHorizontalFlip(TransformBase):
method __init__ (line 267) | def __init__(self, probability = 0.5):
method roll (line 271) | def roll(self):
method transform_image (line 274) | def transform_image(self, image, do_flip):
method transform_coords (line 281) | def transform_coords(self, coords, image_shape, do_flip):
method transform_mask (line 287) | def transform_mask(self, mask, do_flip):
class Blur (line 295) | class Blur(TransformBase):
method __init__ (line 297) | def __init__(self, sigma):
method transform_image (line 308) | def transform_image(self, image):
class RandomBlur (line 317) | class RandomBlur(TransformBase):
method __init__ (line 319) | def __init__(self, sigma, probability=0.1):
method roll (line 332) | def roll(self):
method transform (line 335) | def transform(self, image, do_blur=None):
class RandomAffine (line 350) | class RandomAffine(TransformBase):
method __init__ (line 352) | def __init__(self, p_flip=0.0, max_rotation=0.0, max_shear=0.0, max_sc...
method roll (line 370) | def roll(self):
method _construct_t_mat (line 382) | def _construct_t_mat(self, image_shape, do_flip, theta, shear_values, ...
method transform_image (line 411) | def transform_image(self, image, do_flip, theta, shear_values, scale_f...
method transform_coords (line 422) | def transform_coords(self, coords, image_shape, do_flip, theta, shear_...
method transform_mask (line 433) | def transform_mask(self, mask, do_flip, theta, shear_values, scale_fac...
FILE: external/AR/ltr/dataset/base_image_dataset.py
class BaseImageDataset (line 5) | class BaseImageDataset(torch.utils.data.Dataset):
method __init__ (line 8) | def __init__(self, name, root, image_loader=jpeg4py_loader):
method __len__ (line 22) | def __len__(self):
method __getitem__ (line 29) | def __getitem__(self, index):
method get_name (line 34) | def get_name(self):
method get_num_images (line 42) | def get_num_images(self):
method has_class_info (line 49) | def has_class_info(self):
method get_class_name (line 52) | def get_class_name(self, image_id):
method get_num_classes (line 55) | def get_num_classes(self):
method get_class_list (line 58) | def get_class_list(self):
method get_images_in_class (line 61) | def get_images_in_class(self, class_name):
method has_segmentation_info (line 64) | def has_segmentation_info(self):
method get_image_info (line 67) | def get_image_info(self, seq_id):
method get_image (line 78) | def get_image(self, image_id, anno=None):
FILE: external/AR/ltr/dataset/base_video_dataset.py
class BaseVideoDataset (line 5) | class BaseVideoDataset(torch.utils.data.Dataset):
method __init__ (line 8) | def __init__(self, name, root, image_loader=jpeg4py_loader):
method __len__ (line 22) | def __len__(self):
method __getitem__ (line 29) | def __getitem__(self, index):
method is_video_sequence (line 34) | def is_video_sequence(self):
method is_synthetic_video_dataset (line 42) | def is_synthetic_video_dataset(self):
method get_name (line 50) | def get_name(self):
method get_num_sequences (line 58) | def get_num_sequences(self):
method has_class_info (line 65) | def has_class_info(self):
method has_occlusion_info (line 68) | def has_occlusion_info(self):
method get_num_classes (line 71) | def get_num_classes(self):
method get_class_list (line 74) | def get_class_list(self):
method get_sequences_in_class (line 77) | def get_sequences_in_class(self, class_name):
method has_segmentation_info (line 80) | def has_segmentation_info(self):
method get_sequence_info (line 83) | def get_sequence_info(self, seq_id):
method get_frames (line 94) | def get_frames(self, seq_id, frame_ids, anno=None):
FILE: external/AR/ltr/dataset/coco.py
class MSCOCO (line 11) | class MSCOCO(BaseImageDataset):
method __init__ (line 34) | def __init__(self, root=None, image_loader=jpeg4py_loader, data_fracti...
method _get_image_list (line 65) | def _get_image_list(self, min_area=None):
method get_num_classes (line 74) | def get_num_classes(self):
method get_name (line 77) | def get_name(self):
method has_class_info (line 80) | def has_class_info(self):
method has_segmentation_info (line 83) | def has_segmentation_info(self):
method get_class_list (line 86) | def get_class_list(self):
method _build_im_per_class (line 92) | def _build_im_per_class(self):
method get_images_in_class (line 103) | def get_images_in_class(self, class_name):
method get_image_info (line 106) | def get_image_info(self, im_id):
method _get_anno (line 118) | def _get_anno(self, im_id):
method _get_image (line 123) | def _get_image(self, im_id):
method get_meta_info (line 128) | def get_meta_info(self, im_id):
method get_class_name (line 144) | def get_class_name(self, im_id):
method get_image (line 148) | def get_image(self, image_id, anno=None):
FILE: external/AR/ltr/dataset/coco_seq.py
class MSCOCOSeq (line 11) | class MSCOCOSeq(BaseVideoDataset):
method __init__ (line 34) | def __init__(self, root=None, image_loader=jpeg4py_loader, data_fracti...
method _get_sequence_list (line 65) | def _get_sequence_list(self):
method is_video_sequence (line 71) | def is_video_sequence(self):
method get_num_classes (line 74) | def get_num_classes(self):
method get_name (line 77) | def get_name(self):
method has_class_info (line 80) | def has_class_info(self):
method get_class_list (line 83) | def get_class_list(self):
method has_segmentation_info (line 89) | def has_segmentation_info(self):
method get_num_sequences (line 92) | def get_num_sequences(self):
method _build_seq_per_class (line 95) | def _build_seq_per_class(self):
method get_sequences_in_class (line 106) | def get_sequences_in_class(self, class_name):
method get_sequence_info (line 109) | def get_sequence_info(self, seq_id):
method _get_anno (line 121) | def _get_anno(self, seq_id):
method _get_frames (line 126) | def _get_frames(self, seq_id):
method get_meta_info (line 131) | def get_meta_info(self, seq_id):
method get_class_name (line 148) | def get_class_name(self, seq_id):
method get_frames (line 152) | def get_frames(self, seq_id=None, frame_ids=None, anno=None):
FILE: external/AR/ltr/dataset/davis.py
class Davis (line 8) | class Davis(VOSDatasetBase):
method __init__ (line 19) | def __init__(self, root=None, sequences=None, version='2017', split='t...
method _construct_sequence (line 76) | def _construct
Condensed preview — 756 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (5,901K chars).
[
{
"path": "ARTrack_env_cuda113.yaml",
"chars": 14787,
"preview": "name: artrack\nchannels:\n - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch\n - http://mirrors.tuna.tsinghua."
},
{
"path": "LICENSE",
"chars": 11357,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "README.md",
"chars": 13756,
"preview": "# ARTrack\r\n\r\n[:\n \"\"\" Actor for training the IoU-Net in ATOM\"\"\"\n def __call__"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/actors/tracking.py",
"chars": 9035,
"preview": "from . import BaseActor\nimport torch\n\n\nclass DiMPActor(BaseActor):\n \"\"\"Actor for training the DiMP network.\"\"\"\n de"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/admin/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/ltr/admin/environment.py",
"chars": 1878,
"preview": "import importlib\nimport os\nfrom collections import OrderedDict\n\n\ndef create_default_local_file():\n path = os.path.joi"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/admin/loading.py",
"chars": 5567,
"preview": "import torch\nimport os\nimport sys\nfrom pathlib import Path\nimport importlib\nimport inspect\nfrom ltr.admin import setting"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/admin/model_constructor.py",
"chars": 2053,
"preview": "from functools import wraps\nimport importlib\n\n\ndef model_constructor(f):\n \"\"\" Wraps the function 'f' which returns th"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/admin/multigpu.py",
"chars": 365,
"preview": "import torch.nn as nn\n\n\ndef is_multi_gpu(net):\n return isinstance(net, (MultiGPU, nn.DataParallel))\n\n\nclass MultiGPU("
},
{
"path": "artrackv2_mindspore/external/AR/ltr/admin/settings.py",
"chars": 279,
"preview": "from ltr.admin.environment import env_settings\n\n\nclass Settings:\n \"\"\" Training settings, e.g. the paths to datasets a"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/admin/stats.py",
"chars": 1578,
"preview": "\n\nclass StatValue:\n def __init__(self):\n self.clear()\n\n def reset(self):\n self.val = 0\n\n def clea"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/admin/tensorboard.py",
"chars": 1251,
"preview": "import os\nfrom collections import OrderedDict\ntry:\n from torch.utils.tensorboard import SummaryWriter\nexcept:\n pri"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/data/__init__.py",
"chars": 29,
"preview": "from .loader import LTRLoader"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/data/bounding_box_utils.py",
"chars": 2979,
"preview": "import torch\n\n\ndef rect_to_rel(bb, sz_norm=None):\n \"\"\"Convert standard rectangular parametrization of the bounding bo"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/data/image_loader.py",
"chars": 3358,
"preview": "import jpeg4py\nimport cv2 as cv\nfrom PIL import Image\nimport numpy as np\n\ndavis_palette = np.repeat(np.expand_dims(np.ar"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/data/loader.py",
"chars": 9377,
"preview": "import torch\nimport torch.utils.data.dataloader\nimport importlib\nimport collections\nfrom torch._six import string_classe"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/data/processing.py",
"chars": 35017,
"preview": "import torch\nimport torchvision.transforms as transforms\nfrom pytracking import TensorDict\nimport ltr.data.processing_ut"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/data/processing_utils.py",
"chars": 23093,
"preview": "import torch\nimport math\nimport cv2 as cv\nimport random\nimport torch.nn.functional as F\nfrom .bounding_box_utils import "
},
{
"path": "artrackv2_mindspore/external/AR/ltr/data/processing_utils_SE.py",
"chars": 16646,
"preview": "import torch\nimport math\nimport cv2 as cv\nimport random\n\nimport numpy as np\n\ndef stack_tensors(x):\n if isinstance(x, "
},
{
"path": "artrackv2_mindspore/external/AR/ltr/data/sampler.py",
"chars": 9665,
"preview": "import random\nimport torch.utils.data\nfrom pytracking import TensorDict\n\n\ndef no_processing(data):\n return data\n\n\ncla"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/data/transforms.py",
"chars": 16893,
"preview": "import random\nimport numpy as np\nimport math\nimport cv2 as cv\nimport torch\nimport torch.nn.functional as F\nimport torchv"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/__init__.py",
"chars": 467,
"preview": "from .lasot import Lasot\nfrom .got10k import Got10k\nfrom .tracking_net import TrackingNet\nfrom .imagenetvid import Image"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/base_image_dataset.py",
"chars": 2421,
"preview": "import torch.utils.data\nfrom ltr.data.image_loader import jpeg4py_loader\n\n\nclass BaseImageDataset(torch.utils.data.Datas"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/base_video_dataset.py",
"chars": 3024,
"preview": "import torch.utils.data\nfrom ltr.data.image_loader import jpeg4py_loader\n\n\nclass BaseVideoDataset(torch.utils.data.Datas"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/coco.py",
"chars": 5765,
"preview": "import os\nfrom .base_image_dataset import BaseImageDataset\nfrom ltr.data.image_loader import jpeg4py_loader\nimport torch"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/coco_seq.py",
"chars": 6298,
"preview": "import os\nfrom .base_video_dataset import BaseVideoDataset\nfrom ltr.data.image_loader import jpeg4py_loader\nimport torch"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/davis.py",
"chars": 3895,
"preview": "from pathlib import Path\nfrom ltr.dataset.vos_base import VOSDatasetBase, VOSMeta\nfrom pytracking.evaluation import Sequ"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/ecssd.py",
"chars": 3059,
"preview": "import os\nfrom .base_image_dataset import BaseImageDataset\nfrom ltr.data.image_loader import jpeg4py_loader, opencv_load"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/got10k.py",
"chars": 7747,
"preview": "import os\nimport os.path\nimport numpy as np\nimport torch\nimport csv\nimport pandas\nimport random\nfrom collections import "
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/hku_is.py",
"chars": 3080,
"preview": "import os\nfrom .base_image_dataset import BaseImageDataset\nfrom ltr.data.image_loader import jpeg4py_loader, opencv_load"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/imagenetvid.py",
"chars": 7174,
"preview": "import os\nfrom .base_video_dataset import BaseVideoDataset\nfrom ltr.data.image_loader import default_image_loader\nimport"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/lasot.py",
"chars": 6537,
"preview": "import os\nimport os.path\nimport torch\nimport numpy as np\nimport pandas\nimport csv\nimport random\nfrom collections import "
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/lvis.py",
"chars": 5546,
"preview": "import os\nfrom .base_image_dataset import BaseImageDataset\nfrom ltr.data.image_loader import jpeg4py_loader_w_failsafe\ni"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/msra10k.py",
"chars": 3123,
"preview": "import os\nfrom .base_image_dataset import BaseImageDataset\nfrom ltr.data.image_loader import jpeg4py_loader, imread_inde"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/sbd.py",
"chars": 3978,
"preview": "from .base_image_dataset import BaseImageDataset\nfrom ltr.data.image_loader import jpeg4py_loader_w_failsafe\nimport torc"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/synthetic_video.py",
"chars": 3305,
"preview": "from collections import OrderedDict\nfrom .base_video_dataset import BaseVideoDataset\nfrom ltr.data.bounding_box_utils im"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/synthetic_video_blend.py",
"chars": 6943,
"preview": "from collections import OrderedDict\nfrom .base_video_dataset import BaseVideoDataset\nfrom ltr.data.bounding_box_utils im"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/tracking_net.py",
"chars": 5878,
"preview": "import torch\nimport os\nimport os.path\nimport numpy as np\nimport pandas\nimport random\nfrom collections import OrderedDict"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/vos_base.py",
"chars": 16000,
"preview": "import torch\nfrom pathlib import Path\nfrom collections import OrderedDict, defaultdict\nimport json\nimport numpy as np\nim"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/dataset/youtubevos.py",
"chars": 8394,
"preview": "from pathlib import Path\nimport os\nfrom ltr.dataset.vos_base import VOSDatasetBase, VOSMeta\nfrom pytracking.evaluation i"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/.gitignore",
"chars": 1219,
"preview": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n.vim-template*\n\n# C extensions\n*.so\n\n# Distri"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/LICENSE",
"chars": 1068,
"preview": "MIT License\n\nCopyright (c) 2018 Jiayuan Mao\n\nPermission is hereby granted, free of charge, to any person obtaining a cop"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/README.md",
"chars": 3938,
"preview": "# PreciseRoIPooling\nThis repo implements the **Precise RoI Pooling** (PrRoI Pooling), proposed in the paper **Acquisitio"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/.gitignore",
"chars": 20,
"preview": "*.o\n/_prroi_pooling\n"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/__init__.py",
"chars": 350,
"preview": "#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n# File : __init__.py\n# Author : Jiayuan Mao, Tete Xiao\n# Email : maoj"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/functional.py",
"chars": 2837,
"preview": "#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n# File : functional.py\n# Author : Jiayuan Mao, Tete Xiao\n# Email : ma"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/prroi_pool.py",
"chars": 972,
"preview": "#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n# File : prroi_pool.py\n# Author : Jiayuan Mao, Tete Xiao\n# Email : ma"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c",
"chars": 3854,
"preview": "/*\n * File : prroi_pooling_gpu.c\n * Author : Jiayuan Mao, Tete Xiao\n * Email : maojiayuan@gmail.com, jasonhsiao97@gma"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.h",
"chars": 865,
"preview": "/*\n * File : prroi_pooling_gpu.h\n * Author : Jiayuan Mao, Tete Xiao\n * Email : maojiayuan@gmail.com, jasonhsiao97@gma"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu",
"chars": 17532,
"preview": "/*\n * File : prroi_pooling_gpu_impl.cu\n * Author : Tete Xiao, Jiayuan Mao\n * Email : jasonhsiao97@gmail.com\n *\n * Dis"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cuh",
"chars": 1589,
"preview": "/*\n * File : prroi_pooling_gpu_impl.cuh\n * Author : Tete Xiao, Jiayuan Mao\n * Email : jasonhsiao97@gmail.com\n *\n * Di"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/pytorch/tests/test_prroi_pooling2d.py",
"chars": 1473,
"preview": "# -*- coding: utf-8 -*-\n# File : test_prroi_pooling2d.py\n# Author : Jiayuan Mao\n# Email : maojiayuan@gmail.com\n# Date"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/src/prroi_pooling_gpu_impl.cu",
"chars": 17532,
"preview": "/*\n * File : prroi_pooling_gpu_impl.cu\n * Author : Tete Xiao, Jiayuan Mao\n * Email : jasonhsiao97@gmail.com\n *\n * Dis"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/external/PreciseRoIPooling/src/prroi_pooling_gpu_impl.cuh",
"chars": 1589,
"preview": "/*\n * File : prroi_pooling_gpu_impl.cuh\n * Author : Tete Xiao, Jiayuan Mao\n * Email : jasonhsiao97@gmail.com\n *\n * Di"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/AR_seg_mask/AR_seg_mask.py",
"chars": 5452,
"preview": "import torch.nn as nn\nfrom ltr.models.neck import CorrNL\nfrom ltr import model_constructor\nimport torch\nimport ltr.model"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/AR_seg_mask/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/backbone/__init__.py",
"chars": 98,
"preview": "from .resnet import resnet18, resnet50, resnet_baby\nfrom .resnet18_vggm import resnet18_vggmconv1\n"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/backbone/base.py",
"chars": 1611,
"preview": "import torch\nimport torch.nn as nn\n\n\nclass Backbone(nn.Module):\n \"\"\"Base class for backbone networks. Handles freezin"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/backbone/resnet.py",
"chars": 9442,
"preview": "import math\nimport torch.nn as nn\nfrom collections import OrderedDict\nimport torch.utils.model_zoo as model_zoo\nfrom tor"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/backbone/resnet18_vggm.py",
"chars": 5522,
"preview": "import math\nimport torch\nimport torch.nn as nn\nfrom collections import OrderedDict\nfrom torchvision.models.resnet import"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/backbone/resnet_seg.py",
"chars": 8770,
"preview": "import math\nimport torch.nn as nn\nfrom collections import OrderedDict\nimport torch.utils.model_zoo as model_zoo\nfrom tor"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/bbreg/__init__.py",
"chars": 37,
"preview": "from .atom_iou_net import AtomIoUNet\n"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/bbreg/atom.py",
"chars": 3542,
"preview": "import torch.nn as nn\nimport ltr.models.backbone as backbones\nimport ltr.models.bbreg as bbmodels\nfrom ltr import model_"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/bbreg/atom_iou_net.py",
"chars": 7601,
"preview": "import torch.nn as nn\nimport torch\nfrom ltr.models.layers.blocks import LinearBlock\nfrom ltr.external.PreciseRoIPooling."
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/head/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/head/seg_network.py",
"chars": 6775,
"preview": "import torch\nfrom torch import nn as nn\nfrom torch.nn import functional as F\nfrom ltr.models.head.utils import conv, rel"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/head/utils.py",
"chars": 3388,
"preview": "from collections import OrderedDict as odict\n\nimport numpy as np\nimport torch\nfrom torch import nn as nn\nfrom torch.nn i"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/layers/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/layers/activation.py",
"chars": 1860,
"preview": "import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\ndef softmax_reg(x: torch.Tensor, dim, r"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/layers/blocks.py",
"chars": 1397,
"preview": "from torch import nn\n\n\ndef conv_block(in_planes, out_planes, kernel_size=3, stride=1, padding=1, dilation=1, bias=True,\n"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/layers/distance.py",
"chars": 1423,
"preview": "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass DistanceMap(nn.Module):\n \"\"\"Generate a dis"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/layers/filter.py",
"chars": 8433,
"preview": "import torch\nimport torch.nn.functional as F\n\n\ndef apply_filter(feat, filter, dilation_factors=None):\n \"\"\"Applies the"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/layers/normalization.py",
"chars": 764,
"preview": "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass InstanceL2Norm(nn.Module):\n \"\"\"Instance L2"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/layers/transform.py",
"chars": 800,
"preview": "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom collections import OrderedDict\n\n\ndef interpolate"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/loss/__init__.py",
"chars": 43,
"preview": "from .target_classification import LBHinge\n"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/loss/kl_regression.py",
"chars": 2530,
"preview": "import math\nimport torch\nimport torch.nn as nn\nfrom torch.nn import functional as F\n\n\nclass KLRegression(nn.Module):\n "
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/loss/target_classification.py",
"chars": 1191,
"preview": "import torch.nn as nn\nimport torch\nfrom torch.nn import functional as F\n\n\nclass LBHinge(nn.Module):\n \"\"\"Loss that use"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/meta/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/meta/steepestdescent.py",
"chars": 3524,
"preview": "import math\nimport torch\nimport torch.nn as nn\nfrom pytracking import TensorList\nfrom ltr.models.layers import activatio"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/neck/CorrNL.py",
"chars": 5179,
"preview": "import torch.nn as nn\nimport torch\nfrom ltr.external.PreciseRoIPooling.pytorch.prroi_pool import PrRoIPool2D\nfrom torch."
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/neck/neck_utils.py",
"chars": 4841,
"preview": "import torch.nn as nn\nimport torch\nfrom torch.nn import functional as F\n\ndef conv(in_planes, out_planes, kernel_size=3, "
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/target_classifier/__init__.py",
"chars": 40,
"preview": "from .linear_filter import LinearFilter\n"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/target_classifier/features.py",
"chars": 3046,
"preview": "import torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom torchvision.models.resnet import BasicBlock, Bott"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/target_classifier/initializer.py",
"chars": 10465,
"preview": "import torch.nn as nn\nimport torch\nimport torch.nn.functional as F\nfrom ltr.external.PreciseRoIPooling.pytorch.prroi_poo"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/target_classifier/linear_filter.py",
"chars": 5405,
"preview": "import torch.nn as nn\nimport ltr.models.layers.filter as filter_layer\nimport math\n\n\nclass LinearFilter(nn.Module):\n \""
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/target_classifier/optimizer.py",
"chars": 23277,
"preview": "import torch.nn as nn\nimport torch\nimport torch.nn.functional as F\nimport ltr.models.layers.filter as filter_layer\nimpor"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/target_classifier/residual_modules.py",
"chars": 3840,
"preview": "import torch\nimport torch.nn as nn\nimport math\nimport ltr.models.layers.filter as filter_layer\nimport ltr.models.layers."
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/tracking/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/ltr/models/tracking/dimpnet.py",
"chars": 19303,
"preview": "import math\nimport torch\nimport torch.nn as nn\nfrom collections import OrderedDict\nfrom ltr.models.meta import steepestd"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/run_training.py",
"chars": 1817,
"preview": "import os\nimport sys\nimport argparse\nimport importlib\nimport multiprocessing\nimport cv2 as cv\nimport torch.backends.cudn"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/train_settings/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/ltr/train_settings/bbreg/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/ltr/train_settings/bbreg/atom.py",
"chars": 5194,
"preview": "import torch.nn as nn\nimport torch.optim as optim\nfrom ltr.dataset import Lasot, TrackingNet, MSCOCOSeq, Got10k\nfrom ltr"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/train_settings/bbreg/atom_gmm_sampl.py",
"chars": 5339,
"preview": "import torch.nn as nn\nimport torch.optim as optim\nfrom ltr.dataset import Lasot, TrackingNet, MSCOCOSeq, Got10k\nfrom ltr"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/train_settings/bbreg/atom_paper.py",
"chars": 5105,
"preview": "import torch.nn as nn\nimport torch.optim as optim\nfrom ltr.dataset import Lasot, TrackingNet, MSCOCOSeq\nfrom ltr.data im"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/train_settings/bbreg/atom_prob_ml.py",
"chars": 5470,
"preview": "import torch.optim as optim\nfrom ltr.dataset import Lasot, TrackingNet, MSCOCOSeq, Got10k\nfrom ltr.data import processin"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/train_settings/dimp/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/ltr/train_settings/dimp/dimp18.py",
"chars": 6584,
"preview": "import torch.nn as nn\nimport torch.optim as optim\nfrom ltr.dataset import Lasot, Got10k, TrackingNet, MSCOCOSeq\nfrom ltr"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/train_settings/dimp/dimp50.py",
"chars": 6649,
"preview": "import torch.nn as nn\nimport torch.optim as optim\nfrom ltr.dataset import Lasot, Got10k, TrackingNet, MSCOCOSeq\nfrom ltr"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/train_settings/dimp/prdimp18.py",
"chars": 6740,
"preview": "import torch.optim as optim\nfrom ltr.dataset import Lasot, Got10k, TrackingNet, MSCOCOSeq\nfrom ltr.data import processin"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/train_settings/dimp/prdimp50.py",
"chars": 6832,
"preview": "import torch.optim as optim\nfrom ltr.dataset import Lasot, Got10k, TrackingNet, MSCOCOSeq\nfrom ltr.data import processin"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/train_settings/dimp/super_dimp.py",
"chars": 7949,
"preview": "import torch.optim as optim\nfrom ltr.dataset import Lasot, Got10k, TrackingNet, MSCOCOSeq\nfrom ltr.data import processin"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/trainers/__init__.py",
"chars": 73,
"preview": "from .base_trainer import BaseTrainer\nfrom .ltr_trainer import LTRTrainer"
},
{
"path": "artrackv2_mindspore/external/AR/ltr/trainers/base_trainer.py",
"chars": 7957,
"preview": "import os\nimport glob\nimport torch\nimport traceback\nfrom ltr.admin import loading, multigpu\n\n\nclass BaseTrainer:\n \"\"\""
},
{
"path": "artrackv2_mindspore/external/AR/ltr/trainers/ltr_trainer.py",
"chars": 5434,
"preview": "import os\nfrom collections import OrderedDict\nfrom ltr.trainers import BaseTrainer\nfrom ltr.admin.stats import AverageMe"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/ARcm_seg.py",
"chars": 4059,
"preview": "import os\nimport sys\nimport torch\nimport numpy as np\nimport cv2\nimport torch.nn as nn\nfrom external.AR.pytracking.utils."
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/VOT/tracker_DiMP.m",
"chars": 1198,
"preview": "% Set path to the python in the pytracking conda environment\npython_path = 'PATH_TO_CONDA_INSTALLATION/envs/pytracking/b"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/VOT/trackers.ini",
"chars": 370,
"preview": "[DiMP] # <tracker-name>\nlabel = DiMP\nprotocol = traxpython\n\ncommand = run_vot; run_vot.run_vot2020('dimp', 'dimp50') #"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/VOT/vot.py",
"chars": 3282,
"preview": "\"\"\"\n\\file vot.py\n\n@brief Python utility functions for VOT integration\n\n@author Luka Cehovin, Alessio Dore\n\n@date 2016, 2"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/VOT2020_super_only_mask_384_HP/dimp_alpha_065.py",
"chars": 354,
"preview": "from pytracking.VOT2020_super_only_mask_384_HP.dimp_alpha_seg_class import run_vot_exp\nimport os\nos.environ['CUDA_VISIBL"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/VOT2020_super_only_mask_384_HP/dimp_alpha_seg_class.py",
"chars": 6724,
"preview": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __futu"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/VOT2020_super_only_mask_384_HP/mixformer_alpha_seg_class.py",
"chars": 3661,
"preview": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __futu"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/VOT2020_super_only_mask_384_HP/mixformer_large_alpha_seg_class.py",
"chars": 3674,
"preview": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __futu"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/VOT2020_super_only_mask_384_HP/vot.py",
"chars": 3519,
"preview": "\"\"\"\n\\file vot.py\n@brief Python utility functions for VOT integration\n@author Luka Cehovin, Alessio Dore\n@date 2016\n\"\"\"\n\n"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/__init__.py",
"chars": 51,
"preview": "from pytracking.libs import TensorList, TensorDict\n"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/analysis/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/analysis/evaluate_vos.py",
"chars": 7681,
"preview": "import os\nimport numpy as np\nimport torch\nimport pandas as pd\nfrom collections import OrderedDict\nfrom ltr.data.image_lo"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/analysis/extract_results.py",
"chars": 7751,
"preview": "import os\nimport sys\nimport importlib\nimport numpy as np\nfrom pytracking.utils.load_text import load_text\nimport torch\ni"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/analysis/playback_results.py",
"chars": 6518,
"preview": "import os\nimport sys\nimport importlib\nimport numpy as np\nimport torch\nimport time\nimport matplotlib.patches as patches\ni"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/analysis/plot_results.py",
"chars": 22649,
"preview": "import tikzplotlib\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport os\nimport torch\nimport pickle\nimport json\nfr"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/analysis/vos_utils.py",
"chars": 6689,
"preview": "import warnings\nimport numpy as np\nfrom skimage.morphology import binary_dilation, disk\nfrom math import floor\n\n\ndef tex"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/__init__.py",
"chars": 102,
"preview": "from .data import Sequence\nfrom .tracker import Tracker, trackerlist\nfrom .datasets import get_dataset"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/data.py",
"chars": 6945,
"preview": "import numpy as np\nfrom pytracking.evaluation.environment import env_settings\nfrom ltr.data.image_loader import imread_i"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/datasets.py",
"chars": 3689,
"preview": "from collections import namedtuple\nimport importlib\nfrom pytracking.evaluation.data import SequenceList\n\nDatasetInfo = n"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/environment.py",
"chars": 2481,
"preview": "import importlib\nimport os\n\n\nclass EnvSettings:\n def __init__(self):\n pytracking_path = os.path.abspath(os.pat"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/got10kdataset.py",
"chars": 2228,
"preview": "import numpy as np\nfrom pytracking.evaluation.data import Sequence, BaseDataset, SequenceList\nfrom pytracking.utils.load"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/lasotdataset.py",
"chars": 13108,
"preview": "import numpy as np\nfrom pytracking.evaluation.data import Sequence, BaseDataset, SequenceList\nfrom pytracking.utils.load"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/mobifacedataset.py",
"chars": 2824,
"preview": "from pytracking.evaluation.data import Sequence, BaseDataset, SequenceList\nimport glob\nimport numpy as np\nimport os.path"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/multi_object_wrapper.py",
"chars": 7037,
"preview": "import numpy as np\nfrom collections import OrderedDict\nimport time\nimport copy\n\n\nclass MultiObjectWrapper:\n def __ini"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/nfsdataset.py",
"chars": 23406,
"preview": "import numpy as np\nfrom pytracking.evaluation.data import Sequence, BaseDataset, SequenceList\nfrom pytracking.utils.load"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/otbdataset.py",
"chars": 21468,
"preview": "import numpy as np\nfrom pytracking.evaluation.data import Sequence, BaseDataset, SequenceList\nfrom pytracking.utils.load"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/running.py",
"chars": 5323,
"preview": "import numpy as np\nimport multiprocessing\nimport os\nimport sys\nfrom itertools import product\nfrom collections import Ord"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/tpldataset.py",
"chars": 26815,
"preview": "import numpy as np\nfrom pytracking.evaluation.data import Sequence, BaseDataset, SequenceList\nfrom pytracking.utils.load"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/tracker.py",
"chars": 26003,
"preview": "import importlib\nimport os\nimport numpy as np\nfrom collections import OrderedDict\nfrom pytracking.evaluation.environment"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/trackingnetdataset.py",
"chars": 2341,
"preview": "import numpy as np\nfrom pytracking.evaluation.data import Sequence, BaseDataset, SequenceList\nimport os\nfrom pytracking."
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/uavdataset.py",
"chars": 27616,
"preview": "import numpy as np\nfrom pytracking.evaluation.data import Sequence, BaseDataset, SequenceList\nfrom pytracking.utils.load"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/vot.py",
"chars": 5232,
"preview": "\"\"\"\n\\file vot.py\n\n@brief Python utility functions for VOT integration\n\n@author Luka Cehovin, Alessio Dore\n\n@date 2016\n\n\""
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/vot2020.py",
"chars": 4245,
"preview": "\"\"\"\n\\file vot.py\n\n@brief Python utility functions for VOT integration\n\n@author Luka Cehovin, Alessio Dore\n\n@date 2016\n\n\""
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/evaluation/votdataset.py",
"chars": 4341,
"preview": "import numpy as np\nfrom pytracking.evaluation.data import Sequence, BaseDataset, SequenceList\n\n\nclass VOTDataset(BaseDat"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/experiments/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/experiments/myexperiments.py",
"chars": 574,
"preview": "from pytracking.evaluation import Tracker, get_dataset, trackerlist\n\n\ndef atom_nfs_uav():\n # Run three runs of ATOM o"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/features/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/features/augmentation.py",
"chars": 8872,
"preview": "import numpy as np\nimport math\nimport torch\nimport torch.nn.functional as F\nimport cv2 as cv\nimport random\nfrom pytracki"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/features/color.py",
"chars": 582,
"preview": "import torch\nfrom pytracking.features.featurebase import FeatureBase\n\n\nclass RGB(FeatureBase):\n \"\"\"RGB feature normal"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/features/deep.py",
"chars": 5566,
"preview": "from pytracking.features.featurebase import FeatureBase, MultiFeatureBase\nimport torch\nimport torchvision\nfrom pytrackin"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/features/extractor.py",
"chars": 5230,
"preview": "import torch\nfrom pytracking.features.preprocessing import sample_patch\nfrom pytracking import TensorList\n\nclass Extract"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/features/featurebase.py",
"chars": 4218,
"preview": "import torch\nimport torch.nn.functional as F\nfrom pytracking import TensorList\n\n\nclass FeatureBase:\n \"\"\"Base feature "
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/features/net_wrappers.py",
"chars": 2437,
"preview": "import torch\nfrom pytracking.utils.loading import load_network\n\n\nclass NetWrapper:\n \"\"\"Used for wrapping networks in "
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/features/preprocessing.py",
"chars": 5108,
"preview": "import torch\nimport torch.nn.functional as F\nimport numpy as np\n\n\ndef numpy_to_torch(a: np.ndarray):\n return torch.fr"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/features/util.py",
"chars": 990,
"preview": "import torch\nfrom pytracking.features.featurebase import FeatureBase\n\n\nclass Concatenate(FeatureBase):\n \"\"\"A feature "
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/libs/__init__.py",
"chars": 69,
"preview": "from .tensorlist import TensorList\nfrom .tensordict import TensorDict"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/libs/complex.py",
"chars": 5981,
"preview": "import torch\nfrom pytracking.libs.tensorlist import tensor_operation\n\n\ndef is_complex(a: torch.Tensor) -> bool:\n retu"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/libs/dcf.py",
"chars": 6931,
"preview": "import torch\nimport math\nfrom pytracking import fourier\nfrom pytracking import complex\nimport torch.nn.functional as F\n\n"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/libs/fourier.py",
"chars": 4537,
"preview": "import torch\nimport torch.nn.functional as F\nfrom pytracking import complex, TensorList\nfrom pytracking.libs.tensorlist "
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/libs/operation.py",
"chars": 1509,
"preview": "import torch\nimport torch.nn.functional as F\nfrom pytracking.libs.tensorlist import tensor_operation, TensorList\n\n\n@tens"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/libs/optimization.py",
"chars": 21949,
"preview": "import torch\nimport torch.autograd\nimport math\nfrom pytracking.libs import TensorList\nfrom pytracking.utils.plotting imp"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/libs/tensordict.py",
"chars": 1228,
"preview": "from collections import OrderedDict\nimport torch\nimport copy\n\n\nclass TensorDict(OrderedDict):\n \"\"\"Container mainly us"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/libs/tensorlist.py",
"chars": 7058,
"preview": "import functools\nimport torch\nimport copy\n\n\nclass TensorList(list):\n \"\"\"Container mainly used for lists of torch tens"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/atom/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/atom/atom_gmm_sampl.py",
"chars": 6551,
"preview": "from pytracking.utils import TrackerParams, FeatureParams, Choice\nfrom pytracking.features.extractor import MultiResolut"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/atom/atom_prob_ml.py",
"chars": 6540,
"preview": "from pytracking.utils import TrackerParams, FeatureParams, Choice\nfrom pytracking.features.extractor import MultiResolut"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/atom/default.py",
"chars": 6482,
"preview": "from pytracking.utils import TrackerParams, FeatureParams, Choice\nfrom pytracking.features.extractor import MultiResolut"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/atom/default_vot.py",
"chars": 6516,
"preview": "from pytracking.utils import TrackerParams, FeatureParams, Choice\nfrom pytracking.features.extractor import MultiResolut"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/atom/multiscale_no_iounet.py",
"chars": 6503,
"preview": "from pytracking.utils import TrackerParams, FeatureParams, Choice\nfrom pytracking.features.extractor import MultiResolut"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/dimp/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/dimp/dimp18.py",
"chars": 2102,
"preview": "from pytracking.utils import TrackerParams\nfrom pytracking.features.net_wrappers import NetWithBackbone\n\ndef parameters("
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/dimp/dimp18_vot.py",
"chars": 2246,
"preview": "from pytracking.utils import TrackerParams\nfrom pytracking.features.net_wrappers import NetWithBackbone\n\ndef parameters("
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/dimp/dimp50.py",
"chars": 2102,
"preview": "from pytracking.utils import TrackerParams\nfrom pytracking.features.net_wrappers import NetWithBackbone\n\ndef parameters("
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/dimp/dimp50_vot.py",
"chars": 2210,
"preview": "from pytracking.utils import TrackerParams\nfrom pytracking.features.net_wrappers import NetWithBackbone\n\ndef parameters("
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/dimp/dimp50_vot19.py",
"chars": 2127,
"preview": "from pytracking.utils import TrackerParams\nfrom pytracking.features.net_wrappers import NetWithBackbone\n\ndef parameters("
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/dimp/prdimp18.py",
"chars": 2692,
"preview": "from pytracking.utils import TrackerParams\nfrom pytracking.features.net_wrappers import NetWithBackbone\n\ndef parameters("
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/dimp/prdimp50.py",
"chars": 2772,
"preview": "from pytracking.utils import TrackerParams\nfrom pytracking.features.net_wrappers import NetWithBackbone\n\ndef parameters("
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/dimp/super_dimp.py",
"chars": 2734,
"preview": "from pytracking.utils import TrackerParams\nfrom pytracking.features.net_wrappers import NetWithBackbone\n\ndef parameters("
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/eco/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/parameter/eco/default.py",
"chars": 5595,
"preview": "from pytracking.utils import TrackerParams, FeatureParams\nfrom pytracking.features.extractor import MultiResolutionExtra"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/tracker/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/tracker/atom/__init__.py",
"chars": 64,
"preview": "from .atom import ATOM\n\ndef get_tracker_class():\n return ATOM"
},
{
"path": "artrackv2_mindspore/external/AR/pytracking/tracker/atom/atom.py",
"chars": 40346,
"preview": "from pytracking.tracker.base import BaseTracker\nimport torch\nimport torch.nn.functional as F\nimport torch.nn\nimport math"
}
]
// ... and 556 more files (download for full content)
About this extraction
This page contains the full source code of the MIV-XJTU/ARTrack GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 756 files (5.3 MB), approximately 1.4M tokens, and a symbol index with 4831 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.