Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
1684b05
first commit for yolov7
ziqi-jin Jul 13, 2022
71c00d9
pybind for yolov7
ziqi-jin Jul 14, 2022
21ab2f9
CPP README.md
ziqi-jin Jul 14, 2022
d63e862
CPP README.md
ziqi-jin Jul 14, 2022
7b3b0e2
modified yolov7.cc
ziqi-jin Jul 14, 2022
d039e80
README.md
ziqi-jin Jul 15, 2022
a34a815
python file modify
ziqi-jin Jul 18, 2022
eb010a8
merge test
ziqi-jin Jul 18, 2022
39f64f2
delete license in fastdeploy/
ziqi-jin Jul 18, 2022
d071b37
repush the conflict part
ziqi-jin Jul 18, 2022
d5026ca
README.md modified
ziqi-jin Jul 18, 2022
fb376ad
README.md modified
ziqi-jin Jul 18, 2022
4b8737c
file path modified
ziqi-jin Jul 18, 2022
ce922a0
file path modified
ziqi-jin Jul 18, 2022
6e00b82
file path modified
ziqi-jin Jul 18, 2022
8c359fb
file path modified
ziqi-jin Jul 18, 2022
906c730
file path modified
ziqi-jin Jul 18, 2022
80c1223
README modified
ziqi-jin Jul 18, 2022
6072757
README modified
ziqi-jin Jul 18, 2022
2c6e6a4
move some helpers to private
ziqi-jin Jul 18, 2022
48136f0
add examples for yolov7
ziqi-jin Jul 18, 2022
6feca92
api.md modified
ziqi-jin Jul 18, 2022
ae70d4f
api.md modified
ziqi-jin Jul 18, 2022
f591b85
api.md modified
ziqi-jin Jul 18, 2022
f0def41
YOLOv7
ziqi-jin Jul 18, 2022
15b9160
yolov7 release link
ziqi-jin Jul 18, 2022
4706e8c
yolov7 release link
ziqi-jin Jul 18, 2022
dc83584
yolov7 release link
ziqi-jin Jul 18, 2022
086debd
copyright
ziqi-jin Jul 18, 2022
4f980b9
change some helpers to private
ziqi-jin Jul 18, 2022
2e61c95
Merge branch 'develop' into develop
ziqi-jin Jul 19, 2022
80beadf
change variables to const and fix documents.
ziqi-jin Jul 19, 2022
8103772
Merge branch 'PaddlePaddle:develop' into develop
ziqi-jin Jul 19, 2022
f5f7a86
gitignore
ziqi-jin Jul 19, 2022
e6cec25
Transfer some funtions to private member of class
ziqi-jin Jul 19, 2022
e25e4f2
Transfer some funtions to private member of class
ziqi-jin Jul 19, 2022
e8a8439
Merge from develop (#9)
ziqi-jin Jul 20, 2022
a182893
first commit for yolor
ziqi-jin Jul 20, 2022
3aa015f
for merge
ziqi-jin Jul 20, 2022
d6b98aa
Develop (#11)
ziqi-jin Jul 20, 2022
871cfc6
Merge branch 'yolor' into develop
ziqi-jin Jul 20, 2022
013921a
Yolor (#16)
ziqi-jin Jul 21, 2022
7a5a6d9
Merge branch 'PaddlePaddle:develop' into develop
ziqi-jin Jul 21, 2022
c996117
Merge branch 'PaddlePaddle:develop' into develop
ziqi-jin Jul 22, 2022
0aefe32
Merge branch 'PaddlePaddle:develop' into develop
ziqi-jin Jul 26, 2022
2330414
Merge branch 'PaddlePaddle:develop' into develop
ziqi-jin Jul 26, 2022
4660161
Merge branch 'PaddlePaddle:develop' into develop
ziqi-jin Jul 27, 2022
033c18e
Merge branch 'PaddlePaddle:develop' into develop
ziqi-jin Jul 28, 2022
6c94d65
Merge branch 'PaddlePaddle:develop' into develop
ziqi-jin Jul 28, 2022
85fb256
Merge branch 'PaddlePaddle:develop' into develop
ziqi-jin Jul 29, 2022
90ca4cb
add is_dynamic for YOLO series (#22)
ziqi-jin Jul 29, 2022
f6a4ed2
Merge branch 'PaddlePaddle:develop' into develop
ziqi-jin Aug 1, 2022
3682091
Merge branch 'PaddlePaddle:develop' into develop
ziqi-jin Aug 3, 2022
ca1e110
Merge remote-tracking branch 'upstream/develop' into develop
ziqi-jin Aug 8, 2022
93ba6a6
Merge branch 'PaddlePaddle:develop' into develop
ziqi-jin Aug 9, 2022
1c310ca
modify namespace for yolov5lite
ziqi-jin Aug 9, 2022
0349716
modify namespace for external detection models
ziqi-jin Aug 9, 2022
019692d
modify namespace for yolov5lite
ziqi-jin Aug 9, 2022
f9bddbf
modify namespace for face models
ziqi-jin Aug 9, 2022
c56e940
Merge pull request #26 from PaddlePaddle/develop
ziqi-jin Aug 9, 2022
9ebdd91
py namespace for external model
ziqi-jin Aug 9, 2022
d4d7b6f
fix compile error and infer file
ziqi-jin Aug 9, 2022
50b7e14
Merge branch 'develop' into modify_namespace
ziqi-jin Aug 9, 2022
99986a2
change paddleyolox to yolox
ziqi-jin Aug 9, 2022
bf3db6d
delete space in cmakelist
ziqi-jin Aug 9, 2022
557f8f7
check code specification
ziqi-jin Aug 10, 2022
c9b21ea
Merge branch 'develop' into modify_namespace
ziqi-jin Aug 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions csrcs/fastdeploy/vision.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,27 @@

#include "fastdeploy/core/config.h"
#ifdef ENABLE_VISION
#include "fastdeploy/vision/biubug6/retinaface.h"
#include "fastdeploy/vision/deepcam/yolov5face.h"
#include "fastdeploy/vision/deepinsight/arcface.h"
#include "fastdeploy/vision/deepinsight/cosface.h"
#include "fastdeploy/vision/deepinsight/insightface_rec.h"
#include "fastdeploy/vision/deepinsight/partial_fc.h"
#include "fastdeploy/vision/deepinsight/scrfd.h"
#include "fastdeploy/vision/deepinsight/vpl.h"

#include "fastdeploy/vision/detection/contrib/nanodet_plus.h"
#include "fastdeploy/vision/detection/contrib/scaledyolov4.h"
#include "fastdeploy/vision/detection/contrib/yolor.h"
#include "fastdeploy/vision/detection/contrib/yolov5.h"
#include "fastdeploy/vision/detection/contrib/yolov5lite.h"
#include "fastdeploy/vision/detection/contrib/yolov6.h"
#include "fastdeploy/vision/detection/contrib/yolov7.h"
#include "fastdeploy/vision/detection/ppdet/model.h"

#include "fastdeploy/vision/linzaer/ultraface.h"
#include "fastdeploy/vision/megvii/yolox.h"
#include "fastdeploy/vision/meituan/yolov6.h"
#include "fastdeploy/vision/detection/contrib/yolox.h"
#include "fastdeploy/vision/facedet/contrib/retinaface.h"
#include "fastdeploy/vision/facedet/contrib/scrfd.h"
#include "fastdeploy/vision/facedet/contrib/ultraface.h"
#include "fastdeploy/vision/facedet/contrib/yolov5face.h"
#include "fastdeploy/vision/faceid/contrib/arcface.h"
#include "fastdeploy/vision/faceid/contrib/cosface.h"
#include "fastdeploy/vision/faceid/contrib/insightface_rec.h"
#include "fastdeploy/vision/faceid/contrib/partial_fc.h"
#include "fastdeploy/vision/faceid/contrib/vpl.h"
#include "fastdeploy/vision/matting/contrib/modnet.h"
#include "fastdeploy/vision/ppcls/model.h"
#include "fastdeploy/vision/ppogg/yolov5lite.h"
#include "fastdeploy/vision/detection/ppdet/model.h"
#include "fastdeploy/vision/ppseg/model.h"
#include "fastdeploy/vision/rangilyu/nanodet_plus.h"
#include "fastdeploy/vision/ultralytics/yolov5.h"
#include "fastdeploy/vision/zhkkke/modnet.h"
#endif

#include "fastdeploy/vision/visualize/visualize.h"
144 changes: 0 additions & 144 deletions csrcs/fastdeploy/vision/deepinsight/deepinsight_pybind.cc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "fastdeploy/vision/rangilyu/nanodet_plus.h"
#include "fastdeploy/vision/detection/contrib/nanodet_plus.h"
#include "fastdeploy/utils/perf.h"
#include "fastdeploy/vision/utils/utils.h"

namespace fastdeploy {

namespace vision {

namespace rangilyu {
namespace detection {

struct NanoDetPlusCenterPoint {
int grid0;
Expand Down Expand Up @@ -350,6 +350,6 @@ bool NanoDetPlus::Predict(cv::Mat* im, DetectionResult* result,
return true;
}

} // namespace rangilyu
} // namespace detection
} // namespace vision
} // namespace fastdeploy
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace fastdeploy {

namespace vision {

namespace rangilyu {
namespace detection {

class FASTDEPLOY_DECL NanoDetPlus : public FastDeployModel {
public:
Expand All @@ -34,7 +34,7 @@ class FASTDEPLOY_DECL NanoDetPlus : public FastDeployModel {
const Frontend& model_format = Frontend::ONNX);

// 定义模型的名称
std::string ModelName() const { return "RangiLyu/nanodet"; }
std::string ModelName() const { return "nanodet"; }

// 模型预测接口,即用户调用的接口
// im 为用户的输入数据,目前对于CV均定义为cv::Mat
Expand Down Expand Up @@ -96,6 +96,6 @@ class FASTDEPLOY_DECL NanoDetPlus : public FastDeployModel {
bool is_dynamic_input_;
};

} // namespace rangilyu
} // namespace detection
} // namespace vision
} // namespace fastdeploy
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,25 @@
#include "fastdeploy/pybind/main.h"

namespace fastdeploy {
void BindMegvii(pybind11::module& m) {
auto megvii_module =
m.def_submodule("megvii", "https://github.com/megvii/YOLOX");
pybind11::class_<vision::megvii::YOLOX, FastDeployModel>(
megvii_module, "YOLOX")
void BindNanoDetPlus(pybind11::module& m) {
pybind11::class_<vision::detection::NanoDetPlus, FastDeployModel>(
m, "NanoDetPlus")
.def(pybind11::init<std::string, std::string, RuntimeOption, Frontend>())
.def("predict",
[](vision::megvii::YOLOX& self, pybind11::array& data,
[](vision::detection::NanoDetPlus& self, pybind11::array& data,
float conf_threshold, float nms_iou_threshold) {
auto mat = PyArrayToCvMat(data);
vision::DetectionResult res;
self.Predict(&mat, &res, conf_threshold, nms_iou_threshold);
return res;
})
.def_readwrite("size", &vision::megvii::YOLOX::size)
.def_readwrite("size", &vision::detection::NanoDetPlus::size)
.def_readwrite("padding_value",
&vision::megvii::YOLOX::padding_value)
.def_readwrite("is_decode_exported",
&vision::megvii::YOLOX::is_decode_exported)
&vision::detection::NanoDetPlus::padding_value)
.def_readwrite("keep_ratio", &vision::detection::NanoDetPlus::keep_ratio)
.def_readwrite("downsample_strides",
&vision::megvii::YOLOX::downsample_strides)
.def_readwrite("max_wh", &vision::megvii::YOLOX::max_wh);
&vision::detection::NanoDetPlus::downsample_strides)
.def_readwrite("max_wh", &vision::detection::NanoDetPlus::max_wh)
.def_readwrite("reg_max", &vision::detection::NanoDetPlus::reg_max);
}
} // namespace fastdeploy
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "fastdeploy/vision/ultralytics/yolov5.h"
#include "fastdeploy/vision/detection/contrib/yolov5.h"
#include "fastdeploy/utils/perf.h"
#include "fastdeploy/vision/utils/utils.h"

namespace fastdeploy {
namespace vision {
namespace ultralytics {
namespace detection {

void LetterBox(Mat* mat, std::vector<int> size, std::vector<float> color,
bool _auto, bool scale_fill = false, bool scale_up = true,
int stride = 32) {
void YOLOv5::LetterBox(Mat* mat, std::vector<int> size,
std::vector<float> color, bool _auto, bool scale_fill,
bool scale_up, int stride) {
float scale =
std::min(size[1] * 1.0 / mat->Height(), size[0] * 1.0 / mat->Width());
if (!scale_up) {
Expand Down Expand Up @@ -204,9 +204,9 @@ bool YOLOv5::Postprocess(
}

if (result->boxes.size() == 0) {
return true;
return true;
}

utils::NMS(result, nms_iou_threshold);

// scale the boxes to the origin image shape
Expand Down Expand Up @@ -290,6 +290,6 @@ bool YOLOv5::Predict(cv::Mat* im, DetectionResult* result, float conf_threshold,
return true;
}

} // namespace ultralytics
} // namespace detection
} // namespace vision
} // namespace fastdeploy
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace fastdeploy {
namespace vision {
namespace ultralytics {
namespace detection {

class FASTDEPLOY_DECL YOLOv5 : public FastDeployModel {
public:
Expand All @@ -30,7 +30,7 @@ class FASTDEPLOY_DECL YOLOv5 : public FastDeployModel {
const Frontend& model_format = Frontend::ONNX);

// 定义模型的名称
std::string ModelName() const { return "ultralytics/yolov5"; }
std::string ModelName() const { return "yolov5"; }

// 模型预测接口,即用户调用的接口
// im 为用户的输入数据,目前对于CV均定义为cv::Mat
Expand All @@ -39,7 +39,7 @@ class FASTDEPLOY_DECL YOLOv5 : public FastDeployModel {
// nms_iou_threshold 为后处理的参数
virtual bool Predict(cv::Mat* im, DetectionResult* result,
float conf_threshold = 0.25,
float nms_iou_threshold = 0.5);
float nms_iou_threshold = 0.5);

// 以下为模型在预测时的一些参数,基本是前后处理所需
// 用户在创建模型后,可根据模型的要求,以及自己的需求
Expand Down Expand Up @@ -81,21 +81,28 @@ class FASTDEPLOY_DECL YOLOv5 : public FastDeployModel {
// conf_threshold 后处理时过滤box的置信度阈值
// nms_iou_threshold 后处理时NMS设定的iou阈值
// multi_label 后处理时box选取是否采用多标签方式
bool Postprocess(
FDTensor& infer_result, DetectionResult* result,
const std::map<std::string, std::array<float, 2>>& im_info,
float conf_threshold, float nms_iou_threshold, bool multi_label);
bool Postprocess(FDTensor& infer_result, DetectionResult* result,
const std::map<std::string, std::array<float, 2>>& im_info,
float conf_threshold, float nms_iou_threshold,
bool multi_label);

// 查看输入是否为动态维度的 不建议直接使用 不同模型的逻辑可能不一致
bool IsDynamicInput() const { return is_dynamic_input_; }
bool IsDynamicInput() const { return is_dynamic_input_; }

// whether to inference with dynamic shape (e.g ONNX export with dynamic shape or not.)
// YOLOv5 official 'export_onnx.py' script will export dynamic ONNX by default.
// while is_dynamic_shape if 'false', is_mini_pad will force 'false'. This value will
// auto check by fastdeploy after the internal Runtime already initialized.
void LetterBox(Mat* mat, std::vector<int> size, std::vector<float> color,
bool _auto, bool scale_fill = false, bool scale_up = true,
int stride = 32);

// whether to inference with dynamic shape (e.g ONNX export with dynamic shape
// or not.)
// YOLOv5 official 'export_onnx.py' script will export dynamic ONNX by
// default.
// while is_dynamic_shape if 'false', is_mini_pad will force 'false'. This
// value will
// auto check by fastdeploy after the internal Runtime already initialized.
bool is_dynamic_input_;
};

} // namespace ultralytics
} // namespace detection
} // namespace vision
} // namespace fastdeploy
Loading