- 如果在运行“perfPlot.m“文件时提示” 未定义函数或变量 'calcRectInt' “,只要把“restEval”文件夹addpath到就好了perfPlots
- “结构体内容引用自非结构体对象” 数据集的问题,没配对上,把出问题的那条数据集注释了就行
- (这条是抄的)util/configTrcakers.m文件,打开,这里面是所有跟踪算法名字的数组,会在main_running.m和perfPlot.m中被调用到。因为results文件夹中已经包含已有跟踪算法的测试结果,所以其实没必要再重新跑一遍所有算法,时间太长。故而直接将configTrackers.m文件中的所有注释掉,改成如下三行代码即可:(就是说让这个文件夹里只有你自己写的跟踪算法,这样一会执行main_running.m的时候,就不用在测试集上挨个跑已有跟踪算法了)
function trackers=configTrackers
trackersNEW={struct('name','LCSVM','namePaper','LCSVM')};
trackers=trackersNEW;
————————————————
版权声明:本文为CSDN博主「劲草浅躬行」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/lcb_coconut/article/details/76512707 -
错误使用 vertcat 串联的矩阵的维度不一致
没事儿 改去吧 你数据集有问题 重新复制粘贴一行行改地址去吧
- 最后跑通的main_running如下
-
close all clear clc warning off all; addpath('./util'); addpath(('E:\code\vlfeat-0.9.21-bin\vlfeat-0.9.21\toolbox')); vl_setup addpath(('./rstEval')); addpath(['./trackers/VIVID_Tracker']) seqs=configSeqs; trackers=configTrackers; shiftTypeSet = {'left','right','up','down','topLeft','topRight','bottomLeft','bottomRight','scale_8','scale_9','scale_11','scale_12'}; evalType='TRE'; %'OPE','SRE','TRE' diary(['./tmp/' evalType '.txt']); numSeq=length(seqs); numTrk=length(trackers); finalPath = ['./results/results_' evalType '_CVPR13/']; if ~exist(finalPath,'dir') mkdir(finalPath); end tmpRes_path = ['./tmp/' evalType '/']; bSaveImage=0; if ~exist(tmpRes_path,'dir') mkdir(tmpRes_path); end pathAnno = './anno/'; for idxSeq=1:length(seqs) s = seqs{idxSeq}; % if ~strcmp(s.name, 'coke') % continue; % end s.len = s.endFrame - s.startFrame + 1; s.s_frames = cell(s.len,1); nz = strcat('%0',num2str(s.nz),'d'); %number of zeros in the name of image for i=1:s.len image_no = s.startFrame + (i-1); id = sprintf(nz,image_no); s.s_frames{i} = strcat(s.path,id,'.',s.ext); end img = imread(s.s_frames{1}); [imgH,imgW,ch]=size(img); rect_anno = dlmread([pathAnno s.name '.txt']); numSeg = 20; [subSeqs, subAnno]=splitSeqTRE(s,numSeg,rect_anno); switch evalType case 'SRE' subS = subSeqs{1}; subA = subAnno{1}; subSeqs=[]; subAnno=[]; r=subS.init_rect; for i=1:length(shiftTypeSet) subSeqs{i} = subS; shiftType = shiftTypeSet{i}; subSeqs{i}.init_rect=shiftInitBB(subS.init_rect,shiftType,imgH,imgW); subSeqs{i}.shiftType = shiftType; subAnno{i} = subA; end case 'OPE' subS = subSeqs{1}; subSeqs=[]; subSeqs{1} = subS; subA = subAnno{1}; subAnno=[]; subAnno{1} = subA; otherwise end for idxTrk=1:numTrk t = trackers{idxTrk}; % if ~strcmp(t.name, 'LSK') % continue; % end % validate the results if exist([finalPath s.name '_' t.name '.mat']) load([finalPath s.name '_' t.name '.mat']); bfail=checkResult(results, subAnno); if bfail disp([s.name ' ' t.name]); end continue; end switch t.name case {'VTD','VTS'} continue; end results = []; for idx=1:length(subSeqs) disp([num2str(idxTrk) '_' t.name ', ' num2str(idxSeq) '_' s.name ': ' num2str(idx) '/' num2str(length(subSeqs))]) rp = [tmpRes_path s.name '_' t.name '_' num2str(idx) '/']; if bSaveImage&~exist(rp,'dir') mkdir(rp); end subS = subSeqs{idx}; subS.name = [subS.name '_' num2str(idx)]; % subS.s_frames = subS.s_frames(1:20); % subS.len=20; % subS.endFrame=subS.startFrame+subS.len-1; funcName = ['res=run_' t.name '(subS, rp, bSaveImage);']; try switch t.name case {'VR','TM','RS','PD','MS'} otherwise cd(['./trackers/' t.name]); addpath(genpath('./')) end eval(funcName); switch t.name case {'VR','TM','RS','PD','MS'} otherwise rmpath(genpath('./')) cd('../../'); end if isempty(res) results = []; break; end catch err disp('error'); rmpath(genpath('./')) cd