SEE I TOTALLY LISTEN TO MY COMMUNITY SOMETIMES I'M LOOKING AT YOU ISSUE \#291

This commit is contained in:
Joseph Redmon 2017-11-07 16:22:09 -08:00
parent 1a63695c44
commit 16686cec57
3 changed files with 6 additions and 0 deletions

View File

@ -8,6 +8,7 @@ sys.path.append(os.path.join(os.getcwd(),'python/'))
import darknet as dn
dn.set_gpu(0)
net = dn.load_net("cfg/tiny-yolo.cfg", "tiny-yolo.weights", 0)
meta = dn.load_meta("cfg/coco.data")
r = dn.detect(net, meta, "data/dog.jpg")

View File

@ -44,6 +44,9 @@ predict = lib.network_predict
predict.argtypes = [c_void_p, POINTER(c_float)]
predict.restype = POINTER(c_float)
set_gpu = lib.cuda_set_device
set_gpu.argtypes = [c_int]
make_image = lib.make_image
make_image.argtypes = [c_int, c_int, c_int]
make_image.restype = IMAGE

View File

@ -172,5 +172,7 @@ float cuda_mag_array(float *x_gpu, size_t n)
free(temp);
return m;
}
#else
void cuda_set_device(int n){}
#endif