加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setup.py 2.51 KB
一键复制 编辑 原始数据 按行查看 历史
Markey, Nigel 提交于 2017-04-25 16:54 . Added support for macOS
from setuptools import setup, find_packages
from setuptools.extension import Extension
from Cython.Build import cythonize
import numpy
import os
import imp
VERSION = imp.load_source('version', os.path.join('.', 'darkflow', 'version.py'))
VERSION = VERSION.__version__
if os.name =='nt' :
ext_modules=[
Extension("darkflow.cython_utils.nms",
sources=["darkflow/cython_utils/nms.pyx"],
#libraries=["m"] # Unix-like specific
include_dirs=[numpy.get_include()]
),
Extension("darkflow.cython_utils.cy_yolo2_findboxes",
sources=["darkflow/cython_utils/cy_yolo2_findboxes.pyx"],
#libraries=["m"] # Unix-like specific
include_dirs=[numpy.get_include()]
),
Extension("darkflow.cython_utils.cy_yolo_findboxes",
sources=["darkflow/cython_utils/cy_yolo_findboxes.pyx"],
#libraries=["m"] # Unix-like specific
include_dirs=[numpy.get_include()]
)
]
elif os.name =='posix' :
ext_modules=[
Extension("darkflow.cython_utils.nms",
sources=["darkflow/cython_utils/nms.pyx"],
libraries=["m"], # Unix-like specific
include_dirs=[numpy.get_include()]
),
Extension("darkflow.cython_utils.cy_yolo2_findboxes",
sources=["darkflow/cython_utils/cy_yolo2_findboxes.pyx"],
libraries=["m"], # Unix-like specific
include_dirs=[numpy.get_include()]
),
Extension("darkflow.cython_utils.cy_yolo_findboxes",
sources=["darkflow/cython_utils/cy_yolo_findboxes.pyx"],
libraries=["m"], # Unix-like specific
include_dirs=[numpy.get_include()]
)
]
else :
ext_modules=[
Extension("darkflow.cython_utils.nms",
sources=["darkflow/cython_utils/nms.pyx"],
libraries=["m"] # Unix-like specific
),
Extension("darkflow.cython_utils.cy_yolo2_findboxes",
sources=["darkflow/cython_utils/cy_yolo2_findboxes.pyx"],
libraries=["m"] # Unix-like specific
),
Extension("darkflow.cython_utils.cy_yolo_findboxes",
sources=["darkflow/cython_utils/cy_yolo_findboxes.pyx"],
libraries=["m"] # Unix-like specific
)
]
setup(
version=VERSION,
name='darkflow',
description='Darkflow',
license='GPLv3',
url='https://github.com/thtrieu/darkflow',
packages = find_packages(),
scripts = ['flow'],
ext_modules = cythonize(ext_modules)
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化