Skip to content

Callbacks

[source]

DrawInferences

paz.optimization.callbacks.DrawInferences(save_path, images, pipeline, topic='image', verbose=1)

Saves an image with its corresponding inferences

Arguments

  • save_path: String. Path in which the images will be saved.
  • images: List of numpy arrays of shape.
  • pipeline: Function that takes as input an element of ''images'' and outputs a ''Dict'' with inferences.
  • topic: Key to the ''inferences'' dictionary containing as value the drawn inferences.
  • verbose: Integer. If is bigger than 1 messages would be displayed.

[source]

LearningRateScheduler

paz.optimization.callbacks.LearningRateScheduler(learning_rate, gamma_decay, scheduled_epochs, verbose=1)

Callback for reducing learning rate at specific epochs.

Arguments

  • learning_rate: float. Indicates the starting learning rate.
  • gamma_decay: float. In an scheduled epoch the learning rate is multiplied by this factor.
  • scheduled_epochs: List of integers. Indicates in which epochs the learning rate will be multiplied by the gamma decay factor.
  • verbose: Integer. If is bigger than 1 messages would be displayed.

[source]

EvaluateMAP

paz.optimization.callbacks.EvaluateMAP(data_manager, detector, period, save_path, iou_thresh=0.5)

Evaluates mean average precision (MAP) of an object detector.

Arguments

  • data_manager: Data manager and loader class. See ''paz.datasets'' for examples.
  • detector: Tensorflow-Keras model.
  • period: Int. Indicates how often the evaluation is performed.
  • save_path: Str.
  • iou_thresh: Float.