Giter VIP home page Giter VIP logo

aicity2020_dmt_vehiclereid's People

Contributors

heshuting555 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

aicity2020_dmt_vehiclereid's Issues

Failed to load resnet50_ibn_a_80.pth model

Hi there,

I was trying your pre-trained model(resnet50_ibn_a_80.pth: https://drive.google.com/file/d/14TTv8mEECkRLgtmmTMY9BPc70rhgmXcu/view?usp=sharing) using configuration: configs/baseline_veri_r50_a.yml.

And I made some little modification as I don't want to train it.

import os
from config import cfg
import argparse
from model import make_model


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="ReID Baseline Training")
    parser.add_argument(
        "--config_file", default="configs/baseline_veri_r50_a.yml", help="path to config file", type=str
    )
    parser.add_argument("opts", help="Modify config options using the command-line", default=None,
                        nargs=argparse.REMAINDER)

    args = parser.parse_args()



    if args.config_file != "":
        cfg.merge_from_file(args.config_file)
    cfg.merge_from_list(args.opts)
    cfg.freeze()

    os.environ['CUDA_VISIBLE_DEVICES'] = cfg.MODEL.DEVICE_ID

    # train_loader, val_loader, num_query, num_classes = make_dataloader(cfg)
    model = make_model(cfg, num_class=80)
    model.load_param('resnet50_ibn_a_80.pth')

    with torch.no_grad():
        print(model(torch.zeros((1, 3, 224, 224))).shape)

However, I cannot load your model. The logging loads like this:

using resnet50_ibn_a as a backbone
Traceback (most recent call last):
  File "try.py", line 30, in <module>
    model = make_model(cfg, num_class=80)
  File "AICITY2020_DMT_VehicleReID/model/make_model.py", line 124, in make_model
    model = Backbone(num_class, cfg)
  File "AICITY2020_DMT_VehicleReID/model/make_model.py", line 66, in __init__
    self.base.load_param(model_path)
  File "AICITY2020_DMT_VehicleReID/model/backbones/resnet_ibn_a.py", line 164, in load_param
    self.state_dict()[i.replace('module.','')].copy_(param_dict[i])
KeyError: 'base.conv1.weight'

Do you have any idea of what is going on? Thanks for your help in advance.

test-mining难以理解

作者你好, 我在阅读test-mining.py的时候,发现这一段难以理解.请问一下,这一段是起到什么作用呢?

    num = 0
    query_index = []
    while num <= 3102:
        if num == 0:
            query_index.append(0)
            num += 1
        max_sum = 0
        index_sum = []
        for index in range(len(distmat)):
            all_sum = 0
            flag = True
            if index not in query_index:
                for index_q in query_index:
                    all_sum += distmat[index][index_q]
                    if distmat[index][index_q] < thresh:
                        flag = False
                if all_sum > max_sum and flag:
                    max_sum = all_sum
                    index_sum.append(index)
        if index_sum == []:
            break
        else:
            index = index_sum.pop()
            query_index.append(index)
            num += 1
            #print(num,'num')

数据集与模型问题

你好!想知道完整的数据集应该在哪里下载呢,另外请问transformer的模型放置在哪里呢

数据测试

你好,请问一下怎么用训练的模型测试自己的图片images_test

No such file or directory: AIC20_track2/AIC20_ReID/train_track_id.txt

您好,
我在跑您的算法AICITY2020_DMT_VehicleReID的时候
执行test.py文件,报错Traceback (most recent call last):
File "/media/zq/train/code2/AICITY2020/test.py", line 43, in
train_loader, val_loader, num_query, num_classes = make_dataloader(cfg)
File "/media/zq/train/code2/AICITY2020/datasets/make_dataloader.py", line 53, in make_dataloader
dataset = __factory[cfg.DATASETS.NAMES](root=cfg.DATASETS.ROOT_DIR, plus_num_id=cfg.DATASETS.PLUS_NUM_ID)
File "/media/zq/train/code2/AICITY2020/datasets/aic_aicsim.py", line 31, in init
train = self._process_dir(self.train_dir, relabel=True)
File "/media/zq/train/code2/AICITY2020/datasets/aic_aicsim.py", line 71, in _process_dir
_, _, frame2trackID = self._process_track(path=self.train_track_path) #### Revised
File "/media/zq/train/code2/AICITY2020/datasets/aic_aicsim.py", line 121, in _process_track
file = open(path)
FileNotFoundError: [Errno 2] No such file or directory: '/media/zq/train/code2/data/AIC20_track2/AIC20_ReID/train_track_id.txt'
模型是您的预训练模型final_model/0409_3/resnet101_ibn_a_70.pth
cfg文件是 configs/baseline_aic_se.yml
这个train_track_id.txt文件是干啥的呀
为什么为执行测试命令,还需要train的文件

我下载的数据集是2021版本的,是因为数据集2020和2021的版本不一样吗?

Synthetic dataset

Hi everyone,

