Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RetinaNet

Represents a RetinaNet model. Rather than creating directly, it is intended to be created using load().

Hierarchy

  • RetinaNet

Index

Constructors

constructor

  • new RetinaNet(model: LayersModel, classes: string[], preprocessingMode: string, anchorParams?: AnchorParameters): RetinaNet

Properties

Protected anchorParams

anchorParams: AnchorParameters

Protected classes

classes: string[]

Protected height

height: number

model

model: LayersModel

Protected preprocessingMode

preprocessingMode: string

Protected width

width: number

Methods

detect

  • detect(img: tf.Tensor3D | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, threshold?: number, nmsThreshold?: number): Promise<DetectedObject[]>
  • Computes predictions. We currently do not support class-specific filtering. When non-max suppression is applied, it will be across all boxes, regardless of class.

    Parameters

    • img: tf.Tensor3D | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement

      The image object on which to run object detection

    • Default value threshold: number = 0.5

      The prediction threshold

    • Default value nmsThreshold: number = 0.5

      The non-max suppresion IoU threshold

    Returns Promise<DetectedObject[]>

dispose

  • dispose(): void

Private handleImageTensor

  • handleImageTensor(imageTensor: tf.Tensor3D): [tf.Tensor4D, number, number]
  • Parameters

    • imageTensor: tf.Tensor3D

    Returns [tf.Tensor4D, number, number]

Generated using TypeDoc