Changeset 67


Ignore:
Timestamp:
07/09/13 11:06:30 (11 years ago)
Author:
vcheplygina
Message:
 
Location:
birds
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • birds/createmilbirds_19cl.m

    r65 r67  
    1111
    1212% load the 'meta' data like labels and filenames
    13 dpath = '/data/birds_mlsp2013/mlsp_contest_dataset2/essential_data/';
     13dpath = '../birds_mlsp2013/mlsp_contest_dataset/essential_data/';
    1414[bagid,names] = textread(fullfile(dpath,'rec_id2filename.txt'),'%n%s','headerlines',1);
    1515[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
     29N = length(bagid2);
     30CVfile = fopen(fullfile(dpath,'CVfolds_2.txt'));
     31CVdata = textscan(CVfile, '%f,%f', N, 'headerlines',1);
     32fclose(CVfile);
     33
     34bagid3 = CVdata{1};
     35Itst = CVdata{2};
    1736
    1837
     
    3049for i=1:B
    3150        %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)));
    3352        [S,f,t] = spectrogram(signal,windowlen,windowlen/2,fmax,fs);
    3453        % smooth and threshold the spectrogram:
     
    4968                thisx(j,:) = [props(j).Area, props(j).Centroid, props(j).BoundingBox];
    5069                % don't forget:
    51                 bagid(end+1) = i;
     70                %bagid(end+1) = i;
     71       
     72        bagid = [bagid i];
     73       
    5274        end
    5375        x{i} = thisx;
    5476
    55         % get the labels right for the training bags:
     77        %Get the labels right for the training bags:
     78   
    5679   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;']);
    5883   end
    5984end
Note: See TracChangeset for help on using the changeset viewer.