Sorry for this kind of question, but I saw there is a train_track_id.txt file called at the training stage, but I do not have it, where can I find it?

Thank you in advance.

Veri Dataset

Hi,
Is there a way in your code to visualize the result of your model on the veri dataset?

多模型叠加

python train.py --config_file='configs/baseline_aic.yml' OUTPUT_DIR "('/data/model/0402_5/')" ### here we get the model resnet101_ibn_a_80.pth in the 0402_5. 这个模型似乎训练后没有用到吗?

An error in triplet_loss.py

Hi!
I met an error when I run the code : File "...\triplet_loss.py", line 83, in hard_example_mining dist_an, relative_n_inds = torch.min( IndexError: min(): Expected reduction dim 1 to have non-zero size.
I don't know how to solve it. Can anyone help me?

query/gallery vehicle id and cam id.

Hi, I notice that there is no query and gallery ids in the data. In your code, the query vehicle ids are all '2' and cam ids are 1. I do not see how to evaluate models with these labels. Or do I miss something?

image

Thanks.

MDL中finetune阶段的baseline_aic_finetune.yml配置问题

你好!

run.sh前面两步:
python train.py --config_file='configs/baseline_aic.yml' OUTPUT_DIR "('/data/model/0402_5/')"
python train.py --config_file='configs/baseline_aic_finetune.yml' OUTPUT_DIR "('/data/model/0402_6/')"

我理解:
第一步是进行pre-train阶段,使用imagenet预训练模型,输出resnet101_ibn_a_80.pth
第二步是finetune阶段,使用resnet101_ibn_a_80.pth进行训练,冻结前两层,输出resnet101_ibn_a_40.pth

但是在baseline_aic_finetune.yml里,配置项
MODEL:
PRETRAIN_CHOICE: 'finetune'
PRETRAIN_PATH: '/data/model/0402_6/resnet101_ibn_a_40.pth'

这个PRETRAIN_PATH是不是写错了,应该是/0402_5/resnet101_ibn_a_80.pth? 否则在运行这个train之前,这个文件压根没有生成过?

谢谢!

Question about the baseline_aic_finetune.yml config file

Very nice project ! I compare with https://github.com/michuanhaohao/reid-strong-baseline/blob/master/configs/softmax_triplet.yml , and see some differences such as

IF_LABELSMOOTH: 'off' # origin is 'on'
SIZE_TRAIN: [320, 320] # origin is [256, 128]
OPTIMIZER_NAME: 'SGD' # origin is 'Adam'
MAX_EPOCHS: 40 # origin is 120
BASE_LR: 0.001 # origin is 0.00035
IMS_PER_BATCH: 96 # origin is 64
......

Can you share some experiences about how to choose these hyp? Thanks a lot !!

VeRi Dataset

I want to test this baseline on the VeRi-776.First I modified the '.yml' to my own path, then I modified 'veri.py',the root was modified to my own path 'root = "/home/zhang/D/LXF/AICITY2020_DMT_VehicleReID/data' in 'init',then I run 'python train.py --config_file='configs/baseline_veri_r50.yml' . the code reports a error "RuntimeError: '../data/VeRi' is not available
'" I ensure my path is right,and the dataset veri is available.why ? thank you

image

image

train VeRi dataset

Hi @heshuting555 ! thanks for your great work!

When I try to train the VeRi-776 dataset, I met a error.

python train.py --config_file='configs/baseline_veri_r50_a.yml' MODEL.DEVICE_ID "('3')" OUTPUT_DIR "('log/')"

the following is the result

Traceback (most recent call last):
  File "train.py", line 62, in <module>
    model = make_model(cfg, num_class=num_classes)
  File "/data/DMT/model/make_model.py", line 126, in make_model
    model = Backbone(num_class, cfg)
  File "/data/DMT/model/make_model.py", line 67, in __init__
    self.base.load_param(model_path)
  File "/data/DMT/model/backbones/resnet_ibn_a.py", line 164, in load_param
    self.state_dict()[i.replace('module.','')].copy_(param_dict[i])
KeyError: 'base.conv1.weight'

I used your weights resnet50_ibn_a_80.pth

Could you please help me? Thank you very much!

Question about `datasets/aic.py`

Hi, I have a question about loading query and gallery for AI-City dataset.

Why for query and gallery images, you set camid to 1 and pid to 2 in datasets/aic.py?
Is there any reason for that?
Thanks for helping!

def _process_dir_test(self, dir_path, relabel=False, query=True):
        img_paths = sorted(glob.glob(osp.join(dir_path, '*.jpg')))

        dataset = []
        _, _, frame2trackID = self._process_track(path=self.test_track_path)
        for img_path in img_paths:
            camid = 1
            pid = 2
            if query:
                dataset.append((img_path, pid, camid, -1))
            else:
                trackid = frame2trackID[int(img_path[-10:-4])]
                dataset.append((img_path, pid, camid, trackid))
        #print(len(dataset), 'len(dataset)')
        return dataset

track2.txt

您好,请问如何生成track2.txt文件

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.