-
大小: 6.82MB文件类型: .bz2金币: 1下载: 0 次发布日期: 2023-09-30
- 语言: C/C++
- 标签: dlib face_detecet
资源简介
最新版的dlib19.4需要VS2015支持c++11的一些新特性,上传的为18.18版,该版本可在VS2013下使用。
代码片段和文件信息
“““setup for the dlib project
Copyright (C) 2015 Ehsan Azar (dashesy@linux.com)
License: Boost Software License See LICENSE.txt for the full license.
This file basically just uses CMake to compile the dlib python bindings project
located in the tools/python folder and then puts the outputs into standard
python packages.
To build the dlib:
python setup.py build
To build and install:
python setup.py install
To package the wheel:
python setup.py bdist_wheel
To repackage the previously built package as wheel (bypassing build):
python setup.py bdist_wheel --repackage
To install a develop version (egg with symbolic link):
python setup.py develop
To exclude/include certain options in the cmake config use --yes and --no:
for example:
--yes DLIB_NO_GUI_SUPPORT: will set -DDLIB_NO_GUI_SUPPORT=yes
--no DLIB_NO_GUI_SUPPORT: will set -DDLIB_NO_GUI_SUPPORT=no
Additional options:
--debug: makes a debug build
--cmake: path to specific cmake executable
--G or -G: name of a build system generator (equivalent of passing -G “name“ to cmake)
“““
from __future__ import print_function
import shutil
import stat
import errno
from setuptools.command.bdist_egg import bdist_egg as _bdist_egg
from setuptools.command.develop import develop as _develop
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.build import build as _build
from distutils.errors import DistutilsSetupError
from distutils.spawn import find_executable
from distutils.sysconfig import get_python_inc get_python_version
from distutils import log
import os
import sys
from setuptools import Extension setup
import platform
from subprocess import Popen PIPE STDOUT
import signal
from threading import Thread
import time
import re
# change directory to this module path
try:
this_file = __file__
except NameError:
this_file = sys.argv[0]
this_file = os.path.abspath(this_file)
if os.path.dirname(this_file):
os.chdir(os.path.dirname(this_file))
script_dir = os.getcwd()
def _get_options():
“““read arguments and creates options
“““
_cmake_path = find_executable(“cmake“)
_cmake_extra = []
_cmake_config = ‘Release‘
_options = []
opt_key = None
_generator_set = False # if a build generator is set
argv = [arg for arg in sys.argv] # take a copy
# parse commandline options and consume those we care about
for opt_idx arg in enumerate(argv):
if opt_key == ‘cmake‘:
_cmake_path = arg
elif opt_key == ‘yes‘:
_cmake_extra.append(‘-D{arg}=yes‘.format(arg=arg.strip()))
elif opt_key == ‘no‘:
_cmake_extra.append(‘-D{arg}=no‘.format(arg=arg.strip()))
elif opt_key == ‘G‘:
_cmake_extra += [‘-G‘ arg.strip()]
_generator_set = True
if opt_key:
sys.argv.remove(arg)
opt_key = None
continue
# Keep -G to resemble cmake‘s
if arg == ‘-G‘ or arg
评论
共有 条评论