createSsd7Model2D: 2-D implementation of the SSD 7 deep learning architecture.

View source: R/createSsd7Model.R

createSsd7Model2DR Documentation

2-D implementation of the SSD 7 deep learning architecture.

Description

Creates a keras model of the SSD 7 deep learning architecture for object detection based on the paper

Usage

createSsd7Model2D(
  inputImageSize,
  numberOfOutputs,
  minScale = 0.08,
  maxScale = 0.96,
  aspectRatiosPerLayer = list(c("1:1", "2:1", "1:2"), c("1:1", "2:1", "1:2"), c("1:1",
    "2:1", "1:2"), c("1:1", "2:1", "1:2")),
  variances = rep(1, 4)
)

Arguments

inputImageSize

Used for specifying the input tensor shape. The shape (or dimension) of that tensor is the image dimensions followed by the number of channels (e.g., red, green, and blue). The batch size (i.e., number of training images) is not specified a priori.

numberOfOutputs

Number of classification labels. Needs to include the background as one of the labels.

minScale

The smallest scaling factor for the size of the anchor boxes as a fraction of the shorter side of the input images.

maxScale

The largest scaling factor for the size of the anchor boxes as a fraction of the shorter side of the input images. All scaling factors between the smallest and the largest are linearly interpolated.

aspectRatiosPerLayer

A list containing one aspect ratio list for each predictor layer. #' each predictor layer. The default lists follows the original implementation except each aspect ratio is defined as a character string (e.g., ⁠'1:2'⁠).

variances

A list of 4 floats > 0 with scaling factors for the encoded predicted box coordinates. A variance value of 1.0 would apply no scaling at all to the predictions, while values in (0, 1) upscale the encoded predictions and values greater than 1.0 downscale the encoded predictions. Defaults to c( 1.0, 1.0, 1.0, 1.0 ).

Details

W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C-Y. Fu, A. Berg. SSD: Single Shot MultiBox Detector.

available here:

    \url{https://arxiv.org/abs/1512.02325}

This particular implementation was influenced by the following python and R implementations:

    \url{https://github.com/pierluigiferrari/ssd_keras}
    \url{https://github.com/gsimchoni/ssdkeras}

Value

an SSD keras model

Author(s)

Tustison NJ

Examples

tensorflow::tf$compat$v1$disable_eager_execution()
createSsd7Model2D(c(250, 250, 3), 2)
createSsd7Model3D(c(250, 250, 250, 3), 2)

ANTsX/ANTsRNet documentation built on April 23, 2024, 1:24 p.m.