-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnTopImages.m
33 lines (23 loc) · 1 KB
/
nTopImages.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
function nTopImages()
imMxBatch=dir(actPath);
topnum=100;
for t=1:topnum
for lay=1:length(convLayers)
for b=3:length(imgMxBatch) %% in each batch find a maximum image
load([actPath imMxBatch(i).name],'imgMxAct_batch','imgMxLoc_batch','batch_img_names');
mxActImg=imgMxAct_batch{1,lay};
mxLocImg=imgMxLoc_batch{1,lay};
mxActImg=batch_img_names{1,lay};
%---get rid of all taken images---
if ismember(b,nxtMxImgInAllBatch.batchnum)
indexes=1:size(mxActImg,2);
mxActImg(mxImgInBatch_i,indexes)=-inf;
%--compare the new max with the previous max
[mxImgInBatch_v,mxImgInBatch_i]=max(mxActImg);
if mxImgInThisBatch>mxImgInAllBatch
nxtMxImgInAllBatch.value(t)=mxImgInThisBatch;
nxtMxImgInAllBatch.imgname=batch_img_names()
end
end
end
end