Apollo 10.0
自动驾驶开放平台
postprocess.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16#pragma once
17
18#include <algorithm>
19#include <memory>
20#include <set>
21#include <vector>
22
23#include <opencv2/opencv.hpp>
24
25#include "modules/perception/camera_detection_multi_stage/detector/yolox3d/proto/model_param.pb.h"
26
29
30namespace apollo {
31namespace perception {
32namespace camera {
45void YoloxGetObjectsCpu(const std::shared_ptr<base::Blob<float>> &objects_blob,
46 const yolox3d::ModelParam &model_param,
47 const yolox3d::NMSParam &nms_param, const int width,
48 const int height, const int image_width,
49 const int image_height,
50 std::vector<base::ObjectPtr> *objects);
58void YoloxGetAllObjects(const float *data,
59 const yolox3d::ModelParam &model_param,
60 const float scale,
61 std::vector<std::vector<float>> *objects_out);
62
73void YoloxFillBase(const std::vector<float> &detect, const int width,
74 const int height, const int image_width,
75 const int image_height, base::ObjectPtr obj);
83void YoloxFillBbox3d(const yolox3d::ModelParam &model_param,
84 const std::vector<float> &detect, base::ObjectPtr obj);
85
92float YoloxBboxIOU(const std::vector<float> &box1,
93 const std::vector<float> &box2);
103void YoloxTruncated(base::ObjectPtr obj, const int image_width,
104 const int image_height);
105
113template <typename T>
114constexpr T Yoloxclamp(const T &val, const T &low, const T &high) {
115 return val < low ? low : (high < val ? high : val);
116}
117
118} // namespace camera
119} // namespace perception
120} // namespace apollo
std::shared_ptr< Object > ObjectPtr
Definition object.h:127
void YoloxGetAllObjects(const float *data, const yolox3d::ModelParam &model_param, const float scale, std::vector< std::vector< float > > *objects_out)
Get all objects accoring to confidence
float YoloxBboxIOU(const std::vector< float > &box1, const std::vector< float > &box2)
Computes IoU between bboxes.
constexpr T Yoloxclamp(const T &val, const T &low, const T &high)
Clamp target value between low and high tools for iou
void YoloxGetObjectsCpu(const std::shared_ptr< base::Blob< float > > &objects_blob, const yolox3d::ModelParam &model_param, const yolox3d::NMSParam &nms_param, const int width, const int height, const int image_width, const int image_height, std::vector< base::ObjectPtr > *objects)
Return Yolox Objects
void YoloxFillBase(const std::vector< float > &detect, const int width, const int height, const int image_width, const int image_height, base::ObjectPtr obj)
Get 2dbbox for objects
void YoloxFillBbox3d(const yolox3d::ModelParam &model_param, const std::vector< float > &detect, base::ObjectPtr obj)
Add 3d bbox values for objects
void YoloxTruncated(base::ObjectPtr obj, const int image_width, const int image_height)
object is truncated or not
class register implement
Definition arena_queue.h:37