discopat.nn_models.detr

Classes

DETRModel(net, label_map, model_parameters)

PostProcess(*args, **kwargs)

Convert the model's output into the format expected by the coco api.

class discopat.nn_models.detr.DETRModel(net, label_map, model_parameters)[source]

Bases: NNModel

Parameters:
  • net (NeuralNet)

  • label_map (dict[str, int])

  • model_parameters (dict)

post_process(raw_predictions)[source]

Adapt the internal detector’s predictions to discopat’s format.

Parameters:

raw_predictions (list[dict[Tensor]])

Return type:

list[Box]

pre_process(frame)[source]

Prepare the frame’s array to pass through the internal detector.

Can be a neural net, a convolutional sparse encoder…

Parameters:

frame (Frame)

Return type:

Tensor

class discopat.nn_models.detr.PostProcess(*args, **kwargs)[source]

Bases: Module

Convert the model’s output into the format expected by the coco api.

forward(outputs, target_sizes)[source]

Perform the computation.

Parameters:
  • outputs (raw outputs of the model)

  • target_sizes (tensor of dimension [batch_size x 2] containing the size of each images of the batch) – For evaluation, this must be the original image size (before any data augmentation) For visualization, this should be the image size after data augment, but before padding