Giter Site home page Giter Site logo

visionml / pytracking Goto Github PK

View Code? Open in Web Editor NEW
3.1K 84.0 596.0 4.95 MB

Visual tracking library based on PyTorch.

License: GNU General Public License v3.0

Shell 0.22% Python 99.02% MATLAB 0.06% Jupyter Notebook 0.70%
computer-vision tracking machine-learning visual-tracking

pytracking's Introduction

PyTracking

A general python framework for visual object tracking and video object segmentation, based on PyTorch.

🔥 One tracking paper accepted at WACV 2024! 👇

🔥 One tracking paper accepted at WACV 2023! 👇

🔥 One tracking paper accepted at ECCV 2022! 👇

Highlights

TaMOs, RTS, ToMP, KeepTrack, LWL, KYS, PrDiMP, DiMP and ATOM Trackers

Official implementation of the TaMOs (WACV 2024), RTS (ECCV 2022), ToMP (CVPR 2022), KeepTrack (ICCV 2021), LWL (ECCV 2020), KYS (ECCV 2020), PrDiMP (CVPR 2020), DiMP (ICCV 2019), and ATOM (CVPR 2019) trackers, including complete training code and trained models.

Libraries for implementing and evaluating visual trackers. It includes

  • All common tracking and video object segmentation datasets.
  • Scripts to analyse tracker performance and obtain standard performance scores.
  • General building blocks, including deep networks, optimization, feature extraction and utilities for correlation filter tracking.

LTR (Learning Tracking Representations) is a general framework for training your visual tracking networks. It is equipped with

  • All common training datasets for visual object tracking and segmentation.
  • Functions for data sampling, processing etc.
  • Network modules for visual tracking.
  • And much more...

The tracker models trained using PyTracking, along with their results on standard tracking benchmarks are provided in the model zoo.

Trackers

The toolkit contains the implementation of the following trackers.

TaMOs (WACV 2024)

[Paper] [Raw results] [Models] [Training Code] [Tracker Code]

Official implementation of TaMOs. TaMOs is the first generico object tracker to tackle the problem of tracking multiple generic object at once. It uses a shared model predictor consisting of a Transformer in order to produce multiple target models (one for each specified target). It achieves sub-linear run-time when tracking multiple objects and outperforms existing single object trackers when running one instance for each target separately. TaMOs serves as the baseline tracker for the new large-scale generic object tracking benchmark LaGOT (see here) that contains multiple annotated target objects per sequence.

TaMOs_teaser_figure

RTS (ECCV 2022)

[Paper] [Raw results] [Models] [Training Code] [Tracker Code]

Official implementation of RTS. RTS is a robust, end-to-end trainable, segmentation-centric pipeline that internally works with segmentation masks instead of bounding boxes. Thus, it can learn a better target representation that clearly differentiates the target from the background. To achieve the necessary robustness for challenging tracking scenarios, a separate instance localization component is used to condition the segmentation decoder when producing the output mask.

RTS_teaser_figure

ToMP (CVPR 2022)

[Paper] [Raw results] [Models] [Training Code] [Tracker Code]

Official implementation of ToMP. ToMP employs a Transformer-based model prediction module in order to localize the target. The model predictor is further extended to estimate a second set of weights that are applied for accurate bounding box regression. The resulting tracker ToMP relies on training and on test frame information in order to predict all weights transductively.

ToMP_teaser_figure

KeepTrack (ICCV 2021)

[Paper] [Raw results] [Models] [Training Code] [Tracker Code]

Official implementation of KeepTrack. KeepTrack actively handles distractor objects to continue tracking the target. It employs a learned target candidate association network, that allows to propagate the identities of all target candidates from frame-to-frame. To tackle the problem of lacking groundtruth correspondences between distractor objects in visual tracking, it uses a training strategy that combines partial annotations with self-supervision.

KeepTrack_teaser_figure

LWL (ECCV 2020)

[Paper] [Raw results] [Models] [Training Code] [Tracker Code]

Official implementation of the LWL tracker. LWL is an end-to-end trainable video object segmentation architecture which captures the current target object information in a compact parametric model. It integrates a differentiable few-shot learner module, which predicts the target model parameters using the first frame annotation. The learner is designed to explicitly optimize an error between target model prediction and a ground truth label. LWL further learns the ground-truth labels used by the few-shot learner to train the target model. All modules in the architecture are trained end-to-end by maximizing segmentation accuracy on annotated VOS videos.

LWL overview figure

KYS (ECCV 2020)

[Paper] [Raw results] [Models] [Training Code] [Tracker Code]

Official implementation of the KYS tracker. Unlike conventional frame-by-frame detection based tracking, KYS propagates valuable scene information through the sequence. This information is used to achieve an improved scene-aware target prediction in each frame. The scene information is represented using a dense set of localized state vectors. These state vectors are propagated through the sequence and combined with the appearance model output to localize the target. The network is learned to effectively utilize the scene information by directly maximizing tracking performance on video segments KYS overview figure

