From 1d37c748249720a687eaf4ee7dae040545dd0143 Mon Sep 17 00:00:00 2001 From: Daniel Gordon Date: Thu, 15 Mar 2018 18:21:21 -0700 Subject: [PATCH] removing changes for pull request, but those files don't work well anymore anyways --- .gitignore | 1 - examples/detector-scipy-opencv.py | 17 ++++++----------- examples/detector.py | 19 +++++++++---------- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 40b39e0c..e01738d4 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,5 @@ ehthumbs.db Icon? Thumbs.db *.swp -*.weights *.a *.so diff --git a/examples/detector-scipy-opencv.py b/examples/detector-scipy-opencv.py index 88efaa24..bcf6475c 100644 --- a/examples/detector-scipy-opencv.py +++ b/examples/detector-scipy-opencv.py @@ -38,23 +38,18 @@ import darknet as dn # Darknet net = dn.load_net("cfg/tiny-yolo.cfg", "tiny-yolo.weights", 0) meta = dn.load_meta("cfg/coco.data") -import time -tStart = time.time() -for i in range(10): - r = dn.detect(net, meta, "data/dog.jpg") -print(time.time() - tStart) +r = dn.detect(net, meta, "data/dog.jpg") +print(r) # scipy arr= imread('data/dog.jpg') -tStart = time.time() -for i in range(10): - r = dn.detect(net, meta, arr) -print(time.time() - tStart) +im = array_to_image(arr) +r = detect2(net, meta, im) +print(r) # OpenCV arr = cv2.imread('data/dog.jpg') im = array_to_image(arr) dn.rgbgr_image(im) r = detect2(net, meta, im) -print r - +print(r) diff --git a/examples/detector.py b/examples/detector.py index 61868112..039c0f20 100644 --- a/examples/detector.py +++ b/examples/detector.py @@ -13,15 +13,14 @@ dn.set_gpu(0) net = dn.load_net("cfg/yolo-thor.cfg", "/home/pjreddie/backup/yolo-thor_final.weights", 0) meta = dn.load_meta("cfg/thor.data") r = dn.detect(net, meta, "data/bedroom.jpg") -print r +print(r) # And then down here you could detect a lot more images like: -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 - +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)