-
Notifications
You must be signed in to change notification settings - Fork 72
/
demo_e2s2_full.m
35 lines (27 loc) · 1.02 KB
/
demo_e2s2_full.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% demo_e2s2_full()
%
% Trains and tests a Region-based semantic segmentation with end-to-end training on SIFT Flow.
% Requires the version of VGG-16 pretrained with MatConvNet's beta16, and does not
% work with beta20. This is most likely due to exploding gradients, although the architecture is identical.
%
% Copyright by Holger Caesar, 2016
% Add folders to path
setup();
% Settings
global glFeaturesFolder; % Define global variables to be used in all scripts
labelingsFolder = fullfile(glFeaturesFolder, 'CNN-Models', 'E2S2', 'SiftFlow', 'Run1', sprintf('%s_e2s2_run1_exp2', 'SiftFlow'), 'labelings-test-epoch25');
% Download dataset
downloadSiftFlow();
% Download base network
downloadNetwork('version', 'beta16');
% Download Selective Search
downloadSelectiveSearch();
% Extract region proposals and labels
setupE2S2Regions();
% Train and test network
e2s2_wrapper_SiftFlow_full();
% Show example segmentation
fileList = dirSubfolders(labelingsFolder);
image = imread(fullfile(labelingsFolder, fileList{1}));
figure();
imshow(image);