darkflow icon indicating copy to clipboard operation
darkflow copied to clipboard

Build Cython for fast YOLOv2

Open ramarajan09 opened this issue 9 years ago • 9 comments

I tried to clone the latest code with cython update and try build cd ./cython_utils python3 setup.py build_ext --inplace

I get the following error, any help? error

ramarajan09 avatar Apr 01 '17 08:04 ramarajan09

i'm having same error!

Prakash19921206 avatar Apr 01 '17 09:04 Prakash19921206

Hmm , I don't have a windows system to test this on. Can you replace the code in setup.py with

from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import numpy

ext_modules=[
    Extension("cy_yolo2_findboxes",
              sources=["cy_yolo2_findboxes.pyx"],
              #libraries=["m"], # Unix-like specific
			  include_dirs=[numpy.get_include()]
    )
]



setup(

    name= 'cy_yolo2_findboxes',
    ext_modules = cythonize(ext_modules),
)

and report back, with the time the box_constructor function takes to execute ?

Dhruv-Mohan avatar Apr 01 '17 10:04 Dhruv-Mohan

Great! that works I can compile now. @Dhruv-Mohan

ramarajan09 avatar Apr 01 '17 10:04 ramarajan09

@ramarajan09 can you also tell me the time box_constructor takes to execute? look in net->yolov2->test.py for the function

Dhruv-Mohan avatar Apr 01 '17 10:04 Dhruv-Mohan

how would I run that function alone?

ramarajan09 avatar Apr 01 '17 10:04 ramarajan09

I'll add the changes for windows specific building, as soon as i've debugged the cythonised yolov1 models

Dhruv-Mohan avatar Apr 01 '17 16:04 Dhruv-Mohan

I have the same problem on OS X. Theoretically the includes should be resolved, but they aren't.

eljefedelrodeodeljefe avatar Apr 21 '17 21:04 eljefedelrodeodeljefe

This solves it (on OS X), as I apparently header locations of numpy don't get passed through. No expert with a real solution though...

python3 setup.py build_ext --inplace --include-dirs=/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/core/include

eljefedelrodeodeljefe avatar Apr 21 '17 21:04 eljefedelrodeodeljefe

Original Issue is resolved.

thtrieu avatar May 19 '17 04:05 thtrieu