def success(boxes, grdTruth, n=100): assert boxes.shape == grdTruth.shape nFrame = boxes.shape[0] count = np.zeros(n) for i in xrange(nFrame): score = overlap(boxes[i], grdTruth[i]) count[:int(np.floor(n * score))] += 1 return count / nFrame
def success(boxes, grdTruth, n=10): assert boxes.shape == grdTruth.shape nFrame = boxes.shape[0] count = np.zeros(n) for i in xrange(nFrame): score = overlap(boxes[i], grdTruth[i]) count[:int(np.floor(n*score))] += 1 return count/nFrame
GT = readGT(imdb_name) for idx in xrange(0,img_count): # print 'Frame', idx + 1 img = cv2.imread(imdb_path+'/%08d.jpg'%(idx+1)) # print img.shape assert img != None try: tracker except NameError: tracker = dlib.correlation_tracker() tracker.start_track(img, dlib.rectangle(*initbox)) tracker.update(img) rect = tracker.get_position() box = [int(rect.left()), int(rect.top()),\ int(rect.right()), int(rect.bottom())] print overlap(box,GT[idx]) # pt1 = (int(rect.left()),int(rect.top())) # pt2 = (int(rect.right()),int(rect.bottom())) # print pt1, pt2 # cv2.rectangle(img,pt1,pt2,(255,255,255),2) # cv2.imshow('Vedio', img) # cv2.waitKey(100) print tracker