repo_description: Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
repo_topics: convolutional-networks convolutional-neural-networks darknet deep-learning deep-neural-networks graph image-processing machine-learning mobile-development object-detection real-time tensorflow
code: 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)
  )