2017-08-03 14:26:48 +03:00
|
|
|
# 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
|
2017-11-08 03:27:06 +03:00
|
|
|
import pdb
|
2017-08-03 14:26:48 +03:00
|
|
|
|
2017-11-08 03:27:06 +03:00
|
|
|
net = dn.load_net("cfg/yolo-tag.cfg", "yolo-tag_final.weights", 0)
|
|
|
|
meta = dn.load_meta("cfg/openimages.data")
|
|
|
|
pdb.set_trace()
|
|
|
|
rr = dn.detect(net, meta, 'data/dog.jpg')
|
|
|
|
print rr
|
|
|
|
pdb.set_trace()
|
2017-08-03 14:26:48 +03:00
|
|
|
|
|
|
|
# And then down here you could detect a lot more images like:
|
2017-11-08 03:27:06 +03:00
|
|
|
rr = dn.detect(net, meta, "data/eagle.jpg")
|
|
|
|
print rr
|
|
|
|
rr = dn.detect(net, meta, "data/giraffe.jpg")
|
|
|
|
print rr
|
|
|
|
rr = dn.detect(net, meta, "data/horses.jpg")
|
|
|
|
print rr
|
|
|
|
rr = dn.detect(net, meta, "data/person.jpg")
|
|
|
|
print rr
|
2017-08-03 14:26:48 +03:00
|
|
|
|