function [OBFeatures] = CompileOB(files, models, pyramidLevels)

num_models = length(models);
num_features_per_map = sum(4.^(0:pyramidLevels-1));
num_scales_per_model = 8;
OBFeatures = zeros(length(files), num_models*num_scales_per_model*num_features_per_map);

for i=1:num_models
    disp([num2str(i) ' of ' num2str(num_models)]);
    currentIdx = (i-1)*num_scales_per_model*num_features_per_map + 1;
    model_name = num2str(models{i});
    for j=1:length(files)
        input_file = [files{j} '_' model_name '.mat'];
        curr = load(input_file);
        for k=1:length(curr.response_maps)
            features = MaxGetSpatialPyramid(curr.response_maps{k}, pyramidLevels);
            OBFeatures(j, currentIdx+(k-1)*num_features_per_map:currentIdx+k*num_features_per_map-1) = features;
        end
    end
end