From e5b55e767edadf78f73fa854ddf4a257584a959a Mon Sep 17 00:00:00 2001 From: pdollar Date: Fri, 29 Sep 2017 16:21:41 -0700 Subject: [PATCH] removed download() function from Matlab API --- MatlabAPI/CocoApi.m | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/MatlabAPI/CocoApi.m b/MatlabAPI/CocoApi.m index 6b13f0e..5cd2833 100644 --- a/MatlabAPI/CocoApi.m +++ b/MatlabAPI/CocoApi.m @@ -27,13 +27,12 @@ classdef CocoApi % loadImgs - Load imgs with the specified ids. % showAnns - Display the specified annotations. % loadRes - Load algorithm results and create API for accessing them. - % download - Download COCO images from mscoco.org server. % Throughout the API "ann"=annotation, "cat"=category, and "img"=image. % Help on each functions can be accessed by: "help CocoApi>function". % % See also CocoApi>CocoApi, CocoApi>getAnnIds, CocoApi>getCatIds, % CocoApi>getImgIds, CocoApi>loadAnns, CocoApi>loadCats, - % CocoApi>loadImgs, CocoApi>showAnns, CocoApi>loadRes, CocoApi>download + % CocoApi>loadImgs, CocoApi>showAnns, CocoApi>loadRes % % Microsoft COCO Toolbox. version 2.0 % Data, paper, and tutorials available at: http://mscoco.org/ @@ -310,25 +309,6 @@ classdef CocoApi fprintf('DONE (t=%0.2fs).\n',etime(clock,clk)); cdata.annotations=R; cocoRes=CocoApi(cdata); end - - function download( coco, tarDir, maxn ) - % Download COCO images from mscoco.org server. - % - % USAGE - % coco.download( tarDir, [maxn] ) - % - % INPUTS - % tarDir - COCO results filename - % maxn - maximum number of images to download - fs={coco.data.images.file_name}; n=length(fs); - if(nargin==3), n=min(n,maxn); end; [fs,o]=sort(fs); - urls={coco.data.images.coco_url}; urls=urls(o); do=true(1,n); - for i=1:n, fs{i}=[tarDir '/' fs{i}]; do(i)=~exist(fs{i},'file'); end - fs=fs(do); urls=urls(do); n=length(fs); if(n==0), return; end - if(~exist(tarDir,'dir')), mkdir(tarDir); end; t=tic; - m='downloaded %i/%i images (t=%.1fs)\n'; o=weboptions('Timeout',60); - for i=1:n, websave(fs{i},urls{i},o); fprintf(m,i,n,toc(t)); end - end end end -- GitLab