Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
张佳预 09834782b6 | 11 months ago | |
---|---|---|
datasets | 11 months ago | |
figure | 11 months ago | |
models | 11 months ago | |
resources | 11 months ago | |
util | 11 months ago | |
.gitignore | 11 months ago | |
LICENSE | 11 months ago | |
README.md | 11 months ago | |
README_EN.md | 11 months ago | |
coco.sh | 11 months ago | |
engine.py | 11 months ago | |
infer_image.py | 11 months ago | |
infer_image2video.py | 11 months ago | |
infer_video.py | 11 months ago | |
main.py | 11 months ago | |
requirements.txt | 11 months ago | |
run_with_submitit.py | 11 months ago |
DETR/
├── ckpts # 模型参数
├── coco # coco数据集
├── datasets # 处理与加载数据集脚本
├── models # 模型脚本
├── results # 结果
├── test # 测试数据
├── util # 工具
├── run_with_submitit.py # 提交结果
├── engine.py # 训练和验证工具
├── main.py # 训练和验证脚本
├── infer_image.py # 推理图片脚本
├── infer_video.py # 推理视频脚本
├── infer_image2video.py # 推理图片生成视频脚本
├── easy_run.ipynb # 简易运行脚本
├── README.md # 说明文档
└── requirements.txt # 环境配置文件
创建虚拟环境
conda create -n detr python=3.8
conda activate detr
安装pkg
pip install torch torchvision
pip install -r requirements.txt
测试
python
import torch
torch.cuda.is_available()
编译CUDA算子
cd models/dab_deformable_detr/ops
python setup.py build install
python test.py
cd ../../..
将预训练模型存放在ckpts目录下,使用DAB-DETR/R50,目录结构如下:
ckpts/
└── DAB_DETR
└── R50
├── checkpoints.pth
└── config.json
└── log.txt
将coco数据集存放在coco目录下,目录结构如下:
coco/
├── train2017/
├── val2017/
└── annotations/
├── instances_train2017.json
└── instances_val2017.json
测试数据包括,随机图片数据\视频\图片序列(DETRAC数据集),对应文件夹为image\video\image2video
test/
├── image/
├── image2video/
└── video/
将coco训练结果\coco验证结果\随机图片推理结果\视频推理结果\图像序列推理结果存放在coco_eval\coco_train\image\video\image2video中,结构如下:
results/
├── coco_eval/
├── coco_train/
├── image/
├── image2video/
└── video/
打开easy_run.ipynb
,将要检测的数据放在test
的对应目录下,运行即可.
打开终端,进入DTER目录,输入python ./xxx.py [option]
即可运行
xxx.py
为对应python脚本,[option]
为脚本的参数选项,可以使用python ./xxx.py -h
查看全部选项
推理图片:
python ./infer_image.py --show_savename True
推理视频
python ./infer_video.py --video_path ./test/video --save_path ./results/video
推理图片序列
python infer_image2video.py --image_path "./test/image2video/DETRAC-test-data/Insight-MVT_Annotation_Test/MVI_39271"
coco验证
python main.py -m dab_detr --output_dir ./results/eval_coco --batch_size 1 --coco_path ./coco --resume ./ckpts/DAB_DETR/R50/checkpoint.pth --eval
coco训练
python main.py -m dab_detr --output_dir ./results/coco_train --batch_size 1 --coco_path ./coco --epochs 50 --lr_drop 40
模式 | 原数据 | 图片效果 |
---|---|---|
图片 | ||
视频 | ||
图片序列 | - |
No Description
Python Cuda Markdown C++ Shell other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》