Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
Erpim 1a2beec2a2 | 2 months ago | |
---|---|---|
.. | ||
faster_rcnn_adapter | 2 months ago | |
faster_rcnn_torch | 8 months ago | |
README.md | 8 months ago | |
requirements.txt | 8 months ago |
Before FasterRcnn, the target detection networks rely on the region proposal algorithm to assume the location of targets, such as SPPnet and Fast R-CNN. Progress has reduced the running time of these detection networks, but it also reveals that the calculation of the region proposal is a bottleneck.
FasterRcnn proposed that convolution feature maps based on region detectors (such as Fast R-CNN) can also be used to generate region proposals. At the top of these convolution features, a Region Proposal Network (RPN) is constructed by adding some additional convolution layers (which share the convolution characteristics of the entire image with the detection network, thus making it possible to make regions almost costlessProposal), outputting both region bounds and objectness score for each location.Therefore, RPN is a full convolutional network (FCN), which can be trained end-to-end, generate high-quality region proposals, and then fed into Fast R-CNN for detection.
Paper: Ren S , He K , Girshick R , et al. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2015, 39(6).
PASCAL_VOC 07: Please follow the instructions in py-faster-rcnn to prepare VOC datasets. Actually, you can refer to any others. After downloading the data, creat softlinks in the folder data/.
cd cv/faster_rcnn/faster_rcnn_torch/data
ln -s /path/to/VOCdevkit VOCdevkit2007
Configure the faster_rcnn_adapter
directory in the same way.
In this case, the source of the model definition or training script corresponding to the implementation of PyTorch is as follows:
https://github.com/jwyang/faster-rcnn.pytorch/tree/pytorch-1.0
In order to adapt to pytorch 1.12 and torchvision api, we have made some necessary adaptations.
We used four pretrained models in our experiments. You can download these models from:
Download them and put them into the data/pretrained_model/.
Similarly, use tools/pth2ckpt.py
to generate the pre-training model for faster_rcnn_adapter
.
This case shows the FasterRcnn model implemented by pytorch and the version converted based on MSAadpter, you can start training and evaluation as follows:
Step1: Install all the python dependencies using pip:
pip install -r requirements.txt
Step2: Prepare data sets and pre-training models according to the above
Step3: Perform training and testing
# PyTorch
cd faster_rcnn_torch
# enter script dir, train FasterRcnn by PyTorch
python trainval_net.py [--net 'vgg16'|'res50'|'res101'|'res152'] [--bs $BATCH_SIZE] [--lr $LEARNING_RATE] \ [--lr_decay_step $DECAY_STEP] [--cuda]
# example: python trainval_net.py --net res101 --epochs 20 --bs 4 --lr 1e-4 --lr_decay_step 8
# enter script dir, evaluate FasterRcnn by PyTorch
python test_net.py [--net 'vgg16'|'res50'|'res101'|'res152'] [--checksession $SESSION] \
[--checkepoch $EPOCH] [--checkpoint $CHECKPOINT] [--cuda]
# test pretrain model faster_rcnn_1_20_10021.pth
# example: python test_net.py --net vgg16 --checksession 1 --checkepoch 20 --checkpoint 10021
# MSAdapter.pytorch
cd faster_rcnn_adapter
# enter script dir, train FasterRcnn by PyTorch
python trainval_net.py [--net 'vgg16'|'res50'|'res101'|'res152'] [--bs $BATCH_SIZE] [--lr $LEARNING_RATE] \ [--lr_decay_step $DECAY_STEP] [--cuda]
# example: python trainval_net.py --net res101 --epochs 20 --bs 4 --lr 1e-4 --lr_decay_step 8
# enter script dir, evaluate FasterRcnn by PyTorch
python test_net.py [--net 'vgg16'|'res50'|'res101'|'res152'] [--checksession $SESSION] \
[--checkepoch $EPOCH] [--checkpoint $CHECKPOINT] [--cuda]
# test pretrain model faster_rcnn_1_20_10021.ckpt
# example: python test_net.py --net vgg16 --checksession 1 --checkepoch 20 --checkpoint 10021
No Description
Jupyter Notebook Text Python 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》