idamnjanovic@1
|
1 function SMALLboxSetup(varargin)
|
ivan@110
|
2 %% SMALLboxSetup
|
ivan@107
|
3 %
|
ivan@107
|
4 % Will automatically download and install existing toolboxes
|
ivan@107
|
5 % on sparse representations and dictionary learning
|
ivan@107
|
6 %
|
ivan@107
|
7 % For this function an internet connection is required.
|
ivan@107
|
8 %
|
ivan@107
|
9 % SMALLbox initialisation
|
ivan@107
|
10
|
idamnjanovic@23
|
11 %
|
idamnjanovic@23
|
12 % Centre for Digital Music, Queen Mary, University of London.
|
idamnjanovic@23
|
13 % This file copyright 2009 Ivan Damnjanovic, Matthew Davies.
|
idamnjanovic@23
|
14 %
|
idamnjanovic@23
|
15 % This program is free software; you can redistribute it and/or
|
idamnjanovic@23
|
16 % modify it under the terms of the GNU General Public License as
|
idamnjanovic@23
|
17 % published by the Free Software Foundation; either version 2 of the
|
idamnjanovic@23
|
18 % License, or (at your option) any later version. See the file
|
idamnjanovic@23
|
19 % COPYING included with this distribution for more information.
|
idamnjanovic@23
|
20 %
|
idamnjanovic@12
|
21 %%
|
idamnjanovic@1
|
22 clc;
|
idamnjanovic@1
|
23
|
idamnjanovic@1
|
24 FS=filesep;
|
idamnjanovic@1
|
25
|
idamnjanovic@1
|
26 fprintf('\n ********************************************************************');
|
ivan@133
|
27 fprintf('\n\n This script will install the SMALLbox Evaluation Framework v.1.1');
|
idamnjanovic@1
|
28 fprintf('\n\n It contains the following toolboxes:');
|
ivan@133
|
29 fprintf('\n Sparco version 1.2');
|
idamnjanovic@1
|
30 fprintf('\n SPGL1 Toolbox version 1.7 ');
|
idamnjanovic@1
|
31 fprintf('\n SparseLab Toolbox version 2.1');
|
idamnjanovic@1
|
32 fprintf('\n Sparsify Toolbox version 0.4');
|
idamnjanovic@1
|
33 fprintf('\n GPSR Toolbox version 5.0');
|
idamnjanovic@12
|
34 fprintf('\n OMPbox version 10');
|
idamnjanovic@12
|
35 fprintf('\n OMPSbox version 1');
|
idamnjanovic@12
|
36 fprintf('\n KSVDbox version 13');
|
idamnjanovic@12
|
37 fprintf('\n KSVDSbox version 11');
|
ivan@133
|
38 fprintf('\n Rice Wavelet toolbox');
|
ivan@133
|
39 fprintf('\n CVX version 1.21');
|
idamnjanovic@1
|
40 fprintf('\n\n ********************************************************************');
|
idamnjanovic@1
|
41
|
idamnjanovic@1
|
42 fprintf('\n\n The toolbox will be installed in: ');
|
idamnjanovic@1
|
43 fprintf('\n %s%s\n',pwd,FS);
|
idamnjanovic@1
|
44 fprintf('\n ********************************************************************');
|
idamnjanovic@1
|
45 fprintf('\n\n IMPORTANT: To successfully install all toolboxes');
|
idamnjanovic@1
|
46 fprintf('\n you will need to have MEX setup to compile C files.');
|
idamnjanovic@1
|
47 fprintf('\n\n If this is not already setup, please type "n" to exit and then ');
|
idamnjanovic@1
|
48 fprintf('\n run "mex -setup" or type "help mex" in the MATLAB command prompt.');
|
idamnjanovic@1
|
49 fprintf('\n\n ********************************************************************');
|
idamnjanovic@1
|
50
|
idamnjanovic@1
|
51
|
idamnjanovic@1
|
52 fprintf('\n ********************************************************************');
|
idamnjanovic@1
|
53 fprintf('\n\n IMPORTANT: YOU MUST HAVE AN INTERNET CONNECTION');
|
idamnjanovic@1
|
54 fprintf('\n YOU CANNOT INSTALL SMALLBOX WITHOUT ONE!');
|
idamnjanovic@1
|
55 fprintf('\n\n ********************************************************************');
|
idamnjanovic@1
|
56 install_ack = input('\n\n Do you wish to continue: ([y]/n)? ','s');
|
idamnjanovic@1
|
57
|
idamnjanovic@1
|
58 if strcmp(install_ack,'"n"'),
|
idamnjanovic@1
|
59 install_ack = 'n';
|
idamnjanovic@1
|
60 end
|
idamnjanovic@1
|
61
|
idamnjanovic@1
|
62 if install_ack == 'n',
|
idamnjanovic@1
|
63 return;
|
idamnjanovic@1
|
64 else
|
idamnjanovic@1
|
65 fprintf('\n\n Installation now beginning...');
|
idamnjanovic@12
|
66
|
idamnjanovic@1
|
67 end
|
idamnjanovic@1
|
68
|
luis@197
|
69 SMALL_path=fileparts(mfilename('fullpath'));
|
idamnjanovic@1
|
70 SMALL_p=genpath(SMALL_path);
|
idamnjanovic@1
|
71 addpath(SMALL_p);
|
idamnjanovic@1
|
72
|
idamnjanovic@12
|
73 %%
|
idamnjanovic@1
|
74
|
idamnjanovic@1
|
75
|
idamnjanovic@12
|
76 if ~exist('sparcoSetup.m','file')
|
idamnjanovic@12
|
77 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
78 fprintf('\n\n Initialising SPARCO and Rice Wavelet Toolbox Setup');
|
idamnjanovic@12
|
79
|
idamnjanovic@1
|
80 Sparco_path = [SMALL_path,FS,'toolboxes',FS,'SPARCO'];
|
idamnjanovic@1
|
81 if exist([Sparco_path, FS, 'sparco-1.2.zip'],'file'),
|
idamnjanovic@1
|
82 Sparco_zip=[Sparco_path, FS, 'sparco-1.2.zip'];
|
idamnjanovic@1
|
83 else
|
idamnjanovic@1
|
84 Sparco_zip='http://www.cs.ubc.ca/labs/scl/sparco/downloads.php?filename=sparco-1.2.zip';
|
idamnjanovic@1
|
85 fprintf('\n\n Downloading toolbox, please be patient\n\n');
|
idamnjanovic@1
|
86 end
|
idamnjanovic@1
|
87 unzip(Sparco_zip,Sparco_path);
|
idamnjanovic@1
|
88 Sparco_p=genpath(Sparco_path);
|
idamnjanovic@1
|
89 addpath(Sparco_p);
|
idamnjanovic@1
|
90 cd(SMALL_path)
|
idamnjanovic@12
|
91
|
idamnjanovic@12
|
92
|
idamnjanovic@12
|
93
|
idamnjanovic@12
|
94 if exist('curvelab.pdf','file')
|
idamnjanovic@12
|
95 crvroot = fileparts(which('curvelab.pdf'));
|
idamnjanovic@12
|
96 addtopath(crvroot,'fdct_usfft_matlab');
|
idamnjanovic@12
|
97 addtopath(crvroot,'fdct_wrapping_matlab');
|
idamnjanovic@12
|
98 addtopath(crvroot,'fdct_wrapping_cpp/mex');
|
idamnjanovic@12
|
99 addtopath(crvroot,'fdct3d/mex');
|
idamnjanovic@12
|
100 else
|
idamnjanovic@12
|
101 fprintf(['\nWarning: CurveLab is not in the path. Sparco Problems 50-51 ' ...
|
idamnjanovic@1
|
102 'will not work.\n\n']);
|
idamnjanovic@12
|
103 end
|
idamnjanovic@12
|
104
|
ivan@78
|
105
|
idamnjanovic@12
|
106 cd(SMALL_path);
|
ivan@80
|
107
|
ivan@78
|
108 fprintf('SPARCO Installation Successful!\n');
|
idamnjanovic@12
|
109 else
|
idamnjanovic@12
|
110 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
111 fprintf('\n\n SPARCO and Rice Wavelet Toolbox are already installed');
|
idamnjanovic@12
|
112 end
|
idamnjanovic@12
|
113 %%
|
ivan@80
|
114 %removing Rice Wavelet tollbox provided with SPARCO from the path, so
|
ivan@80
|
115 %the newer version provided with SMALLbox is used
|
ivan@80
|
116
|
ivan@80
|
117 rmpath([SMALL_path,FS,'toolboxes',FS,'SPARCO',FS,'sparco-1.2',FS,'tools',FS,'rwt']);
|
idamnjanovic@1
|
118
|
idamnjanovic@12
|
119 if ~exist('spgsetup.m','file')
|
idamnjanovic@12
|
120 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
121 fprintf('\n\n Initialising SPGL1 Setup');
|
idamnjanovic@12
|
122
|
idamnjanovic@12
|
123 try
|
idamnjanovic@12
|
124 SPGL1_path = [SMALL_path,FS,'toolboxes',FS,'SPGL1'];
|
idamnjanovic@12
|
125 if exist([SPGL1_path, FS, 'spgl1-1.7.zip'],'file'),
|
idamnjanovic@12
|
126 SPGL1_zip=[SPGL1_path, FS, 'spgl1-1.7.zip'];
|
idamnjanovic@12
|
127 else
|
idamnjanovic@33
|
128 SPGL1_zip='http://www.cs.ubc.ca/~mpf/downloads/spgl1-1.7.zip';
|
idamnjanovic@12
|
129 fprintf('\n\n Downloading toolbox, please be patient\n\n');
|
idamnjanovic@12
|
130 end
|
idamnjanovic@12
|
131 unzip(SPGL1_zip,SPGL1_path);
|
idamnjanovic@12
|
132 SPGL1_p=genpath(SPGL1_path);
|
idamnjanovic@12
|
133 addpath(SPGL1_p);
|
idamnjanovic@12
|
134
|
idamnjanovic@12
|
135
|
idamnjanovic@12
|
136 cd([SPGL1_path,FS,'spgl1-1.7']);
|
idamnjanovic@12
|
137 fprintf('Compiling SPGL1 MEX interfaces ...');
|
idamnjanovic@12
|
138 try
|
idamnjanovic@12
|
139 spgsetup;
|
idamnjanovic@12
|
140 fprintf('\n SPGL1 Installation Successful!\n');
|
idamnjanovic@12
|
141 catch
|
idamnjanovic@12
|
142 warning('Could not compile SPGL1 MEX interfaces.');
|
idamnjanovic@12
|
143 end
|
idamnjanovic@12
|
144 catch
|
idamnjanovic@12
|
145 fprintf('\n SPGL1 Installation Failed\n');
|
idamnjanovic@12
|
146 end
|
idamnjanovic@12
|
147 cd(SMALL_path);
|
idamnjanovic@12
|
148 else
|
idamnjanovic@12
|
149 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
150 fprintf('\n\n SPGL1 is already installed');
|
idamnjanovic@12
|
151 end
|
idamnjanovic@12
|
152 %%
|
idamnjanovic@1
|
153
|
idamnjanovic@12
|
154 if ~exist('SparsePath.m','file')
|
idamnjanovic@12
|
155 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
156 fprintf('\n\n Initialising SparseLab Setup');
|
idamnjanovic@12
|
157
|
idamnjanovic@12
|
158 try
|
idamnjanovic@12
|
159 SL_path = [pwd,FS,'toolboxes',FS,'SparseLab'];
|
idamnjanovic@12
|
160 if exist([SL_path, FS, 'SparseLab21-Core.zip'],'file'),
|
idamnjanovic@12
|
161 SL_zip=[SL_path, FS, 'SparseLab21-Core.zip'];
|
idamnjanovic@12
|
162 else
|
idamnjanovic@12
|
163 SL_zip='http://sparselab.stanford.edu/SparseLab_files/Download_files/SparseLab21-Core.zip';
|
idamnjanovic@12
|
164 fprintf('\n\n Downloading toolbox, please be patient\n\n');
|
idamnjanovic@12
|
165 end
|
idamnjanovic@12
|
166 unzip(SL_zip,SL_path);
|
idamnjanovic@12
|
167 SL_p=genpath(SL_path);
|
idamnjanovic@12
|
168 addpath(SL_p);
|
idamnjanovic@12
|
169 fprintf('\n SparseLab Installation Successful!\n');
|
idamnjanovic@12
|
170 catch
|
idamnjanovic@12
|
171 fprintf('\n SparseLab Installation Failed\n');
|
idamnjanovic@12
|
172 cd(SMALL_path);
|
idamnjanovic@12
|
173 end
|
idamnjanovic@33
|
174 cd(SMALL_path);
|
idamnjanovic@12
|
175 else
|
idamnjanovic@12
|
176 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
177 fprintf('\n\n SparseLab is already installed');
|
idamnjanovic@12
|
178 end
|
idamnjanovic@12
|
179 %%
|
idamnjanovic@1
|
180
|
idamnjanovic@12
|
181 if ~exist('greed_pcgp.m','file')
|
idamnjanovic@12
|
182 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
183 fprintf('\n\n Initialising Sparsify Setup');
|
idamnjanovic@12
|
184
|
idamnjanovic@12
|
185 try
|
idamnjanovic@12
|
186 Sparsify_path = [pwd,FS,'toolboxes',FS,'Sparsify'];
|
idamnjanovic@12
|
187 if exist([Sparsify_path, FS, 'sparsify_0_4.zip'],'file'),
|
idamnjanovic@12
|
188 Sparsify_zip=[Sparsify_path, FS, 'sparsify_0_4.zip'];
|
idamnjanovic@12
|
189 else
|
idamnjanovic@12
|
190 Sparsify_zip='http://www.see.ed.ac.uk/~tblumens/sparsify/sparsify_0_4.zip';
|
idamnjanovic@12
|
191 fprintf('\n\n Downloading toolbox, please be patient\n\n');
|
idamnjanovic@12
|
192 end
|
idamnjanovic@12
|
193 unzip(Sparsify_zip,Sparsify_path);
|
idamnjanovic@12
|
194 Sparsify_p=genpath(Sparsify_path);
|
idamnjanovic@12
|
195 addpath(Sparsify_p);
|
idamnjanovic@12
|
196 fprintf('\n Sparsify Installation Successful\n');
|
idamnjanovic@12
|
197 catch
|
idamnjanovic@12
|
198 fprintf('\n Sparsify Installation Failed\n');
|
idamnjanovic@12
|
199 end
|
idamnjanovic@33
|
200 cd(SMALL_path);
|
idamnjanovic@12
|
201 else
|
idamnjanovic@12
|
202 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
203 fprintf('\n\n Sparsify is already installed');
|
idamnjanovic@12
|
204 end
|
idamnjanovic@12
|
205 %%
|
idamnjanovic@12
|
206 if ~exist('GPSR_Basic.m','file')
|
idamnjanovic@12
|
207 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
208 fprintf('\n\n Initialising GPSR Setup');
|
idamnjanovic@12
|
209
|
idamnjanovic@12
|
210 try
|
idamnjanovic@12
|
211 GPSR_path = [pwd,FS,'toolboxes',FS,'GPSR'];
|
idamnjanovic@12
|
212 if exist([GPSR_path, FS, 'GPSR_6.0.zip'],'file'),
|
idamnjanovic@12
|
213 GPSR_zip=[GPSR_path, FS,'GPSR_6.0.zip'];
|
idamnjanovic@12
|
214 else
|
idamnjanovic@12
|
215 GPSR_zip='http://www.lx.it.pt/~mtf/GPSR/GPSR_6.0.zip';
|
idamnjanovic@12
|
216 fprintf('\n\n Downloading toolbox, please be patient\n\n');
|
idamnjanovic@12
|
217 end
|
idamnjanovic@12
|
218 unzip(GPSR_zip,GPSR_path);
|
idamnjanovic@33
|
219
|
idamnjanovic@12
|
220 GPSR_p=genpath(GPSR_path);
|
idamnjanovic@12
|
221 addpath(GPSR_p);
|
idamnjanovic@12
|
222 fprintf('\n GPSR Installation Successful\n');
|
idamnjanovic@12
|
223 catch
|
idamnjanovic@12
|
224 fprintf('\n GPSR Installation Failed');
|
idamnjanovic@12
|
225 end
|
idamnjanovic@33
|
226 cd(SMALL_path);
|
idamnjanovic@12
|
227 else
|
idamnjanovic@12
|
228 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
229 fprintf('\n\n GPSR is already installed');
|
idamnjanovic@12
|
230 end
|
ivan@133
|
231 %%
|
ivan@133
|
232 if ~exist('cvx_setup.m','file')
|
ivan@133
|
233 fprintf('\n ******************************************************************');
|
ivan@133
|
234 fprintf('\n\n Initialising CVX Setup');
|
ivan@133
|
235
|
ivan@133
|
236 try
|
ivan@133
|
237 CVX_path = [pwd,FS,'toolboxes',FS,'CVX'];
|
ivan@133
|
238 machine=computer;
|
ivan@133
|
239 if (strcmp(machine,'PCWIN')||strcmp(machine,'PCWIN64'))
|
ivan@133
|
240 if exist([CVX_path, FS, 'cvx.zip'],'file'),
|
ivan@133
|
241 CVX_zip=[CVX_path, FS,'cvx.zip'];
|
ivan@133
|
242 else
|
ivan@133
|
243 CVX_zip='http://cvxr.com/cvx/cvx.zip';
|
ivan@133
|
244 fprintf('\n\n Downloading toolbox, please be patient\n\n');
|
ivan@133
|
245 end
|
ivan@133
|
246 unzip(CVX_zip,CVX_path);
|
ivan@133
|
247 else
|
ivan@133
|
248 if exist([CVX_path, FS, 'cvx.tar.gz'],'file'),
|
ivan@133
|
249 CVX_tar=[CVX_path, FS,'cvx.tar.gz'];
|
ivan@133
|
250 else
|
ivan@133
|
251 CVX_tar='http://cvxr.com/cvx/cvx.tar.gz';
|
ivan@133
|
252 fprintf('\n\n Downloading toolbox, please be patient\n\n');
|
ivan@133
|
253 end
|
ivan@133
|
254 untar(CVX_tar,CVX_path);
|
ivan@133
|
255 end
|
ivan@133
|
256 cd([CVX_path,FS,'cvx']);
|
ivan@133
|
257 fprintf('\n\n Running cvx_setup.m script \n\n');
|
ivan@133
|
258 cvx_setup;
|
ivan@133
|
259 fprintf('\n\n Ignore the cvx_setup note about adding the path. It is done automatically in SMALLbox \n\n');
|
ivan@133
|
260 CVX_p=genpath(CVX_path);
|
ivan@133
|
261 addpath(CVX_p);
|
ivan@133
|
262 fprintf('\n CVX Installation Successful\n');
|
ivan@133
|
263 catch
|
ivan@133
|
264 fprintf('\n CVX Installation Failed');
|
ivan@133
|
265 end
|
ivan@133
|
266 cd(SMALL_path);
|
ivan@133
|
267 else
|
ivan@133
|
268 fprintf('\n ******************************************************************');
|
ivan@133
|
269 fprintf('\n\n CVX is already installed');
|
ivan@133
|
270 end
|
idamnjanovic@12
|
271
|
idamnjanovic@12
|
272 %%
|
ivan@140
|
273 %% KSVD utils setup
|
idamnjanovic@12
|
274
|
ivan@140
|
275 if ~(exist('addtocols')==3)
|
ivan@140
|
276 cd([SMALL_path,FS,'util',FS,'ksvd utils']);
|
ivan@140
|
277 make
|
ivan@140
|
278 cd(SMALL_path);
|
ivan@140
|
279 end
|
ivan@140
|
280
|
ivan@141
|
281 %% fast omp for Gabor dictionary
|
ivan@141
|
282
|
ivan@141
|
283 if ~(exist('omp2Gabor')==3)
|
ivan@141
|
284 cd([SMALL_path,FS,'solvers', FS,'SMALL_ompGabor']);
|
ivan@141
|
285 make
|
ivan@141
|
286 cd(SMALL_path);
|
ivan@141
|
287 end
|
ivan@140
|
288 %%
|
idamnjanovic@12
|
289 if ~exist('ksvdver.m','file')
|
idamnjanovic@12
|
290 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
291 fprintf('\n\n Initialising OMPbox and KSVDBox Setup');
|
idamnjanovic@12
|
292
|
idamnjanovic@12
|
293 try
|
idamnjanovic@12
|
294 KSVD_path = [pwd,FS,'toolboxes',FS,'KSVD'];
|
idamnjanovic@12
|
295 if exist([KSVD_path, FS, 'ompbox10.zip'],'file'),
|
idamnjanovic@12
|
296 omp_zip=[KSVD_path, FS, 'ompbox10.zip'];
|
idamnjanovic@12
|
297 else
|
idamnjanovic@12
|
298 omp_zip='http://www.cs.technion.ac.il/%7Eronrubin/Software/ompbox10.zip';
|
idamnjanovic@12
|
299 fprintf('\n\n Downloading toolbox, please be patient\n\n');
|
idamnjanovic@12
|
300 end
|
idamnjanovic@12
|
301 unzip(omp_zip,[KSVD_path, FS, 'ompbox']);
|
idamnjanovic@12
|
302
|
idamnjanovic@12
|
303 cd([KSVD_path, FS, 'ompbox', FS, 'private']);
|
idamnjanovic@12
|
304 make;
|
idamnjanovic@12
|
305 cd(SMALL_path);
|
idamnjanovic@12
|
306
|
idamnjanovic@12
|
307 if exist([KSVD_path, FS, 'ksvdbox13.zip'],'file'),
|
idamnjanovic@12
|
308 KSVD_zip=[KSVD_path, FS, 'ksvdbox13.zip'];
|
idamnjanovic@12
|
309 else
|
idamnjanovic@12
|
310 KSVD_zip='http://www.cs.technion.ac.il/%7Eronrubin/Software/ksvdbox13.zip';
|
idamnjanovic@12
|
311 fprintf('\n\n Downloading toolbox, please be patient\n\n');
|
idamnjanovic@12
|
312 end
|
idamnjanovic@12
|
313 unzip(KSVD_zip,[KSVD_path, FS, 'ksvdbox']);
|
ivan@140
|
314 cd([KSVD_path, FS, 'ksvdbox', FS, 'private']);
|
ivan@140
|
315 make;
|
ivan@140
|
316 cd(SMALL_path);
|
idamnjanovic@12
|
317 KSVD_p=genpath(KSVD_path);
|
idamnjanovic@12
|
318 addpath(KSVD_p);
|
idamnjanovic@12
|
319 fprintf('\n KSVDBox and OMPBox Installation Successful\n');
|
idamnjanovic@12
|
320 catch
|
idamnjanovic@12
|
321 fprintf('\n KSVDBox and OMPBox Installation Failed');
|
idamnjanovic@12
|
322 cd(SMALL_path);
|
idamnjanovic@12
|
323 end
|
idamnjanovic@12
|
324 else
|
idamnjanovic@12
|
325 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
326 fprintf('\n\n KSVD is already installed');
|
idamnjanovic@12
|
327 end
|
idamnjanovic@12
|
328 %%
|
idamnjanovic@12
|
329 if ~exist('ksvdsver.m','file')
|
idamnjanovic@12
|
330 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
331 fprintf('\n\n Initialising OMPSbox and KSVDSBox Setup');
|
idamnjanovic@12
|
332
|
idamnjanovic@12
|
333 try
|
idamnjanovic@12
|
334 KSVDS_path = [pwd,FS,'toolboxes',FS,'KSVDS'];
|
idamnjanovic@12
|
335 if exist([KSVDS_path, FS, 'ompsbox1.zip'],'file'),
|
idamnjanovic@12
|
336 omps_zip=[KSVDS_path, FS, 'ompsbox1.zip'];
|
idamnjanovic@12
|
337 else
|
idamnjanovic@12
|
338 omps_zip='http://www.cs.technion.ac.il/%7Eronrubin/Software/ompsbox1.zip';
|
idamnjanovic@12
|
339 fprintf('\n\n Downloading toolbox, please be patient\n\n');
|
idamnjanovic@12
|
340 end
|
idamnjanovic@12
|
341 unzip(omps_zip,[KSVDS_path, FS, 'ompsbox']);
|
idamnjanovic@12
|
342
|
idamnjanovic@12
|
343 cd([KSVDS_path, FS, 'ompsbox', FS, 'private']);
|
idamnjanovic@12
|
344 make;
|
idamnjanovic@12
|
345 cd(SMALL_path);
|
idamnjanovic@12
|
346
|
idamnjanovic@12
|
347 if exist([KSVDS_path, FS, 'ksvdsbox11.zip'],'file'),
|
idamnjanovic@12
|
348 KSVDS_zip=[KSVDS_path, FS, 'ksvdsbox11.zip'];
|
idamnjanovic@12
|
349 else
|
idamnjanovic@12
|
350 KSVDS_zip='http://www.cs.technion.ac.il/%7Eronrubin/Software/ksvdsbox11.zip';
|
idamnjanovic@12
|
351 fprintf('\n\n Downloading toolbox, please be patient\n\n');
|
idamnjanovic@12
|
352 end
|
idamnjanovic@12
|
353 unzip(KSVDS_zip,[KSVDS_path, FS, 'ksvdsbox']);
|
idamnjanovic@12
|
354 cd([KSVDS_path, FS, 'ksvdsbox', FS, 'private']);
|
idamnjanovic@12
|
355 make;
|
idamnjanovic@12
|
356 cd(SMALL_path);
|
idamnjanovic@12
|
357 KSVDS_p=genpath(KSVDS_path);
|
idamnjanovic@12
|
358 addpath(KSVDS_p);
|
idamnjanovic@12
|
359 fprintf('\n KSVDSbox and OMPSbox Installation Successful\n');
|
idamnjanovic@12
|
360 catch
|
idamnjanovic@12
|
361 fprintf('\n KSVDSbox and OMPSbox Installation Failed');
|
idamnjanovic@12
|
362 cd(SMALL_path);
|
idamnjanovic@12
|
363 end
|
idamnjanovic@12
|
364 else
|
idamnjanovic@12
|
365 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
366 fprintf('\n\n KSVDS is already installed');
|
idamnjanovic@12
|
367 end
|
idamnjanovic@12
|
368 %%
|
idamnjanovic@12
|
369
|
idamnjanovic@12
|
370 if ~exist('mexTrainDL.m','file')
|
idamnjanovic@12
|
371 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
372 fprintf('\n\n If you want to use SMALLbox with SPAMS On-line Dictionary Learning please go to:');
|
idamnjanovic@12
|
373 fprintf('\n http://www.di.ens.fr/willow/SPAMS/index.html');
|
idamnjanovic@12
|
374 fprintf('\n and follow the instructions. The License prohibits redistribution of the SPAMS.');
|
idamnjanovic@12
|
375
|
idamnjanovic@12
|
376 else
|
idamnjanovic@12
|
377 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
378 fprintf('\n\n SPAMS On-line Dictionary Learning is already installed');
|
idamnjanovic@12
|
379 end;
|
idamnjanovic@12
|
380 %%
|
idamnjanovic@12
|
381
|
idamnjanovic@12
|
382
|
idamnjanovic@12
|
383 if ~exist('midiInfo.m','file')
|
idamnjanovic@12
|
384 try
|
idamnjanovic@12
|
385 matlab_midi_path = [pwd,FS,'util',FS,'matlab_midi'];
|
idamnjanovic@12
|
386 if exist([matlab_midi_path, FS, 'matlab_midi.zip'],'file'),
|
idamnjanovic@12
|
387 matlab_midi_zip=[SL_path, FS, 'matlab_midi.zip'];
|
idamnjanovic@1
|
388 else
|
idamnjanovic@12
|
389 matlab_midi_zip='http://www.kenschutte.com/static/code/matlab_midi.zip';
|
idamnjanovic@1
|
390 fprintf('\n\n Downloading toolbox, please be patient\n\n');
|
idamnjanovic@1
|
391 end
|
idamnjanovic@12
|
392 unzip(matlab_midi_zip,matlab_midi_path);
|
idamnjanovic@12
|
393 matlab_midi_p=genpath(matlab_midi_path);
|
idamnjanovic@12
|
394 addpath(matlab_midi_p);
|
idamnjanovic@12
|
395 fprintf('\n matlab_midi (http://www.kenschutte.com/midi/) Installation Successful!\n');
|
idamnjanovic@12
|
396 catch
|
idamnjanovic@12
|
397 fprintf('\n matlab_midi (http://www.kenschutte.com/midi/) Installation Failed\n');
|
idamnjanovic@1
|
398 cd(SMALL_path);
|
idamnjanovic@12
|
399 end
|
idamnjanovic@71
|
400
|
idamnjanovic@12
|
401 else
|
idamnjanovic@12
|
402 fprintf('\n ******************************************************************');
|
idamnjanovic@12
|
403 fprintf('\n\n matlab_midi (http://www.kenschutte.com/midi/) is already installed');
|
ivan@133
|
404 end
|
idamnjanovic@71
|
405
|
ivan@133
|
406
|
ivan@133
|
407
|
ivan@133
|
408 %% RWT setup
|
ivan@133
|
409 if ~(exist('mdwt')==3)
|
ivan@133
|
410 cd([SMALL_path, FS, 'util', FS, 'Rice Wavelet Toolbox'])
|
ivan@78
|
411 fprintf('Compiling the Rice Wavelet Toolbox MEX interfaces...');
|
ivan@78
|
412 try
|
ivan@78
|
413 if exist('mdwt' ,'file')~=3, mex mdwt.c; end
|
ivan@78
|
414 if exist('midwt' ,'file')~=3, mex midwt.c; end
|
ivan@78
|
415 if exist('mrdwt' ,'file')~=3, mex mrdwt.c; end
|
ivan@78
|
416 if exist('mirdwt','file')~=3, mex mirdwt.c; end
|
ivan@78
|
417 fprintf('Rice Wavelet Toolbox Installation Successful!\n\n');
|
ivan@78
|
418 catch
|
ivan@78
|
419 warning('Could not compile Rice Wavelet Toolbox MEX interfaces.\n');
|
ivan@78
|
420 end
|
ivan@133
|
421 cd(SMALL_path);
|
ivan@133
|
422 end
|
ivan@133
|
423 %%
|
idamnjanovic@1
|
424 fprintf('\n ******************************************************************');
|
idamnjanovic@1
|
425 fprintf('\n\n Initialising SMALLbox Examples Setup');
|
idamnjanovic@1
|
426
|
ivan@78
|
427 % % Need to do a bit of temporary housekeeping first.
|
ivan@78
|
428 % cd(SMALL_path);
|
ivan@78
|
429 % try
|
ivan@78
|
430 % cd(['Problems',FS,'private']);
|
ivan@78
|
431 % if exist('addtocols' ,'file')~=3,
|
ivan@78
|
432 % fprintf('\n Compiling MEX interfaces for SMALL examples \n');
|
ivan@78
|
433 % make;
|
ivan@78
|
434 % end
|
ivan@78
|
435 % fprintf('\n SMALLbox Problems Installation Successful! \n');
|
ivan@78
|
436 % catch
|
ivan@78
|
437 % fprintf('\n SMALLbox Problems Installation Failed \n');
|
ivan@78
|
438 % end
|
ivan@78
|
439 % cd(SMALL_path);
|
idamnjanovic@1
|
440
|
idamnjanovic@1
|
441
|
idamnjanovic@1
|
442
|
idamnjanovic@1
|
443 fprintf('\n ******************************************************************');
|
idamnjanovic@1
|
444 fprintf('\n\n SMALLbox Installation Complete!');
|
idamnjanovic@1
|
445
|
idamnjanovic@1
|
446
|
idamnjanovic@1
|
447 fprintf('\n\n For more information on the installed toolboxes see');
|
idamnjanovic@1
|
448 fprintf('\n\n Sparco: http://www.cs.ubc.ca/labs/scl/sparco/');
|
idamnjanovic@1
|
449 fprintf('\n\n SPGL1: http://www.cs.ubc.ca/labs/spgl1/?n=HomePage');
|
idamnjanovic@1
|
450 fprintf('\n\n SparseLab: http://sparselab.stanford.edu/ (PLEASE REGISTER SPARSELAB!)');
|
idamnjanovic@1
|
451 fprintf('\n\n Sparsify: http://www.see.ed.ac.uk/~tblumens/sparsify/sparsify.html');
|
idamnjanovic@1
|
452 fprintf('\n\n GPSR: http://www.lx.it.pt/~mtf/GPSR/');
|
ivan@133
|
453 fprintf('\n\n CVX: http://cvxr.com/cvx/');
|
idamnjanovic@1
|
454 fprintf('\n\n OMPbox and KSVDBox: http://www.cs.technion.ac.il/~ronrubin/\n');
|
idamnjanovic@1
|
455
|
idamnjanovic@1
|
456
|
idamnjanovic@1
|
457 % LIST DEMOS FROM EXAMPLE DIRECTORY...
|
idamnjanovic@1
|
458
|
idamnjanovic@1
|
459 demo_ack = input('\n\n Would you like to run a demo: ([y]/n)? ','s');
|
idamnjanovic@1
|
460
|
idamnjanovic@1
|
461 if demo_ack == 'n',
|
idamnjanovic@1
|
462 fprintf('\n Thank you for installing SMALLbox.');
|
idamnjanovic@1
|
463 fprintf('\n For information on the SMALLbox example scripts');
|
idamnjanovic@1
|
464 fprintf('\n Please see the examples directory. \n');
|
idamnjanovic@1
|
465 return;
|
idamnjanovic@1
|
466 else
|
idamnjanovic@1
|
467
|
idamnjanovic@12
|
468 demo_choice = input('\n 1 to run SMALL_solver_test \n 2 to run Dictionary Learning for Image Denoising demo \n q to quit: ','s');
|
idamnjanovic@1
|
469 switch(demo_choice)
|
idamnjanovic@1
|
470 case{'1'}
|
idamnjanovic@1
|
471 fprintf('\n Running SMALL_solver_test problem');
|
idamnjanovic@1
|
472 SMALL_solver_test;
|
idamnjanovic@1
|
473 case{'2'}
|
idamnjanovic@12
|
474 fprintf('\n Running SMALL Image Denoise problem');
|
idamnjanovic@12
|
475 SMALL_ImgDenoise_DL_test_KSVDvsSPAMS;
|
idamnjanovic@1
|
476 otherwise
|
idamnjanovic@1
|
477 return;
|
idamnjanovic@1
|
478 end
|
idamnjanovic@1
|
479
|
idamnjanovic@1
|
480 end
|
idamnjanovic@12
|
481
|
idamnjanovic@12
|
482
|
idamnjanovic@1
|
483
|