您知道为什么dlib人脸检测不适用于灰度图像吗(python可以很好地用于灰度图像)?
我的代码:
$ cat t20.py
import numpy
from numba import cuda
@cuda.reduce
def or_reduce(a, b):
return a or b
A = numpy.ones(1000, dtype=numpy.int32)
B = numpy.zeros(1000, dtype=numpy.int32)
expect = A.any() # numpy reduction
got = or_reduce(A) # cuda reduction
print expect
print got
expect = B.any() # numpy reduction
got = or_reduce(B) # cuda reduction
print expect
print got
B[100] = 1
expect = B.any() # numpy reduction
got = or_reduce(B) # cuda reduction
print expect
print got
$ python t20.py
True
1
False
0
True
1
$
如何使其工作?
答案 0 :(得分:0)
在我看来,您的代码没有错。我的也是。您应该检查