[Backend] Support onnxruntime DirectML inference. (#1304)

* Fix links in readme

* Fix links in readme

* Update PPOCRv2/v3 examples

* Update auto compression configs

* Add neww quantization  support for paddleclas model

* Update quantized Yolov6s model download link

* Improve PPOCR comments

* Add English doc for quantization

* Fix PPOCR rec model bug

* Add  new paddleseg quantization support

* Add  new paddleseg quantization support

* Add  new paddleseg quantization support

* Add  new paddleseg quantization support

* Add Ascend model list

* Add ascend model list

* Add ascend model list

* Add ascend model list

* Add ascend model list

* Add ascend model list

* Add ascend model list

* Support DirectML in onnxruntime

* Support onnxruntime DirectML

* Support onnxruntime DirectML

* Support onnxruntime DirectML

* Support OnnxRuntime DirectML

* Support OnnxRuntime DirectML

* Support OnnxRuntime DirectML

* Support OnnxRuntime DirectML

* Support OnnxRuntime DirectML

* Support OnnxRuntime DirectML

* Support OnnxRuntime DirectML

* Support OnnxRuntime DirectML

* Remove DirectML vision model example

* Imporve OnnxRuntime DirectML

* Imporve OnnxRuntime DirectML

* fix opencv cmake in Windows

* recheck codestyle
This commit is contained in:
yunyaoXYY
2023-02-17 10:53:51 +08:00
committed by GitHub
parent efa46563f3
commit c38b7d4377
22 changed files with 393 additions and 60 deletions

View File

@@ -24,6 +24,10 @@
#include "fastdeploy/runtime/backends/ort/option.h"
#include "onnxruntime_cxx_api.h" // NOLINT
#ifdef WITH_DIRECTML
#include "dml_provider_factory.h" // NOLINT
#endif
namespace fastdeploy {
struct OrtValueInfo {
@@ -37,7 +41,7 @@ class OrtBackend : public BaseBackend {
OrtBackend() {}
virtual ~OrtBackend() = default;
void BuildOption(const OrtBackendOption& option);
bool BuildOption(const OrtBackendOption& option);
bool Init(const RuntimeOption& option);
@@ -54,7 +58,7 @@ class OrtBackend : public BaseBackend {
std::vector<TensorInfo> GetOutputInfos() override;
static std::vector<OrtCustomOp*> custom_operators_;
void InitCustomOperators();
private:
bool InitFromPaddle(const std::string& model_buffer,
const std::string& params_buffer,