# faster-rcnn-pytorch **Repository Path**: mikuhu/faster-rcnn-pytorch ## Basic Information - **Project Name**: faster-rcnn-pytorch - **Description**: Faster-Rcnn:Two-Stage目标检测模型在Pytorch当中的实现 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2020-11-12 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## Faster-Rcnn:Two-Stage目标检测模型在Pytorch当中的实现 --- ### 目录 1. [所需环境 Environment](#所需环境) 2. [文件下载 Download](#文件下载) 3. [训练步骤 How2train](#训练步骤) 4. [参考资料 Reference](#Reference) ### 所需环境 torch == 1.2.0 ### 文件下载 训练所需的voc_weights_resnet.pth或者voc_weights_vgg.pth可以在百度云下载。 voc_weights_resnet.pth是resnet为主干特征提取网络用到的; voc_weights_vgg.pth是vgg为主干特征提取网络用到的; 链接: https://pan.baidu.com/s/1H_YQxUvGrOXQeEQWPJvixQ 提取码: 9eai ### 训练步骤 1、本文使用VOC格式进行训练。 2、训练前将标签文件放在VOCdevkit文件夹下的VOC2007文件夹下的Annotation中。 3、训练前将图片文件放在VOCdevkit文件夹下的VOC2007文件夹下的JPEGImages中。 4、在训练前利用voc2ssd.py文件生成对应的txt。 5、再运行根目录下的voc_annotation.py,运行前需要将classes改成你自己的classes。 ```python classes = ["aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow", "diningtable", "dog", "horse", "motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"] ``` 6、就会生成对应的2007_train.txt,每一行对应其图片位置及其真实框的位置。 7、在训练前需要修改model_data里面的voc_classes.txt文件,需要将classes改成你自己的classes。 8、同时需要修改train.py里面的NUM_CLASSES,修改成需要分的类的个数(不需要+1);BACKBONE为需要的主干特征提取网络。 9、运行train.py即可开始训练。 ### mAP目标检测精度计算更新 更新了get_gt_txt.py、get_dr_txt.py和get_map.py文件。 get_map文件克隆自https://github.com/Cartucho/mAP 具体mAP计算过程可参考:https://www.bilibili.com/video/BV1zE411u7Vw ### Reference https://github.com/chenyuntc/simple-faster-rcnn-pytorch https://github.com/eriklindernoren/PyTorch-YOLOv3 https://github.com/BobLiu20/YOLOv3_PyTorch