mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
merged
This commit is contained in:
parent
ffa8c699a8
commit
6fc177fa5c
@ -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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user