예제 #1
0
파일: compare.py 프로젝트: Abdelpakey/CTT
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
예제 #2
0
파일: compare.py 프로젝트: ZhouYzzz/CTT
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
예제 #3
0
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