目录
1. 源代码注解
对代码中比较重要的地方添加注释,包括自己的理解和一些参考。
2.相关知识点补充
补充IoU, 非极大值抑制, python的argparse模块等相关知识点。
import _init_paths
from fast_rcnn.config import cfg
#im_detect 生成RPN候选框
from fast_rcnn.test import im_detect
#nms 进行非极大值抑制
from fast_rcnn.nms_wrapper import nms
from utils.timer import Timer
import matplotlib.pyplot as plt
import numpy as np
import scipy.io as sio
import caffe, os, sys, cv2
#引入argparse, 它python用于解析命令行参数和选项的
#标准模块,用于解析命令行参数
import argparse
CLASSES = ('__background__',
'aeroplane', 'bicycle', 'bird', 'boat',
'bottle', 'bus', 'car', 'cat', 'chair',
'cow', 'diningtable', 'dog', 'horse',
'motorbike', 'person', 'pottedplant',
'sheep', 'sofa', 'train', 'tvmonitor')
NETS = {
'vgg16': ('VGG16',
'VGG16_faster_rcnn_final.caffemodel'),
'zf': ('ZF',
'ZF_faster_rcnn_final.caffemodel')}