介绍
项目地址:https://davischallenge.org/davis2016/code.html
下载
如下图所示,在DAVIS2016-Download页面,下载matlab代码和数据集
注意事项:
目录结构:
DAVIS2016
|--DAVIS
|--davis-matlab-davis-2016
代码下载:
- 不要用 git clone,git clone的结果是下载了2017的代码。直接在github下载zip,解压。
- 解压时会遇到aux文件夹内容解压失败,这是因为aux是windows保留的名称,因此不能创建名称为aux的文件夹或文件。
创建文件夹aux_ : ..\DAVIS2016\davis-matlab-davis-2016\measures\aux_
把aux中对应内容解压到aux_中
修改 ..\DAVIS2016\davis-matlab-davis-2016\startup.m
使用数据库
参考https://github.com/davisvideochallenge/davis-matlab/tree/davis-2016
安装
- 修改db_root_dir.m,使得地址指向DAVIS数据库在你系统中解压的位置(包含文件夹Annotations和JPEGImages)。
- 运行startup.m,添加必要的路径和执行一些检查操作。
- 如果上一步出问题了,就执行build.m,进行重编译。(没用过)
代码使用
- demo_sweep.m 脚本包含了一个读取数据集图像和注释的demo.
% ------------------------------------------------------------------------
% Jordi Pont-Tuset - http://jponttuset.github.io/
% April 2016
% ------------------------------------------------------------------------
% This file is part of the DAVIS package presented in:
% Federico Perazzi, Jordi Pont-Tuset, Brian McWilliams,
% Luc Van Gool, Markus Gross, Alexander Sorkine-Hornung
% A Benchmark Dataset and Evaluation Methodology for Video Object Segmentation
% CVPR 2016
% Please consider citing the paper if you use this code.
% ------------------------------------------------------------------------
% This script simply reads all images, annotations and
% shows how to sweep all results
% ------------------------------------------------------------------------
addpath(fullfile(db_matlab_root_dir,'db_util'));
% Name of a result technique
% result_id = 'fcp';
% Get the ids of all sequences
seq_ids = db_seqs();
%seq_ids={'bear';'blackswan';'bmx-bumps';'bmx-trees';'boat';'breakdance';'breakdance-flare';'bus';'camel';'car-roundabout';'car-shadow';'car-turn';'cows';'dance-jump';'dance-twirl';'dog';'dog-agility';'drift-chicane';'drift-straight';'drift-turn';'elephant';'flamingo';'goat';'hike';'hockey';'horsejump-high';'horsejump-low';'kite-surf';'kite-walk';'libby';'lucia';'mallard-fly';'mallard-water';'motocross-bumps';'motocross-jump';'motorbike';'paragliding';'paragliding-launch';'parkour';'rhino';'rollerblade';'scooter-black';'scooter-gray';'soapbox';'soccerball';'stroller';'surf';'swing';'tennis';'train'};
% Sweep all sequences
for s_id = 1:length(seq_ids)
% Get all frame ids for that sequence
frame_ids = db_frame_ids(seq_ids{s_id});
%frame_ids={'00000','00001','00002','00003','00004','00005','00006','00007','00008','00009','00010'……};
fprintf('%s contains %d images: \n',seq_ids{s_id},length(frame_ids));
% Sweep all frames
for f_id = 2:length(frame_ids)-1
fprintf('.');
% Read the original image
image = db_read_image(seq_ids{s_id}, frame_ids{f_id});
%doing three things:
%construct the path of the reading images,
%check whether it exit,
%and read the image according to the path.
%image_path = fullfile(db_im_dir, seq_id, [frame_id '.jpg']);
%image = imread(imamge_path);
% Read the object annotation
annot = db_read_annot(seq_ids{s_id}, frame_ids{f_id});
% Read a result
% result = db_read_result(seq_ids{s_id}, frame_ids{f_id}, result_id);
end
fprintf('\n');
end