This commit is contained in:
Daniel Gordon 2018-03-15 13:33:41 -07:00
parent ffa8c699a8
commit 6fc177fa5c

View File

@ -13,7 +13,7 @@ def sample(probs):
return len(probs)-1
def c_array(ctype, values):
arr = (ctype * len(values))()
arr = (ctype*len(values))()
arr[:] = values
return arr
@ -42,7 +42,7 @@ class METADATA(Structure):
_fields_ = [("classes", c_int),
("names", POINTER(c_char_p))]
#lib = CDLL("/home/pjreddie/documents/darknet/libdarknet.so", RTLD_GLOBAL)
lib = CDLL("libdarknet.so", RTLD_GLOBAL)
@ -143,7 +143,7 @@ def detect(net, meta, image, thresh=.5, hier_thresh=.5, nms=.45):
free_image(im)
free_detections(dets, num)
return res
if __name__ == "__main__":
#net = load_net("cfg/densenet201.cfg", "/home/pjreddie/trained/densenet201.weights", 0)
#im = load_image("data/wolf.jpg", 0, 0)
@ -153,4 +153,6 @@ if __name__ == "__main__":
net = load_net("cfg/tiny-yolo.cfg", "tiny-yolo.weights", 0)
meta = load_meta("cfg/coco.data")
r = detect(net, meta, "data/dog.jpg")
print r
print(r)