diff --git a/python/darknet.py b/python/darknet.py index 203096b5..ca3c388f 100644 --- a/python/darknet.py +++ b/python/darknet.py @@ -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) + +