PrDiMP (CVPR 2020)

[Paper] [Raw results] [Models] [Training Code] [Tracker Code]

Official implementation of the PrDiMP tracker. This work proposes a general formulation for probabilistic regression, which is then applied to visual tracking in the DiMP framework. The network predicts the conditional probability density of the target state given an input image. The probability density is flexibly parametrized by the neural network itself. The regression network is trained by directly minimizing the Kullback-Leibler divergence.

DiMP (ICCV 2019)

[Paper] [Raw results] [Models] [Training Code] [Tracker Code]

Official implementation of the DiMP tracker. DiMP is an end-to-end tracking architecture, capable of fully exploiting both target and background appearance information for target model prediction. It is based on a target model prediction network, which is derived from a discriminative learning loss by applying an iterative optimization procedure. The model prediction network employs a steepest descent based methodology that computes an optimal step length in each iteration to provide fast convergence. The model predictor also includes an initializer network that efficiently provides an initial estimate of the model weights.

DiMP overview figure

ATOM (CVPR 2019)

[Paper] [Raw results] [Models] [Training Code] [Tracker Code]

Official implementation of the ATOM tracker. ATOM is based on (i) a target estimation module that is trained offline, and (ii) target classification module that is trained online. The target estimation module is trained to predict the intersection-over-union (IoU) overlap between the target and a bounding box estimate. The target classification module is learned online using dedicated optimization techniques to discriminate between the target object and background.

ATOM overview figure

ECO/UPDT (CVPR 2017/ECCV 2018)

[Paper] [Models] [Tracker Code]

An unofficial implementation of the ECO tracker. It is implemented based on an extensive and general library for complex operations and Fourier tools. The implementation differs from the version used in the original paper in a few important aspects.

  1. This implementation uses features from vgg-m layer 1 and resnet18 residual block 3.
  2. As in our later UPDT tracker, seperate filters are trained for shallow and deep features, and extensive data augmentation is employed in the first frame.
  3. The GMM memory module is not implemented, instead the raw projected samples are stored.

Please refer to the official implementation of ECO if you are looking to reproduce the results in the ECO paper or download the raw results.

Associated trackers

We list associated trackers that can be found in external repositories.

E.T.Track (WACV 2023)

[Paper] [Code]

Official implementation of E.T.Track. E.T.Track utilized our proposed Exemplar Transformer, a transformer module utilizing a single instance level attention layer for realtime visual object tracking. E.T.Track is up to 8x faster than other transformer-based models, and consistently outperforms competing lightweight trackers that can operate in realtime on standard CPUs.

ETTrack_teaser_figure

Installation

Clone the GIT repository.

git clone https://github.com/visionml/pytracking.git

Clone the submodules.

In the repository directory, run the commands:

git submodule update --init  

Install dependencies

Run the installation script to install all the dependencies. You need to provide the conda install path (e.g. ~/anaconda3) and the name for the created conda environment (here pytracking).

bash install.sh conda_install_path pytracking

This script will also download the default networks and set-up the environment.

Note: The install script has been tested on an Ubuntu 18.04 system. In case of issues, check the detailed installation instructions.

Windows: (NOT Recommended!) Check these installation instructions.

Let's test it!

Activate the conda environment and run the script pytracking/run_webcam.py to run ATOM using the webcam input.

conda activate pytracking
cd pytracking
python run_webcam.py dimp dimp50    

What's next?

pytracking - for implementing your tracker

ltr - for training your tracker

Contributors

Main Contributors

Guest Contributors

Acknowledgments

pytracking's People

Contributors

2006pmach avatar akuznetsa avatar chetanpandey1266 avatar dongfangduoshou123 avatar felja633 avatar goutamgmb avatar hugofeng avatar lcsama avatar martin-danelljan avatar mattpfr avatar menelaoskanakis avatar scottwedge avatar shashikant-ghangare avatar songheony avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pytracking's Issues

AttributeError: 'JPEG' object has no attribute 'decompressor'

Hello, thank you for your excellent work.
my python = 3.5 , my pytorch = 0.4.1 , my cuda = 9.0
I have successfully started training ATOM on the imagenetvid dataset, as shown below:
[train: 5, 5 / 1000] FPS: 21.1 (23.9) , Loss/iou: 0.03104 , Loss/total: 0.03104
[train: 5, 6 / 1000] FPS: 25.0 (338.9) , Loss/iou: 0.03108 , Loss/total: 0.03108
[train: 5, 7 / 1000] FPS: 28.9 (361.6) , Loss/iou: 0.03132 , Loss/total: 0.03132
[train: 5, 8 / 1000] FPS: 32.6 (363.5) , Loss/iou: 0.03093 , Loss/total: 0.03093

image

