Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setup for package installation #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Empty file added face3d/mesh/cython/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions face3d/mesh/cython/mesh_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ void _write_obj_with_colors_texture(string filename, string mtl_name,
{
int i;

ofstream obj_file(filename);
ofstream obj_file(filename.c_str());

// first line of the obj file: the mtl name
obj_file << "mtllib " << mtl_name << endl;
Expand All @@ -372,4 +372,4 @@ void _write_obj_with_colors_texture(string filename, string mtl_name,
obj_file << "f " << triangles[3*i + 2] << "/" << triangles[3*i + 2] << " " << triangles[3*i + 1] << "/" << triangles[3*i + 1] << " " << triangles[3*i] << "/" << triangles[3*i] << endl;
}

}
}
23 changes: 23 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from distutils.core import setup
from distutils.extension import Extension

import numpy
from Cython.Distutils import build_ext

cmdclass = {'build_ext': build_ext}
ext_modules = [Extension("face3d.mesh.cython.mesh_core_cython",
sources=["face3d/mesh/cython/mesh_core_cython.pyx", "face3d/mesh/cython/mesh_core.cpp"],
language='c++',
include_dirs=[numpy.get_include(), '.'])]

setup(
name='face3d',
cmdclass=cmdclass,
ext_modules=ext_modules,
version='1.0',
description='Python tools for 3D face: 3DMM, Mesh processing(transform, camera, light, render), '
'3D face representations.',
author='Yao Feng',
author_email='[email protected]',
packages=['face3d', 'face3d.mesh', 'face3d.mesh_numpy', 'face3d.morphable_model', 'face3d.mesh.cython'],
)