赞
踩
推荐通过conda创建虚拟环境,具体操作可见linux系统下创建anaconda新环境及问题解决
git clone https://github.com/facebookresearch/detr.git
conda install -c pytorch pytorch torchvision
conda install cython scipy
pip install -U 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
pip install git+https://github.com/cocodataset/panopticapi.git
import torch
pretrained_weights = torch.load("./detr-r50-e632da11.pth")
num_class = 2 + 1
pretrained_weights["model"]["class_embed.weight"].resize_(num_class+1,256)
pretrained_weights["model"]["class_embed.bias"].resize_(num_class+1)
torch.save(pretrained_weights,'detr_r50_%d.pth'%num_class)
python main.py --dataset_file "coco" --coco_path /path/to/coco/ --resume="detr_r50_3.pth"
--eval
及其它相关参数if __name__ == '__main__':
files = list(Path('../outputs/eval').glob('*.pth'))
plot_precision_recall(files)
plt.show()
plot_logs(logs=Path('../outputs/log/'),fields=('class_error', 'loss_bbox_unscaled', 'mAP'), ewm_col=0, log_name='log.txt')
plt.show()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。