aboutsummaryrefslogtreecommitdiffstats
path: root/anime-face-detector/setup.py
diff options
context:
space:
mode:
authorcarp <25677564+carp@users.noreply.github.com>2020-07-13 13:27:55 -0400
committercarp <25677564+carp@users.noreply.github.com>2020-07-13 13:27:55 -0400
commitcb961ed0d6896309336159bda34ed2f75fb60a84 (patch)
tree6d75fcd9bd32b2e884e299ea97e361513036b3a2 /anime-face-detector/setup.py
parente78f351e06e432a607ebadc8de3ea6d27315c088 (diff)
downloadyaoi-communism-cb961ed0d6896309336159bda34ed2f75fb60a84.tar.gz
yaoi-communism-cb961ed0d6896309336159bda34ed2f75fb60a84.zip
add face detection
Diffstat (limited to 'anime-face-detector/setup.py')
-rw-r--r--anime-face-detector/setup.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/anime-face-detector/setup.py b/anime-face-detector/setup.py
new file mode 100644
index 0000000..dc634f5
--- /dev/null
+++ b/anime-face-detector/setup.py
@@ -0,0 +1,42 @@
+# --------------------------------------------------------
+# Fast R-CNN
+# Copyright (c) 2015 Microsoft
+# Licensed under The MIT License [see LICENSE for details]
+# Written by Ross Girshick
+# --------------------------------------------------------
+
+import os
+from os.path import join as pjoin
+import numpy as np
+from distutils.core import setup
+from distutils.extension import Extension
+from Cython.Distutils import build_ext
+import sys
+
+
+# Obtain the numpy include directory. This logic works across numpy versions.
+try:
+ numpy_include = np.get_include()
+except AttributeError:
+ numpy_include = np.get_numpy_include()
+
+# run the customize_compiler
+class custom_build_ext(build_ext):
+ def build_extensions(self):
+ build_ext.build_extensions(self)
+
+ext_modules = [
+ Extension(
+ "nms.cpu_nms",
+ ["nms/cpu_nms.pyx"],
+ extra_compile_args=["-Wno-cpp", "-Wno-unused-function"] if sys.platform == 'linux' else [],
+ include_dirs = [numpy_include]
+ )
+]
+
+setup(
+ name='tf_faster_rcnn',
+ ext_modules=ext_modules,
+ # inject our custom trigger
+ cmdclass={'build_ext': custom_build_ext},
+)