function [rec_all,prec_all,ap_all,map]=Charades_v1_localize(clsfilename,gtpath) % % Input: clsfilename: path of the input file % gtpath: the path of the groundtruth file % % Output: rec_all: recall % prec_all: precision % ap_all: AP for each class % map: MAP % % Please refer to the README.txt file for an overview of how localization performance is evaluated % % Example: % % [rec_all,prec_all,ap_all,map]=Charades_v1_localize('test_submission.txt','Charades_v1_test.csv'); % % Code adapted from THUMOS15 % tic; fprintf('Loading Charades Annotations:\n'); frames_per_video = 25; [gtids,gtclasses] = load_charades_localized(gtpath,frames_per_video); nclasses = 157; ntest = length(gtids); toc; tic; % load test scores fprintf('Reading Submission File:\n'); [testids,framenr,testscores]=textread(clsfilename,'%s%d%[^\n]'); if min(framenr)==0 fprintf('Warning: Frames should be 1 indexed\n'); fprintf('Warning: Adding 1 to all frames numbers\n'); framenr = framenr+1; end toc; tic; fprintf('Parsing Submission Scores:\n'); nInputNum=size(testscores,1); if nInputNum