mirror of
https://github.com/open-mmlab/mmdeploy.git
synced 2025-01-14 08:09:43 +08:00
* simplify deps management * skip visibility flags for MSVC * simplify cuda deps * naming * workaround for cmake<3.17 * add spdlog dependency * move the enablement of CUDA to top level CMakeLists.txt * fix MSVC build * fix lint * fix build for backend ops only * remove comment * allow to use apis/python as a standalone project * remove redundant cmake code * control shared or static lib using `MMDEPLOY_SHARED_LIBS` instead of `BUILD_SHARED_LIBS` * fix MSVC build * update docs
32 lines
688 B
C++
32 lines
688 B
C++
// Copyright (c) OpenMMLab. All rights reserved.
|
|
|
|
#ifndef MMDEPLOY_CSRC_APIS_PYTHON_COMMON_H_
|
|
#define MMDEPLOY_CSRC_APIS_PYTHON_COMMON_H_
|
|
|
|
#include <stdexcept>
|
|
|
|
#include "c/common.h"
|
|
#include "pybind11/numpy.h"
|
|
#include "pybind11/pybind11.h"
|
|
#include "pybind11/stl.h"
|
|
|
|
namespace py = pybind11;
|
|
|
|
using PyImage = py::array_t<uint8_t, py::array::c_style | py::array::forcecast>;
|
|
|
|
namespace mmdeploy {
|
|
|
|
std::map<std::string, void (*)(py::module &)> &gPythonBindings();
|
|
|
|
mm_mat_t GetMat(const PyImage &img);
|
|
|
|
class Value;
|
|
|
|
py::object ConvertToPyObject(const Value &value);
|
|
|
|
Value ConvertToValue(const py::object &obj);
|
|
|
|
} // namespace mmdeploy
|
|
|
|
#endif // MMDEPLOY_CSRC_APIS_PYTHON_COMMON_H_
|