同步操作将从 张逸飞/cocoapi 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
%% Demo demonstrating the algorithm result formats for COCO%% select results type for demo (either bbox or segm)type = {'segm','bbox','keypoints'}; type = type{1}; % specify type herefprintf('Running demo for *%s* results.\n\n',type);%% initialize COCO ground truth apidataDir='../'; prefix='instances'; dataType='val2014';if(strcmp(type,'keypoints')), prefix='person_keypoints'; endannFile=sprintf('%s/annotations/%s_%s.json',dataDir,prefix,dataType);cocoGt=CocoApi(annFile);%% initialize COCO detections apiresFile='%s/results/%s_%s_fake%s100_results.json';resFile=sprintf(resFile,dataDir,prefix,dataType,type);cocoDt=cocoGt.loadRes(resFile);%% visialuze gt and dt side by sideimgIds=sort(cocoGt.getImgIds()); imgIds=imgIds(1:100);imgId = imgIds(randi(100)); img = cocoGt.loadImgs(imgId);I = imread(sprintf('%s/images/val2014/%s',dataDir,img.file_name));figure(1); subplot(1,2,1); imagesc(I); axis('image'); axis off;annIds = cocoGt.getAnnIds('imgIds',imgId); title('ground truth')anns = cocoGt.loadAnns(annIds); cocoGt.showAnns(anns);figure(1); subplot(1,2,2); imagesc(I); axis('image'); axis off;annIds = cocoDt.getAnnIds('imgIds',imgId); title('results')anns = cocoDt.loadAnns(annIds); cocoDt.showAnns(anns);%% load raw JSON and show exact format for resultsfprintf('results structure have the following format:\n');res = gason(fileread(resFile)); disp(res)%% the following command can be used to save the results back to diskif(0), f=fopen(resFile,'w'); fwrite(f,gason(res)); fclose(f); end%% run COCO evaluation code (see CocoEval.m)cocoEval=CocoEval(cocoGt,cocoDt,type);cocoEval.params.imgIds=imgIds;cocoEval.evaluate();cocoEval.accumulate();cocoEval.summarize();%% generate Derek Hoiem style analyis of false positives (slow)if(0), cocoEval.analyze(); end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。