Changeset 67
- Timestamp:
- 07/09/13 11:06:30 (11 years ago)
- Location:
- birds
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
birds/createmilbirds_19cl.m
r65 r67 11 11 12 12 % load the 'meta' data like labels and filenames 13 dpath = ' /data/birds_mlsp2013/mlsp_contest_dataset2/essential_data/';13 dpath = '../birds_mlsp2013/mlsp_contest_dataset/essential_data/'; 14 14 [bagid,names] = textread(fullfile(dpath,'rec_id2filename.txt'),'%n%s','headerlines',1); 15 15 [bagid2,labstr] = textread(fullfile(dpath,'rec_labels_test_hidden.txt'),'%n%s','headerlines',1); 16 [bagid3,Itst] = textread(fullfile(dpath,'CVfolds_2.txt'),'%n%d','headerlines',1); 16 17 18 %[bagid3,Itst] = 19 %textread(fullfile(dpath,'CVfolds_2.txt'),'%n%d','headerlines',1); 20 21 %VC: Ik krijg hier foutmeldingen. textread gaat weg, dus ze raden aan om 22 %textscan te gebruiken. 23 %>Error using dataread 24 %>Trouble reading integer from file (row 1, field 2) ==> ,1\n 25 %>Error in textread (line 175) 26 %>[varargout{1:nlhs}]=dataread('file',varargin{:}); %#ok<REMFF1> 27 28 29 N = length(bagid2); 30 CVfile = fopen(fullfile(dpath,'CVfolds_2.txt')); 31 CVdata = textscan(CVfile, '%f,%f', N, 'headerlines',1); 32 fclose(CVfile); 33 34 bagid3 = CVdata{1}; 35 Itst = CVdata{2}; 17 36 18 37 … … 30 49 for i=1:B 31 50 %load the signal; 32 [signal,fs] = wavread(fullfile(dpath,' wavs',names{i}(2:end)));51 [signal,fs] = wavread(fullfile(dpath,'src_wavs',names{i}(2:end))); 33 52 [S,f,t] = spectrogram(signal,windowlen,windowlen/2,fmax,fs); 34 53 % smooth and threshold the spectrogram: … … 49 68 thisx(j,:) = [props(j).Area, props(j).Centroid, props(j).BoundingBox]; 50 69 % don't forget: 51 bagid(end+1) = i; 70 %bagid(end+1) = i; 71 72 bagid = [bagid i]; 73 52 74 end 53 75 x{i} = thisx; 54 76 55 % get the labels right for the training bags: 77 %Get the labels right for the training bags: 78 56 79 if ~Itst(i) 57 eval(['baglab(i,[',labstr{i}(2:end),'])=1;']); 80 %eval(['baglab(i,[',labstr{i}(2:end),'])=1;']); 81 %VC: in the text file, label numbers are 0 to 18, we want 1 to 19? 82 eval(['baglab(i,[',labstr{i}(2:end),']+1)=1;']); 58 83 end 59 84 end
Note: See TracChangeset
for help on using the changeset viewer.