Faster-Rcnn demo.py解析

本文详细解析 Faster-RCNN 的 Python 实现,包括 `vis_detections` 和 `demo` 模块,用于画出测试图片的边界框。同时介绍了如何使用 argparse 模块解析命令行参数,以及 IoU 和非极大值抑制等关键概念。
摘要由CSDN通过智能技术生成

目录

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')}
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值