Commit ce46db94 authored by Patrik Huber's avatar Patrik Huber

Merge branch 'python-bindings' into devel

parents 6d5f252b 2a02e50c
Subproject commit 29b5064e9c80be7034fc9d6ac15dbb7ebe304fc5
Subproject commit fe40dfe67d2c7d31673ee8d41794897f839eb530
......@@ -43,9 +43,10 @@ add_executable(json-to-cereal-binary json-to-cereal-binary.cpp)
target_link_libraries(json-to-cereal-binary ${OpenCV_LIBS} ${Boost_LIBRARIES})
# Generate python bindings using pybind11:
if(GENERATE_PYTHON_BINDINGS)
pybind11_add_module(eos_py create-python-bindings.cpp)
target_link_libraries(eos_py PRIVATE ${OpenCV_LIBS} ${Boost_LIBRARIES})
install(TARGETS eos_py DESTINATION bin)
pybind11_add_module(python-bindings generate-python-bindings.cpp pybind11_glm.hpp)
target_link_libraries(python-bindings PRIVATE ${OpenCV_LIBS} ${Boost_LIBRARIES})
set_target_properties(python-bindings PROPERTIES OUTPUT_NAME eos)
install(TARGETS python-bindings DESTINATION bin)
endif()
# install target:
......
/*
* eos - A 3D Morphable Model fitting library written in modern C++11/14.
*
* File: utils/create-python-bindings.cpp
*
* Copyright 2016 Patrik Huber
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "eos/morphablemodel/PcaModel.hpp"
#include "pybind11/pybind11.h"
namespace py = pybind11;
/**
* Create python bindings for the eos library using pybind11.
*/
PYBIND11_PLUGIN(eos_py) {
py::module m("eos_py", "Python bindings to the 3D Morphable Face Model fitting library");
py::class_<eos::morphablemodel::PcaModel>(m, "PcaModel")
.def(py::init<>())
.def("get_mean_at_point", &eos::morphablemodel::PcaModel::get_mean_at_point);
return m.ptr();
};
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment