91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 250KB
    文件類型: .tar
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-06-13
  • 語言: 其他
  • 標(biāo)簽: VOCdevkit??

資源簡介

VOCdevkit2007開發(fā)包,不包含dataset。

資源截圖

代碼片段和文件信息

%?Creates?segmentation?results?from?detection?results.?
%?CREATE_SEGMENTATIONS_FROM_DETECTIONS(ID)?creates?segmentations?from?
%?the?detection?results?with?identifier?ID?e.g.?‘comp3‘.??All?detections
%?will?be?used?no?matter?what?their?confidence?level.
%
%?CREATE_SEGMENTATIONS_FROM_DETECTIONS(ID?CONFIDENCE)?as?above?but?only?
%?detections?above?the?specified?confidence?will?be?used.??
function?create_segmentations_from_detections(idconfidence)

if?nargin<2
????confidence?=?-inf;
end

%?change?this?path?if?you?install?the?VOC?code?elsewhere
addpath([cd?‘/VOCcode‘]);

%?initialize?VOC?options
VOCinit;?

%?load?detection?results?

tic;
imgids={};
for?clsnum?=?1:VOCopts.nclasses
????resultsfile?=?sprintf(VOCopts.detrespathidVOCopts.classes{clsnum});
????if?~exist(resultsfile‘file‘)
????????error(‘Could?not?find?detection?results?file?to?use?to?create?segmentations?(%s?not?found)‘resultsfile);
????end
????[idsconfsb1b2b3b4]=textread(resultsfile‘%s?%f?%f?%f?%f?%f‘);
????BBOXS=[b1?b2?b3?b4];
????previd=‘‘;
????for?j=1:numel(ids)
????????%?display?progress
????????if?toc>1
????????????fprintf(‘class?%d/%d:?load?detections:?%d/%d\n‘clsnumVOCopts.nclassesjnumel(ids));
????????????drawnow;
????????????tic;
????????end
????????
????????imgid?=?ids{j};
????????conf?=?confs(j);
????????
????????if?~strcmp(imgidprevid)
????????????ind?=?strmatch(imgidimgids‘exact‘);
????????end
????????
????????detinfo.clsnum?=?clsnum;
????????detinfo.conf?=?conf;
????????detinfo.bbox?=?BBOXS(j:);????????
????????if?isempty(ind)
????????????imgids{end+1}=imgid;
????????????ind?=?numel(imgids);
????????????detnum=1;
????????else
????????????detnum?=?numel(im(ind).det)+1;
????????end
????????im(ind).det(detnum)?=?detinfo;????????
????end
end

%?Write?out?the?segmentations
resultsdir?=?sprintf(VOCopts.seg.clsresdiridVOCopts.testset);
resultsdirinst?=?sprintf(VOCopts.seg.instresdiridVOCopts.testset);

if?~exist(resultsdir‘dir‘)
????mkdir(resultsdir);
end

if?~exist(resultsdirinst‘dir‘)
????mkdir(resultsdirinst);
end

cmap?=?VOClabelcolormap(255);
tic;
for?j=1:numel(imgids)
????%?display?progress
????if?toc>1
????????fprintf(‘make?segmentation:?%d/%d\n‘jnumel(imgids));
????????drawnow;
????????tic;
????end
????imname?=?imgids{j};

????classlabelfile?=?sprintf(VOCopts.seg.clsrespathidVOCopts.testsetimname);
????instlabelfile?=?sprintf(VOCopts.seg.instrespathidVOCopts.testsetimname);

????imgfile?=?sprintf(VOCopts.imgpathimname);
????imginfo?=?imfinfo(imgfile);

????[instimclassim]=?convert_dets_to_image(imginfo.Width?imginfo.Heightim(j).detconfidence);
????imwrite(instimcmapinstlabelfile);
????imwrite(classimcmapclasslabelfile);????
????
%?Copy?in?ground?truth?-?uncomment?to?copy?ground?truth?segmentations?in
%?for?comparison
%????gtlabelfile?=?[VOCopts.root?‘/Segmentations(class)/‘?imname?‘.png‘];
%????gtclasslabelfile?=?sprintf(‘%s/%d_gt.png‘resultsdirimnums(j));????????
%????copyfile(gtlabelfilegtclasslabelfile);
end

%?Converts?a?s

評論

共有 條評論

相關(guān)資源