but every epoch gets an error before it starts, without affecting the run and the preservation of the model:
ERROR: Could not read image "/home/ly/disk2/xqian/DaSiamRPN/code/data/ILSVRC2015/Data/VID/train/ILSVRC2015_VID_train_0000/ILSVRC2015_train_00117001/000154.JPEG"
Could not load libjpeg-turbo library
Using opencv_loader instead.
ERROR: Could not read image "/home/ly/disk2/xqian/DaSiamRPN/code/data/ILSVRC2015/Data/VID/train/ILSVRC2015_VID_train_0001/ILSVRC2015_train_00238001/000093.JPEG"
Could not load libjpeg-turbo library
Using opencv_loader instead.
ERROR: Could not read image "/home/ly/disk2/xqian/DaSiamRPN/code/data/ILSVRC2015/Data/VID/train/ILSVRC2015_VID_train_0000/ILSVRC2015_train_00069007/000005.JPEG"
ERROR: Could not read image "/home/ly/disk2/xqian/DaSiamRPN/code/data/ILSVRC2015/Data/VID/train/ILSVRC2015_VID_train_0001/ILSVRC2015_train_00259029/000136.JPEG"
Could not load libjpeg-turbo library
Could not load libjpeg-turbo library
Using opencv_loader instead.
Using opencv_loader instead.
Exception ignored in: <bound method JPEG.del of <jpeg4py._py.JPEG object at 0x7fa89aae7a58>>
Traceback (most recent call last):
File "/home/ly/.envs/xq/lib/python3.5/site-packages/jpeg4py/_py.py", line 215, in del
if self.decompressor is not None:
AttributeError: 'JPEG' object has no attribute 'decompressor'
Exception ignored in: <bound method JPEG.del of <jpeg4py._py.JPEG object at 0x7f8cbd876a58>>
Traceback (most recent call last):
File "/home/ly/.envs/xq/lib/python3.5/site-packages/jpeg4py/_py.py", line 215, in del
if self.decompressor is not None:
AttributeError: 'JPEG' object has no attribute 'decompressor'
Exception ignored in: <bound method JPEG.del of <jpeg4py._py.JPEG object at 0x7f6c2eba7a20>>
Traceback (most recent call last):
File "/home/ly/.envs/xq/lib/python3.5/site-packages/jpeg4py/_py.py", line 215, in del
if self.decompressor is not None:
AttributeError: 'JPEG' object has no attribute 'decompressor'
Exception ignored in: <bound method JPEG.del of <jpeg4py._py.JPEG object at 0x7f5145360a90>>

Could you please tell me how I need to fix it? thank you!

AttributeError: 'ATOMSampler' object has no attribute 'sequence_list'

Hello,Thank you for your answer to my last question.
Let me say it again for clarity:
my python = 3.5 , my pytorch = 0.4.1 , my cuda = 9.0
when I used the imagenetvid datasets to train the ATOM, and I run the "python
run_training.py bbreg atom_default"

  1. Firstly:
    File "../ltr/data/sampler.py", line 95, in getitem
    is_video_dataset = dataset.is_video_sequence()
    TypeError: is_video_sequence() missing 1 required positional argument: 'self'

    File "../ltr/data/sampler.py", line 102, in getitem
    seq_id = random.randint(0, dataset.get_num_sequences() - 1)
    TypeError: get_num_sequences() missing 1 required positional argument: 'self'

    I added self in the appropriate place.
    2.Secondly,I got the error:
    File "../ltr/dataset/imagenetvid.py", line 64, in get_num_sequences
    return len(self.sequence_list)
    AttributeError: 'ATOMSampler' object has no attribute 'sequence_list'

    Could you please tell me how I need to fix it? thank you!

Pooled features with the coefficient vector

Hi:
Thank yours work. Recently when read ATOM paper and code, the sentence in the paper at Figure3, "The pooled features are modulated by channel-wise multiplication with the coefficient vector returned by the reference branch." In the file atom_iou_net.py, the features before PrPool layers are modulated with coefficient vector, instead of the features after PrPool layers. The code show in below picture at red rectangle. Whether I misunderstood it?
Screenshot from 2019-07-20 18-56-05

python run_tracker.py strange information.

Hello,
I installed the pytracking toolkit using provided install.sh (I found that I installed pytorch 1.1.0 with install.sh scirpt, I am not sure it is okay or not) on my ubuntu 16.04 with two GPUs (TaitanX and Tesla K40). And when I run commend: "python run_tracker.py atom default --sequence Soccer"
it gave the message:

"(pytracking) root@aiserver-desktop:/home/aiserver/pytracking/pytracking# python run_tracker.py atom default --sequence Soccer
Tracker: atom default None , Sequence: Soccer
Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location='cpu' to map your storages to the CPU.
Done"

Could you help me out this probelm, thanks!

unknown error in running [run_webcam.py]

