Skip to content

Commit 60542b4

Browse files
committed
added link to h5 file
1 parent 4c213d4 commit 60542b4

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,5 @@ $RECYCLE.BIN/
109109

110110
# End of https://www.gitignore.io/api/git,macos,linux,matlab,windows
111111
demo_script_old.m
112+
113+
cnn_model.h5

utilities/cnn_classifier.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
% INPUTS:
1313
% A: 2d matrix
1414
% dims: vector with dimensions of the FOV
15-
% classifier: path to pretrained classifier model
15+
% classifier: path to pretrained classifier model (downloaded if it
16+
% doesn't exist)
1617
% thr: threshold for accepting component (default: 0.2)
1718
%
1819
% note: The function requires Matlab version 2017b (9.3) or later, Neural
@@ -24,7 +25,7 @@
2425

2526
if verLessThan('matlab','9.3') || verLessThan('nnet','11.0') || isempty(which('importKerasNetwork'))
2627
error(strcat('The function requires Matlab version 2017b (9.3) or later, Neural\n', ...
27-
'Networks toolbox version 2017b (11.0) or lvalater, the Neural Networks ', ...
28+
'Networks toolbox version 2017b (11.0) or later, the Neural Networks ', ...
2829
'Toolbox(TM) Importer for TensorFlow-Keras Models.'))
2930
end
3031

@@ -34,6 +35,12 @@
3435
A = A/spdiags(sqrt(sum(A.^2,1))'+eps,0,K,K); % normalize to sum 1 for each compoennt
3536
A_com = extract_patch(A,dims,[50,50]); % extract 50 x 50 patches
3637

38+
if ~exist(classifier,'file')
39+
url = 'https://www.dropbox.com/s/1csymylbne7yyt0/cnn_model.h5?dl=1';
40+
classifier = 'cnn_model.h5';
41+
outfilename = websave(classifier,url);
42+
end
43+
3744
net_classifier = importKerasNetwork(classifier);
3845
out = predict(net_classifier,double(A_com));
3946
value = out(:,2);

0 commit comments

Comments
 (0)