/*
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// SSD post-processing pipeline

#include "ssd_postprocess/pipeline.h"

#include <stdlib.h>

#include "ssd_postprocess/box.h"
#include "ssd_postprocess/nms.h"

void ssd_postprocess_pipeline(uint8_t** model_out, Boxes* boxes,
                              const int max_faces, const float iou_threshold) {
  Boxes boxes_before_nms = {.num_boxes = 0, .box = NULL};
  // decode and extract detected boxes
  get_detected_boxes(model_out, &boxes_before_nms);
  // non-max suppression
  nms(&boxes_before_nms, boxes, max_faces, iou_threshold);

  if (boxes_before_nms.box) {
    free(boxes_before_nms.box);
  }
}