When I run the cmd--"python run_webcam.py atom default", the error occured。the error is 'ModuleNotFoundError: No module named 'dlframework.common.utils''。I don't know why it have this error。
Please help。

Can't download the .pth file.

I'm sorry I can't download 'atom_fault.pth' and 'resnet18_vggmconv1.pth' from Google in China. Could you please provide other download links?

The normalization in `get_features` makes features larger.

Hi, thanks for making the the amazon work open source.

In the following code of featurebase.py:

# Normalize
if self.normalize_power is not None:
  for feat in feat_list:
    feat /= (torch.sum(feat.abs().view(feat.shape[0],1,1,-1)**self.normalize_power, dim=3, keepdim=True) /
      (feat.shape[1]*feat.shape[2]*feat.shape[3]) + 1e-10)**(1/self.normalize_power)

Before normalization, in my run, the feat.norm() was 379.7865, while after the normalization feat.norm() was 1381.1995.

I found that the (feat.shape[1]*feat.shape[2]*feat.shape[3]) in denominator actually enlarges the feat by (feat.shape[1]*feat.shape[2]*feat.shape[3]) ** (1 / self.normalize_power) times.

So, is this intended or a mistake? Thanks.

Bug in traing COCO2014

I find there is a bug when adding the coco2014 dataset into training set,

that is

"File "../ltr/data/processing_utils.py", line 35, in sample_target
raise Exception('Too small bounding box.')
Exception: Too small bounding box."

I have checked the coco dataset and find that the bug is from the image 'train2014/COCO_train2014_000000550395.jpg', and the corresponding anno is

'{'segmentation': [[9.98, 188.56, 15.52, 188.56, 15.52, 188.56, 11.09, 188.56]], 'area': 0.0, 'iscrowd': 0, 'image_id': 550395, 'bbox': [9.98, 188.56, 5.54, 0.0], 'category_id': 1, 'id': 2206849}'.

Maybe we should check the area for every bbox.

training time

sorry to bother, how long when you training the model, and Machine configuration?

How to plot the confidence map?

Could u please tell me how to plot the confidence map of the correlation result? just like in your paper? Thank you every much.

How to put different subprocesses on different GPUs?

Hello @martin-danelljan ,
Thanks for your great work!
I want to accelerate testing greatly by multiprocessing. However, if I double the number of subprocesses, the FPS will half. I find by nvidia-smi that different subprocesses run on the same GPU, which may cause blocking and slow FPS. So, how can I put different subprocesses on different GPUs to accelerate testing?

The model file cannot be downloaded normally

When I used install.sh, I found that the two model files default.pth could not be downloaded. Then I copied the link to the Google browser for download, but the downloaded files were indeed unusable.So could you please upload these two model files to github? Thank you very much #

ATOMSampler when dataset is not video_dataset

**In ATOMSampler getitem(self, index) function
when select a dataset which is not a video_dataset,
the sampled train_frame_ids and test_frame_ids are
generated as follows:
train_frame_ids = [1]*self.num_train_frames
test_frame_ids = [1]*self.num_test_frames

Problem: I have test for example [1] * 5 in python3.5, which result is a list [1, 1, 1, 1, 1] , so if self.num_test_frames = 5, then test_frame_ids will be always [1, 1, 1, 1, 1], so the result
of all 5 test_frames are always equal to the first frame of the sequence,has not any Randomness, train_frames is the same, is it a bug?
**
`

class

ATOMSampler(torch.utils.data.Dataset):

def __getitem__(self, index):
    # Select a dataset
   ........
   ........

    if is_video_dataset:
       .......
    else:
        train_frame_ids = [1]*self.num_train_frames
        test_frame_ids = [1]*self.num_test_frames

    # Get frames
    train_frames, train_anno, _ = dataset.get_frames(seq_id, train_frame_ids, anno)
    test_frames, test_anno, _ = dataset.get_frames(seq_id, test_frame_ids, anno)

    # Prepare data
    data = TensorDict({'train_images': train_frames,
                       'train_anno': train_anno,
                       'test_images': test_frames,
                       'test_anno': test_anno,
                       'dataset': dataset.get_name()})

    # Send for processing
    return self.processing(data)

`

torch.autograd.grad is slow

Hi,

I'm trying to implementing my own tracker using the online classification module in this repo.

I'm using the detached feature with size 31*31, depth 256 from backbone while keeping the batch size to default 250, but running torch.autograd.grad to update the response matrix in ConvProblem is extremely slow (costs about 0.42s).

a

