FastDeploy
latest
Fast & Easy to Deploy!
Main Page
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
i
l
m
o
p
q
r
s
t
u
v
+
Functions
a
c
d
e
f
g
i
l
m
p
q
r
s
t
v
Enumerations
Enumerator
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
y
+
Functions
a
b
c
d
e
f
g
i
m
n
o
p
r
s
u
y
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
+
Files
File List
•
All
Classes
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Pages
fastdeploy
vision
classification
contrib
yolov5cls
postprocessor.h
1
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#pragma once
16
#include "fastdeploy/vision/common/processors/transform.h"
17
#include "fastdeploy/vision/common/result.h"
18
19
namespace
fastdeploy
{
20
namespace
vision {
21
22
namespace
classification {
25
class
FASTDEPLOY_DECL
YOLOv5ClsPostprocessor
{
26
public
:
29
YOLOv5ClsPostprocessor
();
30
38
bool
Run(
const
std::vector<FDTensor>& tensors,
39
std::vector<ClassifyResult>* results,
40
const
std::vector<std::map<std::string, std::array<float, 2>>>& ims_info);
41
43
void
SetTopK
(
const
int
& topk) {
44
topk_ = topk;
45
}
46
48
float
GetTopK
()
const
{
return
topk_; }
49
50
protected
:
51
int
topk_;
52
};
53
54
}
// namespace classification
55
}
// namespace vision
56
}
// namespace fastdeploy
fastdeploy::vision::classification::YOLOv5ClsPostprocessor::GetTopK
float GetTopK() const
Get topk, default 1.
Definition:
postprocessor.h:48
fastdeploy::vision::classification::YOLOv5ClsPostprocessor
Postprocessor object for YOLOv5Cls serials model.
Definition:
postprocessor.h:25
fastdeploy::vision::classification::YOLOv5ClsPostprocessor::SetTopK
void SetTopK(const int &topk)
Set topk, default 1.
Definition:
postprocessor.h:43
fastdeploy
All C++ FastDeploy APIs are defined inside this namespace.
Definition:
option.h:16
Generated by
1.8.13