Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#1543 from Zheng-Bicheng/rknn_pybind
Browse files Browse the repository at this point in the history
[Pybind] update rknpu2 pybind
  • Loading branch information
Zheng-Bicheng authored Mar 8, 2023
2 parents c2d377a + 1e56d50 commit 547910f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
3 changes: 0 additions & 3 deletions fastdeploy/pybind/main.cc.in
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ PYBIND11_MODULE(@PY_LIBRARY_NAME@, m) {
m.def_submodule("text", "Text module of FastDeploy.");
BindText(text_module);
#endif
auto rknpu2_module =
m.def_submodule("rknpu2", "RKNPU2 config module of FastDeploy.");
BindRKNPU2Config(rknpu2_module);
}

} // namespace fastdeploy
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "fastdeploy/pybind/main.h"
#include "fastdeploy/runtime/backends/rknpu2/option.h"
namespace fastdeploy {
void BindRKNPU2Config(pybind11::module& m) {
void BindRKNPU2Option(pybind11::module& m) {
pybind11::enum_<fastdeploy::rknpu2::CpuName>(
m, "CpuName", pybind11::arithmetic(), "CpuName for inference.")
.value("RK356X", fastdeploy::rknpu2::CpuName::RK356X)
Expand Down
3 changes: 2 additions & 1 deletion fastdeploy/runtime/option_pybind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ void BindOrtOption(pybind11::module& m);
void BindTrtOption(pybind11::module& m);
void BindPaddleOption(pybind11::module& m);
void BindPorosOption(pybind11::module& m);

void BindRKNPU2Option(pybind11::module& m);
void BindOption(pybind11::module& m) {
BindLiteOption(m);
BindOpenVINOOption(m);
BindOrtOption(m);
BindTrtOption(m);
BindPaddleOption(m);
BindPorosOption(m);
BindRKNPU2Option(m);

pybind11::class_<RuntimeOption>(m, "RuntimeOption")
.def(pybind11::init())
Expand Down
1 change: 0 additions & 1 deletion python/fastdeploy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from .c_lib_wrap import (
ModelFormat,
Backend,
rknpu2,
FDDataType,
TensorInfo,
Device,
Expand Down
5 changes: 2 additions & 3 deletions python/fastdeploy/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import numpy as np
from . import ModelFormat
from . import c_lib_wrap as C
from . import rknpu2


class Runtime:
Expand Down Expand Up @@ -253,8 +252,8 @@ def use_cpu(self):
return self._option.use_cpu()

def use_rknpu2(self,
rknpu2_name=rknpu2.CpuName.RK3588,
rknpu2_core=rknpu2.CoreMask.RKNN_NPU_CORE_0):
rknpu2_name=C.CpuName.RK356X,
rknpu2_core=C.CoreMask.RKNN_NPU_CORE_AUTO):
return self._option.use_rknpu2(rknpu2_name, rknpu2_core)

def use_sophgo(self):
Expand Down

0 comments on commit 547910f

Please sign in to comment.