From 8327154a673d14dfc237d2b55e9aa50a092f243f Mon Sep 17 00:00:00 2001 From: Joseph Redmon Date: Thu, 3 Aug 2017 04:26:48 -0700 Subject: [PATCH] OK ADDED ONE MORE EXAMPLE BUT NOW I'M REALLY GONE FOR SERIOUS BACK IN A WHILE --- examples/detector.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 examples/detector.py diff --git a/examples/detector.py b/examples/detector.py new file mode 100644 index 00000000..10697bab --- /dev/null +++ b/examples/detector.py @@ -0,0 +1,25 @@ +# Stupid python path shit. +# Instead just add darknet.py to somewhere in your python path +# OK actually that might not be a great idea, idk, work in progress +# Use at your own risk. or don't, i don't care + +import sys, os +sys.path.append(os.path.join(os.getcwd(),'python/')) + +import darknet as dn + +net = dn.load_net("cfg/tiny-yolo.cfg", "tiny-yolo.backup", 0) +meta = dn.load_meta("cfg/coco.data") +r = dn.detect(net, meta, "data/dog.jpg") +print r + +# And then down here you could detect a lot more images like: +r = dn.detect(net, meta, "data/eagle.jpg") +print r +r = dn.detect(net, meta, "data/giraffe.jpg") +print r +r = dn.detect(net, meta, "data/horses.jpg") +print r +r = dn.detect(net, meta, "data/person.jpg") +print r +