mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
SEE I TOTALLY LISTEN TO MY COMMUNITY SOMETIMES I'M LOOKING AT YOU ISSUE \#291
This commit is contained in:
parent
1a63695c44
commit
16686cec57
@ -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")
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user