For comparision, torch.autograd.grad in ATOM only costs about 0.0006s.(I'm using the same environment configruation. When using the layer2 with size 36*36, it costs 0.0007s. So I assume it has nothing to do with the spatial size or channel size)

b

Another strange thing is that reducing the batch size to 33 yields the same 0.0006s running time, but changing it to 34 yields 0.09s (about 150 times increase).

Also, I observed that running torch.autograd.grad increases GPU memory size from 1011M to 3045M in ATOM, while in my implementation, memory size keeps unchanged at 2103M after loading the initial 30 samples.

Do you have any idea why is the case?

Many thanks for your time.

Can I run a tracker on a video?

I saw a python file named run_video.py, which I guess it allows me to test the tracker on a video.
So, I run the following command in the command line:

python run_video.py atom default ~/Videos/PETS09-S2L1.mp4

But, I got the following error

I investigated the error and found that it failed to load a feature extractor network in
/pytracking/features/deep.py and returns the following error:

_pickle.UnpicklingError: invalid load key, '<'.

Could you please tell me what am I missing here?

Can not compile Precision Pooling library.

Tracker: atom default 0 , Sequence: Basketball
/home/dl/anaconda3/lib/python3.7/site-packages/torch/nn/functional.py:2539: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
"See the documentation of nn.Upsample for details.".format(mode))
Using /tmp/torch_extensions as PyTorch extensions root...
Detected CUDA files, patching ldflags
Emitting ninja build file /tmp/torch_extensions/prroi_pooling/build.ninja...
Building extension module prroi_pooling...
[1/3] c++ -MMD -MF prroi_pooling_gpu.o.d -DTORCH_EXTENSION_NAME=prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/dl/anaconda3/lib/python3.7/site-packages/torch/include -isystem /home/dl/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/dl/anaconda3/lib/python3.7/site-packages/torch/include/TH -isystem /home/dl/anaconda3/lib/python3.7/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /home/dl/anaconda3/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/dl/qiqi/pytracking-master/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c -o prroi_pooling_gpu.o
[2/3] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/dl/anaconda3/lib/python3.7/site-packages/torch/include -isystem /home/dl/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/dl/anaconda3/lib/python3.7/site-packages/torch/include/TH -isystem /home/dl/anaconda3/lib/python3.7/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /home/dl/anaconda3/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS
-D__CUDA_NO_HALF_CONVERSIONS
-D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -std=c++11 -c /home/dl/qiqi/pytracking-master/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu -o prroi_pooling_gpu_impl.cuda.o
[3/3] c++ prroi_pooling_gpu.o prroi_pooling_gpu_impl.cuda.o -shared -L/usr/local/cuda/lib64 -lcudart -o _prroi_pooling.so
Loading extension module _prroi_pooling...
Can not compile Precise RoI Pooling library.

I can't compile Precise RoI Pooling library. Error building extension '_prroi_pooling'

My cuda=9.0, other configurations follow the installations
when I ran the command "python run_tracker.py atom default --sequence Crossing --debug 0 --threads 6". something went wrong.Could you give me some advice? Thanks
Errors like this:
Emitting ninja build file /tmp/torch_extensions/prroi_pooling/build.ninja...
Building extension module prroi_pooling...
[1/3] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem ..........
-D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS
-D__CUDA_NO_HALF_CONVERSIONS
_ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -std=c++11 -c /home1/ads/pytracking-master/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu -o prroi_pooling_gpu_impl.cuda.o

FAILED: prroi_pooling_gpu_impl.cuda.o

/home1/ads/pytracking-master/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu(1): error: expected a declaration

1 error detected in the compilation of "/tmp/tmpxft_0000becb_00000000-6_prroi_pooling_gpu_impl.cpp1.ii".

Size of w2 in target classificatin module

@martin-danelljan
Thanks for your algorithm and implementation, both of which are perfect! However, I have been bothering by a question for a long time. In pytracking/parameter/atom/default.py, the default size of w2 in target classification module is 4x4. Why did you choose the even size rather than odd size such as 3x3 or 5x5? Doesn't even size lead to inaccurate locating? What's its advantages of 4x4 over 3x3 or 5x5?

About extract features

Hi,
I have a question. In the paper, your take backbone features from ResNet-18 Block3
and Block4 as input. But, you take features ResNet-18 Block2 and Block3 as input in the code. is it?

init_label_function for classification online train

Hi,
In init_label_function, I understand " (self.pos ) / (self.target_scale * self.img_support_sz)" will normalize the coordinate of target's center to [0,1], But I cannot understand " (self.pos - self.pos.round()) / (self.target_scale * self.img_support_sz)", what self.pos - self.pos.round() is mean? Need your explain,Thank you very much!

