Tensorflow开源的object detection API中的源码解析(三):faster_rcnn_inception_resnet_v2_feature_extractor.py

本文深入解析Tensorflow开源的object detection API,聚焦faster_rcnn_inception_resnet_v2_feature_extractor.py源码,探讨其在物体检测中的应用和实现细节。
摘要由CSDN通过智能技术生成

对于faster_rcnn_meta_arch.py的理解见这篇文章
对于inception_resnet_v2.py的理解见这篇文章


"""Inception Resnet v2 Faster R-CNN implementation.

参见Szegedy等人的“Inception-v4,Inception-ResNet Impact of Residual Connections on
Learning"(论文地址:https://arxiv.org/abs/1602.07261)
以及Huang等人的
“Speed/accuracy trade-offs for modern convolutional object detectors" by
(论文地址:https://arxiv.org/abs/1611.10012)
"""

import tensorflow as tf

from object_detection.meta_architectures import faster_rcnn_meta_arch
from object_detection.net import inception_resnet_v2

slim = tf.contrib.slim


class FasterRCNNInceptionResnetV2FeatureExtractor(
    faster_rcnn_meta_arch.FasterRCNNFeatureExtractor):
  """ 这个类主要是Inception_Resnet_v2 Faster R-CNN的特征提取器的相关实现 """

  def __init__(self,
               is_training,
               first_stage_features_stride,
               reuse_weights=None,
               weight_decay=0.0):
    """Constructor.

    Args:
      is_training: 见faster_rcnn_meta_arch的构造器
      first_stage_features_stride: 同上
      reuse_weights: 同上
      weight_decay: 同上

    Raises:
      ValueError: 如果 `first_stage_features_stride` 既不是8也不是16。
    """
    if first_stage_features_stride != 8 and first_stage_features_stride != 16:
      raise ValueError('`first_stage_features_stride` must be 8 or 16.')
    super(FasterRCNNInceptionResnetV2FeatureExtractor, self).__init__(
        is_training, first_stage_features_stride, reuse_weights, weight_decay)

  def preprocess
  • 6
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值