ymzis69 / AlphaRefine_TensorRT

This repo only includes tensorRT version of AlphaRefine module, not including other base trackers
GNU General Public License v3.0
17 stars 1 forks source link

Need help converting the model to trt #1

Closed moooises closed 1 year ago

moooises commented 1 year ago

Hi, I'm having problems converting resnet34 (SEcmnet_ep0040-c.pth.tar) to .trt. I downloaded the pth.tar and place it the indicated folder and when I tried to run the suggested command

python ./arena/LaSOT/run_RF_RF.py --tracker_name siamrpn_r50_l234_dwxcorr --dataset UAV123 --convert_trt

I get an error that uav123.json doesn't exist. I search in the repository and find a uav123.json in the folder AlphaRefine_TensorRT/arena/GOT10K/toolkit/got10k/datasets and their fields match with folder in the dataset UAV123 that I can download in its website https://cemse.kaust.edu.sa/ivul/uav123, but I keep getting an error.

The error occur in the file AlphaRefine_TensorRT/pysot/toolkit/datasets/uav.py because it is trying to create a video map with the data from uav123.json

        with open(os.path.join(dataset_root, name+'.json'), 'r') as f:
            meta_data = json.load(f)

        # load videos
        pbar = tqdm(meta_data.keys(), desc='loading '+name, ncols=100)
        self.videos = {}
        for video in pbar:
            pbar.set_postfix_str(video)
            self.videos[video] = UAVVideo(video,
                                          dataset_root,
                                          meta_data[video]['video_dir'],
                                          meta_data[video]['init_rect'],
                                          meta_data[video]['img_names'],
                                          meta_data[video]['gt_rect'],
                                          meta_data[video]['attr'])

uav123.json doesn't have those fields, the structure of the .json is something like this.

{
    "UAV123": {
        "bike1": {
            "start_frame": 1,
            "end_frame": 3085,
            "folder_name": "bike1"
        },
        "bike2": {
            "start_frame": 1,
            "end_frame": 553,
            "folder_name": "bike2"
        },

It looks like the file that should be used is AlphaRefine_TensorRT/arena/GOT10K/toolkit/datasets/uav123.py, that it is in the directory where I found the uva123.json, but run_RF_RF.py calls the one in pysot.

So, can you guys help me? I have no clue how to fix it or what I am doing wrong. The tutorial doesn't explain either how to use the obtained trt layers in other tracker. I trying to use them to fast dimp50.

ymzis69 commented 1 year ago

Sorry, I just saw your issue. Because I haven't studied VOT for a long time, this problem may require you to debug it to solve.