`
def init_label_function(self, train_x):
# Allocate label function
self.y = TensorList([x.new_zeros(self.params.sample_memory_size, 1, x.shape[2], x.shape[3]) for x in train_x])

    # Output sigma factor
    output_sigma_factor = self.fparams.attribute('output_sigma_factor')
    self.sigma = (self.feature_sz / self.img_support_sz * self.base_target_sz).prod().sqrt() * output_sigma_factor * torch.ones(2)

    # Center pos in normalized coords
    target_center_norm = (self.pos - self.pos.round()) / (self.target_scale * self.img_support_sz)

    # Generate label functions
    for y, sig, sz, ksz, x in zip(self.y, self.sigma, self.feature_sz, self.kernel_size, train_x):
        center_pos = sz * target_center_norm + 0.5 * torch.Tensor([(ksz[0] + 1) % 2, (ksz[1] + 1) % 2])
        for i, T in enumerate(self.transforms[:x.shape[0]]):
            sample_center = center_pos + torch.Tensor(T.shift) / self.img_support_sz * sz
            y[i, 0, ...] = dcf.label_function_spatial(sz, sig, sample_center)

    # Return only the ones to use for initial training
    return TensorList([y[:x.shape[0], ...] for y, x in zip(self.y, train_x)])

`

Can this project work with CPU?

/home/l/anaconda3/envs/pytorch/bin/python3 /home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/run_tracker.py atom default
Tracker: atom default None , Sequence: ants1
Using /tmp/torch_extensions as PyTorch extensions root...
Traceback (most recent call last):
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/run_tracker.py", line 79, in
main()
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/run_tracker.py", line 75, in main
run_tracker(args.tracker_name, args.tracker_param, args.runid, args.dataset, args.sequence, args.debug, args.threads)
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/run_tracker.py", line 60, in run_tracker
run_dataset(dataset, trackers, debug, threads)
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../pytracking/evaluation/running.py", line 54, in run_dataset
run_sequence(seq, tracker_info, debug=debug)
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../pytracking/evaluation/running.py", line 21, in run_sequence
tracked_bb, exec_times = tracker.run(seq, debug=debug)
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../pytracking/evaluation/tracker.py", line 58, in run
output_bb, execution_times = tracker.track_sequence(seq)
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../pytracking/tracker/base/basetracker.py", line 34, in track_sequence
self.initialize(image, sequence.init_state)
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../pytracking/tracker/atom/atom.py", line 31, in initialize
self.initialize_features()
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../pytracking/tracker/atom/atom.py", line 19, in initialize_features
self.params.features.initialize()
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../pytracking/features/extractor.py", line 16, in initialize
f.initialize()
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../pytracking/features/deep.py", line 95, in initialize
self.net, _ = load_network(net_path_full, backbone_pretrained=False)
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../ltr/admin/loading.py", line 70, in load_network
net = net_constr.get()
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../ltr/admin/model_constructor.py", line 43, in get
net_module = importlib.import_module(self.fun_module)
File "/home/l/anaconda3/envs/pytorch/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 978, in _gcd_import
File "", line 961, in _find_and_load
File "", line 936, in _find_and_load_unlocked
File "", line 205, in _call_with_frames_removed
File "", line 978, in _gcd_import
Detected CUDA files, patching ldflags
File "", line 961, in _find_and_load
File "", line 950, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 678, in exec_module
File "", line 205, in _call_with_frames_removed
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../ltr/models/bbreg/init.py", line 1, in
from .atom_iou_net import AtomIoUNet
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../ltr/models/bbreg/atom_iou_net.py", line 4, in
from ltr.external.PreciseRoIPooling.pytorch.prroi_pool import PrRoIPool2D
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../ltr/external/PreciseRoIPooling/pytorch/prroi_pool/init.py", line 12, in
from .prroi_pool import *
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../ltr/external/PreciseRoIPooling/pytorch/prroi_pool/prroi_pool.py", line 14, in
from .functional import prroi_pool2d
File "/home/l/Documents/17ICCV2019/projects/ATOM/pytracking/pytracking/../ltr/external/PreciseRoIPooling/pytorch/prroi_pool/functional.py", line 22, in
verbose=True
File "/home/l/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 645, in load
is_python_module)
File "/home/l/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 815, in _jit_compile
with_cuda=None)
File "/home/l/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 845, in _write_ninja_file_and_build
verbose)
File "/home/l/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 910, in _prepare_ldflags
extra_ldflags.append('-L{}'.format(_join_cuda_home('lib64')))
File "/home/l/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1122, in _join_cuda_home
raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.

Got very high robustness score when evaluating on VOT2018

Thanks for your great job first. However, when i evaluating the ATOM using the atom_default.pth checkpoint, I got very high robustness score. And when i check the visualized result of the bad cases, they shows that the tracker lost the target.

eval_result:

|------------------------------------------------------------
|Tracker Name| Accuracy | Robustness | Lost Number | EAO |
|------------------------------------------------------------
| atom_ | 0.602 | 2.852 | 609.0 | 0.037 |
|------------------------------------------------------------

details:

Done[1]: drone_flip[113] Lost: 18
Done[2]: fernando[292] Lost: 1
Done[3]: soccer2[129] Lost: 1
Done[4]: helicopter[708] Lost: 0
Done[5]: dinosaur[326] Lost: 2
Done[6]: iceskater1[661] Lost: 0
Done[7]: handball2[402] Lost: 13
Done[8]: book[175] Lost: 0
Done[9]: bolt2[293] Lost: 1
Done[10]: tiger[365] Lost: 0
Done[11]: shaking[365] Lost: 0
Done[12]: drone1[355] Lost: 53
Done[13]: ball1[105] Lost: 0
Done[14]: rabbit[158] Lost: 24
Done[15]: bolt1[350] Lost: 56
Done[16]: sheep[251] Lost: 0
Done[17]: glove[120] Lost: 6
Done[18]: ball2[41] Lost: 1
Done[19]: birds1[339] Lost: 38
Done[20]: godfather[366] Lost: 2
Done[21]: gymnastics3[118] Lost: 9
Done[22]: crossing[131] Lost: 0
Done[23]: conduction1[345] Lost: 12
Done[24]: leaves[63] Lost: 5
Done[25]: crabs1[160] Lost: 25
Done[26]: iceskater2[707] Lost: 4
Done[27]: blanket[225] Lost: 0
Done[28]: gymnastics2[240] Lost: 0
Done[29]: pedestrian1[140] Lost: 0
Done[30]: road[558] Lost: 0
Done[31]: motocross2[61] Lost: 0
Done[32]: basketball[725] Lost: 40
Done[33]: graduate[844] Lost: 0
Done[34]: frisbee[248] Lost: 0
Done[35]: motocross1[164] Lost: 1
Done[36]: bmx[76] Lost: 0
Done[37]: car1[742] Lost: 0
Done[38]: soccer1[392] Lost: 17
Done[39]: wiper[341] Lost: 0
Done[40]: fish1[366] Lost: 34
Done[41]: zebrafish1[400] Lost: 49
Done[42]: hand[267] Lost: 1
Done[43]: butterfly[151] Lost: 0
Done[44]: drone_across[147] Lost: 16
Done[45]: fish3[519] Lost: 0
Done[46]: ants3[579] Lost: 7
Done[47]: singer2[366] Lost: 5
Done[48]: soldier[138] Lost: 5
Done[49]: bag[196] Lost: 0
Done[50]: singer3[131] Lost: 0
Done[51]: nature[999] Lost: 120
Done[52]: traffic[191] Lost: 0
Done[53]: girl[1500] Lost: 6
Done[54]: gymnastics1[567] Lost: 1
Done[55]: fish2[310] Lost: 17
Done[56]: racing[156] Lost: 0
Done[57]: flamingo1[1377] Lost: 11
Done[58]: ants1[325] Lost: 0
Done[59]: handball1[377] Lost: 3
Done[60]: matrix[100] Lost: 5
Done ALL

The problem about pretrained model "atom_default.pth"

I found a problem when downloaded pretrained model "atom_default.pth".
Firstly, I download the model by using the command "bash pytracking/utils/gdrive_download 1JUB3EucZfBk3rX7M3_q5w_dLBqsT7s-M pytracking/networks/atom_default.pth
"in "INSTALL.md". It shows that "Saved: pytracking/networks/atom_default.pth
DONE!", however the model is 0 bytes. So I go to the google drive to download the model file. When finished, I cannot unzip the model file and it says that An error occurred while loading the archive. could u please upload the model file "atom_default.pth" again? thank you

Performance gap on OTB2015

Thank you for your excellent work and sharing!
I trained the atom using the source code, and all configurations and employed training sets are same as those in the source code. Then, use the last epoch to test on OTB2015. However, compared the released model whose AUC on OTB2015 is 0.678, I only get 0.657 AUC with the model trained by myself.

AttributeError: 'float' object has no attribute 'is_video_sequence'

Thank you for your excellent work !
my python = 3.5 , my pytorch = 0.4.1 , my cuda = 9.0
when I used the imagenetvid datasets to train the ATOM, and I run the "python
run_training.py bbreg atom_default"

  1. I got the first error:
    File "../ltr/data/sampler.py", line 93, in getitem
    dataset = random.choices(self.datasets, self.p_datasets)[0]
    AttributeError: module 'random' has no attribute 'choices'

    This error is that my python version is 3.5,and I made the following changes:
    dataset = random.choice([self.datasets, self.p_datasets])[0]
    So,I'm not sure if I did it right.
  2. After correcting according to error 1, I encountered a second error:
    File "../ltr/data/sampler.py", line 94, in getitem
    is_video_dataset = dataset.is_video_sequence()
    AttributeError: 'float' object has no attribute 'is_video_sequence'

    Could you please tell me how I need to fix it? thank you!

sorry

@martin-danelljan First time contact, I don't know how to use it, can you help me?What about his speed?

Error building extension '_prroi_pooling'

                           !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (c++) may be ABI-incompatible with PyTorch!
Please use a compiler that is ABI-compatible with GCC 4.9 and above.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.

