blob: 49ec2763c93f661f35827ba7aec390d9378d625f [file] [log] [blame]
/*
* 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);
}
}