# 2018 NVIDIA AI City Challenge Team iamai
_News: We won **2nd place** on the 2018 NVIDIA AI City Challenge Track 3!_
Hi! We are participating team 37, **"iamai"**, of 2018 NVIDIA AI City Challenge Track 3.
This is the implementation of **"Vehicle Re-Identification with the Space-Time Prior"** _CVPRW, 2018_. \[[paper](http://media.ee.ntu.edu.tw/research/AIC2018/aic2018_wu.pdf)\]
Link to challenge website: https://www.aicitychallenge.org/
To clone this repo, please execute:
```
git clone --recurse-submodules https://github.com/cw1204772/AIC2018_iamai.git
```
If you've already clone this repo but haven't clone the submodule (`Tracking/iou-tracker`), execute:
```
git submodule init
git submodule update
```
Please cite our paper if you find our work helpful for you!
If you experience any bugs or problems, please contact us. (cwwu@media.ee.ntu.edu.tw)
## Introduction
This is an end-to-end vehicle detection, tracking, re-identification system built for 2018 AI City Challenge Track 3.
The proposed system contains three stages.
Given input videos, Vehicle Proposals propose vehicle detection bounding boxes.
Next, the Single Camera Tracking stage links the detection with high overlaps into a tracklet in each video sequence.
Meanwhile, the feature extracted from trained CNN is used to combine small tracklets into large tracklets.
The last Multi-Camera Matching stage groups the tracklets across all sequences by their CNN features.
Our vehicle Re-ID system can be easily applied to any other visual domain thanks to the core Adaptive Feature Learning (AFL) technique.
![system_overview](https://github.com/cw1204772/AIC2018_iamai/raw/master/system_overview.png "Illustration of our proposed vehicle Re-ID pipeline")
## Requirements
It requires both python 2 and 3 to run our system.
* Python 2.7 or newer:
Please install detectron \[[link](https://github.com/facebookresearch/Detectron)\], a powerful open-sourced object detector thanks to Facebook. Please refer to the INSTALL.md of detectron to install all dependencies for inference.
* Python 3.5 or newer:
Run `pip3 install -r requirements.txt` to install all dependence packages.
## Demo
Hurray!
We've managed to create a script for running the entire system!
Please follow the steps below:
1. Download all 2018 NVIDIA AI City Challenge Track 3 videos into `<DATASET_DIR>`.
Please contact the organizers for requesting the dataset: https://www.aicitychallenge.org/
2. Download the pre-trained Re-ID CNN model.
It should be noticed that **our model is for research only**, since we have agreed with the usage of VeRi, CompCars, BoxCars116k and 2018 NVIDIA AI City Challenge Track 3 datasets.
If you agree with the usage restriction, download the model \[[link](https://drive.google.com/open?id=1M-V-TilFg5yyVRsySCTOoFGgcn1HYlY3)\] to `ReID/ReID_CNN/`.
3. Execute:
```
./run.sh <DATASET_DIR> <WORK_DIR>
```
__\*\*Important**__
* `<WORK_DIR>` will be the storage place for intermediate product of our system. Make sure there is enough space for `<WORK_DIR>`! (We estimate at least 1.2TB of space!:open_mouth: Because we will unpact video into images for detection.)
* Also, please use absolute path for both `<DATASET_DIR>` and `<WORK_DIR>`.
* Expect to wait for a few days, or maybe, weeks, depending on your machine. (Yes, we are not exaggerating. Detection itself took weeks on our machine with 1 GTX1080Ti)
The final result will show up here: `<WORK_DIR>/MCT/fasta/track3.txt`.
(Assuming there are no bugs!:smiley:)
## Detail Guide
Here, we provide detail instructions for each stage of our system.
### I. Detection
We use detectron \[[link](https://github.com/facebookresearch/Detectron)\] for detection. Please refer to the INSTALL.md for detetron to install caffe2 and other dependencies for inference.
1. Convert all the videos to frames
We assume that you organize your videos dataset as the directory structure below:
```
/path/to/AIC_videos_dataset
|__Loc1_1.mp4
|__...
|__Loc4_3.mp4
```
After running:
```
python2 Utils/convert.py --video_dir_path /path/to/AIC_videos_dataset --images_dir_path /path/to/AIC_images_dataset
```
And the new directory structure will become:
```
/path/to/AIC_frames_dataset
|__Loc1_1
| |__<frame_1>.jpg
| |__...
| |__<frame_N>.jpg
|__...
|__Loc4_3
```
2. Infer frames for every locations
```
cd $AIC2018_iamai/Detection/
python2 tools/infer_simple_txt.py \
--cfg configs/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml \
--output-dir /path/to/submit \
--image-ext jpg \
--wts https://s3-us-west-2.amazonaws.com/detectron/35861858/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml.02_32_51.SgT4y1cO/output/train/coco_2014_train:coco_2014_valminusminival/generalized_rcnn/model_final.pkl \
/path/to/AIC_dataset
```
3. Suppress non-realistic bounding boxes
```
cd $AIC2018_iamai/Detection/
python2 tools/suppress.py --in_txt_file_path <input_txt> --out_txt_file_path <output_txt> --threshold 1e-5 --upper_area 1e5 --lower_side 25 --aspect_ratio 5
```
### II. Tracking
We use our optimized version of iou-tracker \[[link](https://github.com/cw1204772/iou-tracker)\] for tracking.
It will link detections into tracklets by simple IOU constraint within a video.
To use it, try:
```
python3 Tracking/iou-tracker/demo.py [-h] -d DETECTION_PATH -o OUTPUT_PATH [-sl SIGMA_L]
[-sh SIGMA_H] [-si SIGMA_IOU] [-tm T_MIN]
```
### III. Post-Tracking
In this step, we will extract keypoint images within each tracklet for every video.
To use it, try:
```
python3 ReID/Post_tracking.py [-h] [--dist_th DIST_TH] [--size_th SIZE_TH]
[--mask MASK] [--img_dir IMG_DIR]
tracking_csv video output
```
### IV. Train CNN Feature Extractor
We provide detail instructions for training CNN feature extractor in folder [ReID/ReID_CNN](https://github.com/cw1204772/AIC2018_iamai/tree/master/ReID/ReID_CNN).
If you're not interested in training one, we provide our own model here \[[link](https://drive.google.com/open?id=1M-V-TilFg5yyVRsySCTOoFGgcn1HYlY3)\].
Please take note that **our model is for research only**.
### V. Single Camera Tracking
In this step, we associate tracklets within a video by comparing features and space-time information.
To use it, try:
```
python3 ReID/SCT.py [-h] [--window WINDOW] [--f_th F_TH] [--b_th B_TH] [--verbose]
--reid_model REID_MODEL --n_layers N_LAYERS
[--batch_size BATCH_SIZE]
pkl output
```
### VI. Multi Camera Matching
There are a few matching methods to choose from, including the most successful `re-rank-4`.
To use it, try:
```
python3 ReID/MCT.py [-h] [--dump_dir DUMP_DIR] [--method METHOD] [--cluster CLUSTER]
[--normalize] [--k K] [--n N] [--sum SUM] [--filter FILTER]
tracks_dir output_dir
```
## Tools
Here is a visualization tool we create to cheer your eyes during the tedious running process.
```
python3 Utils/visualize.py [-h] [--w W] [--h H] [--fps FPS] [--length LENGTH]
[--delimiter DELIMITER] [--offset OFFSET]
[--frame_pos FRAME_POS] [--bbox_pos BBOX_POS]
[--id_pos ID_POS] [--score_pos SCORE_POS]
[--score_th SCORE_TH] [--cam CAM] [--cam_pos CAM_POS]
[--ss SS] [--wh_mode]
INPUT_VIDEO OUTPUT_VIDEO LABEL_FILE MODE
```
## References
* NVIDIA AI City Challenge. https://www.aicitychallenge.org/, 2018.
* R. Girshick, I. Radosavovic, G. Gkioxari, P. Dollar, and K. He. Detectron. https://github.com/facebookresearch/detectron, 2018.
* E. Bochinski, V. Eiselein, and T. Sikora. High-speed tracking-by-detection without using image information. AVSS, 2017.
* X. Liu
没有合适的资源?快使用搜索试试~ 我知道了~
一种多摄像头车辆检测、跟踪和再识别系统_python_代码_下载
共254个文件
py:114个
yaml:80个
jpg:12个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 102 浏览量
2022-07-02
18:02:43
上传
评论
收藏 5.12MB ZIP 举报
温馨提示
介绍 这是为 2018 AI City Challenge Track 3 打造的端到端车辆检测、跟踪、重识别系统。提议的系统包含三个阶段。给定输入视频,Vehicle Proposals 提出了车辆检测边界框。接下来,Single Camera Tracking 阶段将具有高重叠的检测链接到每个视频序列中的 tracklet。同时,从训练好的 CNN 中提取的特征用于将小轨迹组合成大轨迹。最后一个多摄像机匹配阶段通过它们的 CNN 特征对所有序列中的轨迹进行分组。得益于核心的自适应特征学习 (AFL) 技术,我们的车辆 Re-ID 系统可以轻松应用于任何其他视觉领域。 更多详情、使用方法,请下载后阅读README.md文件
资源推荐
资源详情
资源评论
收起资源包目录
一种多摄像头车辆检测、跟踪和再识别系统_python_代码_下载
(254个子文件)
zero_even_op.cc 1KB
Utils.cmake 10KB
Cuda.cmake 9KB
FindCuDNN.cmake 2KB
Dependencies.cmake 2KB
Summary.cmake 940B
zero_even_op.cu 2KB
Dockerfile 807B
.gitignore 144B
.gitmodules 116B
zero_even_op.h 1KB
Untitled3-checkpoint.ipynb 72B
Untitled6-checkpoint.ipynb 72B
Untitled7-checkpoint.ipynb 72B
Untitled4-checkpoint.ipynb 72B
Untitled-checkpoint.ipynb 72B
Untitled9-checkpoint.ipynb 72B
Untitled1-checkpoint.ipynb 72B
Untitled8-checkpoint.ipynb 72B
Untitled2-checkpoint.ipynb 72B
Untitled5-checkpoint.ipynb 72B
33823288584_1d21cf0a26_k_example_output.jpg 997KB
17790319373_bd19b24cfc_k_example_output.jpg 961KB
33823288584_1d21cf0a26_k.jpg 244KB
34501842524_3c858b3080_k.jpg 229KB
15673749081_767a7fa63a_k.jpg 220KB
18124840932_e42b3e377c_k.jpg 159KB
17790319373_bd19b24cfc_k.jpg 146KB
19064748793_bb942deea1_k.jpg 137KB
16004479832_a748d55f21_k.jpg 133KB
33887522274_eebd074106_k.jpg 119KB
24274813513_0cfd2ce6d0_k.jpg 111KB
ict.jpg 14KB
LICENSE 10KB
baseline_evaluation_FACT_776.m 3KB
voc_eval.m 1KB
compute_AP.m 944B
xVOCap.m 258B
get_voc_opts.m 231B
Makefile 491B
MODEL_ZOO.md 117KB
INSTALL.md 9KB
Readme.md 9KB
README.md 7KB
GETTING_STARTED.md 6KB
Readme.md 5KB
FAQ.md 3KB
README.md 3KB
CONTRIBUTING.md 1KB
NOTICE 1KB
NOTICE 917B
train_val_index.npy 295KB
system_overview.png 668KB
afl4.png 651KB
config.py 42KB
test.py 34KB
MCT.py 29KB
model_builder.py 23KB
utils.py 22KB
detector.py 19KB
json_dataset.py 19KB
train_joint.py 19KB
FPN.py 18KB
convert_pkl_to_pb.py 17KB
train.py 15KB
json_dataset_evaluator.py 15KB
test_engine.py 14KB
vis.py 14KB
retinanet.py 13KB
task_evaluation.py 13KB
boxes.py 13KB
model_convert_utils.py 12KB
retinanet_heads.py 12KB
net.py 12KB
rpn.py 12KB
fast_rcnn.py 12KB
loader.py 11KB
segms.py 9KB
rpn_generator.py 9KB
keypoints.py 9KB
Post_tracking.py 8KB
mask_rcnn_heads.py 8KB
pickle_caffe_blobs.py 8KB
generate_proposals.py 8KB
keypoint_rcnn_heads.py 8KB
ResNet.py 8KB
voc_eval.py 8KB
roidb.py 7KB
convert_cityscapes_to_coco.py 7KB
train.py 7KB
test_retinanet.py 7KB
voc_dataset_evaluator.py 7KB
test_cfg.py 7KB
blob.py 6KB
infer.py 6KB
data_loader_benchmark.py 6KB
dataset_catalog.py 6KB
create_Comp_database.py 6KB
visualize.py 6KB
infer_simple_txt.py 5KB
共 254 条
- 1
- 2
- 3
资源评论
- Oo觞寒oO2024-04-21感谢大佬,让我及时解决了当下的问题,解燃眉之急,必须支持!
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 使用 C 语言实现的计算非负整数的阶乘
- 2011-2021最新版本北京大学数字普惠金融指数(PKU-DFIIC).xlsx
- 县域数字乡村指数2018-2020(1).xlsx
- Docker容器配置进阶
- tensorflow-gpu-2.7.4-cp37-cp37m-manylinux2010-x86-64.whl
- 多段线、 圆、弧转多段线(仅我可见)
- tensorflow-2.7.2-cp38-cp38-manylinux2010-x86-64.whl
- 李慧琴C语言基础部分.zip
- yeyue-p8Yi4-ve4a83792.apk
- tensorflow-gpu-2.7.3-cp38-cp38-manylinux2010-x86-64.whl
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功