See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6
for instructions on how to install GCC 4.9 or higher.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                          !! WARNING !!

warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler))

RuntimeError: Error building extension '_prroi_pooling': [1/2] c++ -MMD -MF prroi_pooling_gpu.o.d -DTORCH_EXTENSION_NAME=_prroi_pooling -I/home/fsj/atom-tracking/lib/python3.6/site-packages/torch/lib/include -I/home/fsj/atom-tracking/lib/python3.6/site-packages/torch/lib/include/TH -I/home/fsj/atom-tracking/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/fsj/atom-tracking/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/fsj/atom-tracking/atom/pytracking/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c -o prroi_pooling_gpu.o
FAILED: prroi_pooling_gpu.o
c++ -MMD -MF prroi_pooling_gpu.o.d -DTORCH_EXTENSION_NAME=_prroi_pooling -I/home/fsj/atom-tracking/lib/python3.6/site-packages/torch/lib/include -I/home/fsj/atom-tracking/lib/python3.6/site-packages/torch/lib/include/TH -I/home/fsj/atom-tracking/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/fsj/atom-tracking/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/fsj/atom-tracking/atom/pytracking/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c -o prroi_pooling_gpu.o
/home/fsj/atom-tracking/atom/pytracking/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c:12:29: fatal error: torch/extension.h: No such file or directory
#include <torch/extension.h>
^
compilation terminated.
ninja: build stopped: subcommand failed.

no checkpoint file

Hello,I run the command "python run_webcam.py atom default".But shows:
Traceback (most recent call last):
File "run_webcam.py", line 35, in
main()
File "run_webcam.py", line 31, in main
run_webcam(args.tracker_name, args.tracker_param, args.debug)
File "run_webcam.py", line 20, in run_webcam
tracker.run_webcam(debug)
File "../pytracking/evaluation/tracker.py", line 94, in run_webcam
tracker.track_webcam()
File "../pytracking/tracker/base/basetracker.py", line 179, in track_webcam
self.initialize_features()
File "../pytracking/tracker/atom/atom.py", line 19, in initialize_features
self.params.features.initialize()
File "../pytracking/features/extractor.py", line 16, in initialize
f.initialize()
File "../pytracking/features/deep.py", line 95, in initialize
self.net, _ = load_network(net_path_full, backbone_pretrained=False)
File "../ltr/admin/loading.py", line 36, in load_network
raise Exception('No matching checkpoint file found')
Exception: No matching checkpoint file found

I check the model file in /networks, it is there. and the local.py shows that "settings.network_path = '/home/bill/Documents/pytracking/pytracking/networks/'",however the probelm still happen.

tracker on the VOT2018

Thanks for releasing the code of such excellent paper!
Does the test on the VOT2018 directly put the tracking results generated by this code into the ‘run analysis. m’ of the vot-toolkit to get the final result?

Question: Target Scale in ATOM

Hello,

Well written paper and great code!

In my quest of understanding ATOM, I'm currently at a stage where I want to display the search area used by the tracker. When the search area is calculated it is compared to a maximum threshold (max_image_sample_size) and a minimum threshold (min_image_sample_size) to obtain the new target scale.

if search_area > self.params.max_image_sample_size:
self.target_scale = math.sqrt(search_area / self.params.max_image_sample_size)
elif search_area < self.params.min_image_sample_size:
self.target_scale = math.sqrt(search_area / self.params.min_image_sample_size)

But looking at these parameters, I got confused since both are set to the same value.

# Patch sampling parameters
params.max_image_sample_size = (18*16)**2 # Maximum image sample size
params.min_image_sample_size = (18*16)**2 # Minimum image sample size

Shouldn't the two parameters be different from each other?

In the meantime, thanks for your time and efforts.
Regards!

A problem about training

Hello, thank you for your excellent work.
my python = 3.5 , my pytorch = 0.4.1 , my cuda = 9.0
I have successfully trained on vid dataset and tested on OTB100 dataset according to your guidance, but I need to retrain with single channel grayscale map, could you please give me some guidance on how to do it? Since I have suffered many mistakes, thank you!

About the pretrained model ResNetVGGm1

Hello, thanks for your nice work! Can you tell me the source of vggmconv1 features used in your ResNetVGGm1 model? I failed to find the complete model of vgg-m with the input(mean and std) that is the same as resnet18. Thanks a lot if you could provide the source of the complete vgg-m model:)
sincerely~

Seq KiteSurf etx error in otb

In the file pytracking/pytracking/evaluation/otbdataset.py
line: 123
{"name": "KiteSurf", "path": "KiteSurf/img", "startFrame": 1, "endFrame": 84, "nz": 4, "ext": "png", "anno_path": "KiteSurf/groundtruth_rect.txt"},

The 'ext' should be "jpg" instead of "png" for the latest version of OTB dataset.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.