Skip to content

Commit bd0482f

Browse files
ziqi-jinjiangjiajunrootDefTruthfelixhjh
authored
Add model SCRFD support (#68)
* first commit for yolov7 * pybind for yolov7 * CPP README.md * CPP README.md * modified yolov7.cc * README.md * python file modify * delete license in fastdeploy/ * repush the conflict part * README.md modified * README.md modified * file path modified * file path modified * file path modified * file path modified * file path modified * README modified * README modified * move some helpers to private * add examples for yolov7 * api.md modified * api.md modified * api.md modified * YOLOv7 * yolov7 release link * yolov7 release link * yolov7 release link * copyright * change some helpers to private * change variables to const and fix documents. * gitignore * Transfer some funtions to private member of class * Transfer some funtions to private member of class * Merge from develop (#9) * Fix compile problem in different python version (#26) * fix some usage problem in linux * Fix compile problem Co-authored-by: root <[email protected]> * Add PaddleDetetion/PPYOLOE model support (#22) * add ppdet/ppyoloe * Add demo code and documents * add convert processor to vision (#27) * update .gitignore * Added checking for cmake include dir * fixed missing trt_backend option bug when init from trt * remove un-need data layout and add pre-check for dtype * changed RGB2BRG to BGR2RGB in ppcls model * add model_zoo yolov6 c++/python demo * fixed CMakeLists.txt typos * update yolov6 cpp/README.md * add yolox c++/pybind and model_zoo demo * move some helpers to private * fixed CMakeLists.txt typos * add normalize with alpha and beta * add version notes for yolov5/yolov6/yolox * add copyright to yolov5.cc * revert normalize * fixed some bugs in yolox * fixed examples/CMakeLists.txt to avoid conflicts * add convert processor to vision * format examples/CMakeLists summary * Fix bug while the inference result is empty with YOLOv5 (#29) * Add multi-label function for yolov5 * Update README.md Update doc * Update fastdeploy_runtime.cc fix variable option.trt_max_shape wrong name * Update runtime_option.md Update resnet model dynamic shape setting name from images to x * Fix bug when inference result boxes are empty * Delete detection.py Co-authored-by: Jason <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: DefTruth <[email protected]> Co-authored-by: huangjianhui <[email protected]> * first commit for yolor * for merge * Develop (#11) * Fix compile problem in different python version (#26) * fix some usage problem in linux * Fix compile problem Co-authored-by: root <[email protected]> * Add PaddleDetetion/PPYOLOE model support (#22) * add ppdet/ppyoloe * Add demo code and documents * add convert processor to vision (#27) * update .gitignore * Added checking for cmake include dir * fixed missing trt_backend option bug when init from trt * remove un-need data layout and add pre-check for dtype * changed RGB2BRG to BGR2RGB in ppcls model * add model_zoo yolov6 c++/python demo * fixed CMakeLists.txt typos * update yolov6 cpp/README.md * add yolox c++/pybind and model_zoo demo * move some helpers to private * fixed CMakeLists.txt typos * add normalize with alpha and beta * add version notes for yolov5/yolov6/yolox * add copyright to yolov5.cc * revert normalize * fixed some bugs in yolox * fixed examples/CMakeLists.txt to avoid conflicts * add convert processor to vision * format examples/CMakeLists summary * Fix bug while the inference result is empty with YOLOv5 (#29) * Add multi-label function for yolov5 * Update README.md Update doc * Update fastdeploy_runtime.cc fix variable option.trt_max_shape wrong name * Update runtime_option.md Update resnet model dynamic shape setting name from images to x * Fix bug when inference result boxes are empty * Delete detection.py Co-authored-by: Jason <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: DefTruth <[email protected]> Co-authored-by: huangjianhui <[email protected]> * Yolor (#16) * Develop (#11) (#12) * Fix compile problem in different python version (#26) * fix some usage problem in linux * Fix compile problem Co-authored-by: root <[email protected]> * Add PaddleDetetion/PPYOLOE model support (#22) * add ppdet/ppyoloe * Add demo code and documents * add convert processor to vision (#27) * update .gitignore * Added checking for cmake include dir * fixed missing trt_backend option bug when init from trt * remove un-need data layout and add pre-check for dtype * changed RGB2BRG to BGR2RGB in ppcls model * add model_zoo yolov6 c++/python demo * fixed CMakeLists.txt typos * update yolov6 cpp/README.md * add yolox c++/pybind and model_zoo demo * move some helpers to private * fixed CMakeLists.txt typos * add normalize with alpha and beta * add version notes for yolov5/yolov6/yolox * add copyright to yolov5.cc * revert normalize * fixed some bugs in yolox * fixed examples/CMakeLists.txt to avoid conflicts * add convert processor to vision * format examples/CMakeLists summary * Fix bug while the inference result is empty with YOLOv5 (#29) * Add multi-label function for yolov5 * Update README.md Update doc * Update fastdeploy_runtime.cc fix variable option.trt_max_shape wrong name * Update runtime_option.md Update resnet model dynamic shape setting name from images to x * Fix bug when inference result boxes are empty * Delete detection.py Co-authored-by: Jason <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: DefTruth <[email protected]> Co-authored-by: huangjianhui <[email protected]> Co-authored-by: Jason <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: DefTruth <[email protected]> Co-authored-by: huangjianhui <[email protected]> * Develop (#13) * Fix compile problem in different python version (#26) * fix some usage problem in linux * Fix compile problem Co-authored-by: root <[email protected]> * Add PaddleDetetion/PPYOLOE model support (#22) * add ppdet/ppyoloe * Add demo code and documents * add convert processor to vision (#27) * update .gitignore * Added checking for cmake include dir * fixed missing trt_backend option bug when init from trt * remove un-need data layout and add pre-check for dtype * changed RGB2BRG to BGR2RGB in ppcls model * add model_zoo yolov6 c++/python demo * fixed CMakeLists.txt typos * update yolov6 cpp/README.md * add yolox c++/pybind and model_zoo demo * move some helpers to private * fixed CMakeLists.txt typos * add normalize with alpha and beta * add version notes for yolov5/yolov6/yolox * add copyright to yolov5.cc * revert normalize * fixed some bugs in yolox * fixed examples/CMakeLists.txt to avoid conflicts * add convert processor to vision * format examples/CMakeLists summary * Fix bug while the inference result is empty with YOLOv5 (#29) * Add multi-label function for yolov5 * Update README.md Update doc * Update fastdeploy_runtime.cc fix variable option.trt_max_shape wrong name * Update runtime_option.md Update resnet model dynamic shape setting name from images to x * Fix bug when inference result boxes are empty * Delete detection.py Co-authored-by: Jason <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: DefTruth <[email protected]> Co-authored-by: huangjianhui <[email protected]> * documents * documents * documents * documents * documents * documents * documents * documents * documents * documents * documents * documents * Develop (#14) * Fix compile problem in different python version (#26) * fix some usage problem in linux * Fix compile problem Co-authored-by: root <[email protected]> * Add PaddleDetetion/PPYOLOE model support (#22) * add ppdet/ppyoloe * Add demo code and documents * add convert processor to vision (#27) * update .gitignore * Added checking for cmake include dir * fixed missing trt_backend option bug when init from trt * remove un-need data layout and add pre-check for dtype * changed RGB2BRG to BGR2RGB in ppcls model * add model_zoo yolov6 c++/python demo * fixed CMakeLists.txt typos * update yolov6 cpp/README.md * add yolox c++/pybind and model_zoo demo * move some helpers to private * fixed CMakeLists.txt typos * add normalize with alpha and beta * add version notes for yolov5/yolov6/yolox * add copyright to yolov5.cc * revert normalize * fixed some bugs in yolox * fixed examples/CMakeLists.txt to avoid conflicts * add convert processor to vision * format examples/CMakeLists summary * Fix bug while the inference result is empty with YOLOv5 (#29) * Add multi-label function for yolov5 * Update README.md Update doc * Update fastdeploy_runtime.cc fix variable option.trt_max_shape wrong name * Update runtime_option.md Update resnet model dynamic shape setting name from images to x * Fix bug when inference result boxes are empty * Delete detection.py Co-authored-by: root <[email protected]> Co-authored-by: DefTruth <[email protected]> Co-authored-by: huangjianhui <[email protected]> Co-authored-by: Jason <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: DefTruth <[email protected]> Co-authored-by: huangjianhui <[email protected]> Co-authored-by: Jason <[email protected]> * add is_dynamic for YOLO series (#22) * first commit for scrfd * bind file * documents for scrfd * documents for scrfd * documents for scrfd * documents for scrfd * modified for the pr comments * modified for the PR comments * fix second PR comments * delete the member fmc_, create fmc in the Postprocess function, fix the count for nms Co-authored-by: Jason <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: DefTruth <[email protected]> Co-authored-by: huangjianhui <[email protected]> Co-authored-by: Jason <[email protected]>
1 parent 59c374e commit bd0482f

File tree

22 files changed

+1161
-3
lines changed

22 files changed

+1161
-3
lines changed

csrcs/fastdeploy/vision.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@
1717
#ifdef ENABLE_VISION
1818
#include "fastdeploy/vision/biubug6/retinaface.h"
1919
#include "fastdeploy/vision/deepcam/yolov5face.h"
20+
#include "fastdeploy/vision/deepinsight/scrfd.h"
2021
#include "fastdeploy/vision/linzaer/ultraface.h"
2122
#include "fastdeploy/vision/megvii/yolox.h"
2223
#include "fastdeploy/vision/meituan/yolov6.h"
2324
#include "fastdeploy/vision/ppcls/model.h"
2425
#include "fastdeploy/vision/ppdet/ppyoloe.h"
26+
#include "fastdeploy/vision/ppogg/yolov5lite.h"
2527
#include "fastdeploy/vision/ppseg/model.h"
2628
#include "fastdeploy/vision/rangilyu/nanodet_plus.h"
2729
#include "fastdeploy/vision/ultralytics/yolov5.h"
2830
#include "fastdeploy/vision/wongkinyiu/scaledyolov4.h"
2931
#include "fastdeploy/vision/wongkinyiu/yolor.h"
3032
#include "fastdeploy/vision/wongkinyiu/yolov7.h"
31-
#include "fastdeploy/vision/ppogg/yolov5lite.h"
3233
#endif
3334

3435
#include "fastdeploy/vision/visualize/visualize.h"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
#include "fastdeploy/pybind/main.h"
16+
17+
namespace fastdeploy {
18+
void BindDeepinsight(pybind11::module& m) {
19+
auto deepinsight_module = m.def_submodule(
20+
"deepinsight", "https://github.com/deepinsight");
21+
pybind11::class_<vision::deepinsight::SCRFD, FastDeployModel>(
22+
deepinsight_module, "SCRFD")
23+
.def(pybind11::init<std::string, std::string, RuntimeOption, Frontend>())
24+
.def("predict",
25+
[](vision::deepinsight::SCRFD& self, pybind11::array& data,
26+
float conf_threshold, float nms_iou_threshold) {
27+
auto mat = PyArrayToCvMat(data);
28+
vision::FaceDetectionResult res;
29+
self.Predict(&mat, &res, conf_threshold, nms_iou_threshold);
30+
return res;
31+
})
32+
.def_readwrite("size", &vision::deepinsight::SCRFD::size)
33+
.def_readwrite("padding_value",
34+
&vision::deepinsight::SCRFD::padding_value)
35+
.def_readwrite("is_mini_pad", &vision::deepinsight::SCRFD::is_mini_pad)
36+
.def_readwrite("is_no_pad", &vision::deepinsight::SCRFD::is_no_pad)
37+
.def_readwrite("is_scale_up", &vision::deepinsight::SCRFD::is_scale_up)
38+
.def_readwrite("stride", &vision::deepinsight::SCRFD::stride)
39+
.def_readwrite("use_kps", &vision::deepinsight::SCRFD::use_kps)
40+
.def_readwrite("max_nms", &vision::deepinsight::SCRFD::max_nms)
41+
.def_readwrite("downsample_strides",
42+
&vision::deepinsight::SCRFD::downsample_strides)
43+
.def_readwrite("num_anchors", &vision::deepinsight::SCRFD::num_anchors)
44+
.def_readwrite("landmarks_per_face",
45+
&vision::deepinsight::SCRFD::landmarks_per_face);
46+
}
47+
} // namespace fastdeploy

0 commit comments

Comments
 (0)