# import numpy as np all_gt = np.loadtxt(imdb_path+'/groundtruth.txt',delimiter=',') <<<<<<< HEAD t = dlib.correlation_tracker() ol = np.zeros(img_count-10) for i in xrange(img_count-10): img = cv2.imread(imdb_path+'/%08d.jpg'%(i+1)) t.start_track(img, dlib.rectangle(*all_gt[i])) img2 = cv2.imread(imdb_path+'/%08d.jpg'%(i+10)) t.update() rect = tracker.get_position() box = [int(rect.left()),int(rect.top()),int(rect.right()),int(rect.bottom())] ol[i] = overlap(box, all_gt[i+9]) import matplotlib.pyplot as plt ======= # print all_gt.shape all_gt = all_gt[:,[2,3,6,7]].astype(np.int) print all_gt.shape t = dlib.correlation_tracker() ol = np.zeros(img_count-60) for i in xrange(img_count-60): img = cv2.imread(imdb_path+'/%08d.jpg'%(i+1)) t.start_track(img, dlib.rectangle(*all_gt[i])) img2 = cv2.imread(imdb_path+'/%08d.jpg'%(i+60))
logfile_path = os.path.join(this_file_path,'logfile', logfile) print 'IMG path:', imdb_path assert os.path.exists(imdb_path) _, _, files = os.walk(imdb_path).next() img_count = len(files) - 7 print 'IMG count:', img_count all_gt = np.loadtxt(imdb_path+'/groundtruth.txt',delimiter=',') result = np.loadtxt(logfile_path) # print result[:,0] gt = all_gt[result[:-1,0].astype(np.int)-1,:] #print gt gt = gt[:,[2,3,6,7]] print gt boxes = result[:-1,1:] # su = success(boxes,gt,100) fc = boxes.shape[0] su = np.zeros(fc) for i in xrange(fc): su[i] = overlap(gt[i],boxes[i]) plt.plot(su) plt.show()