Commit ef307906 authored by Ross Girshick's avatar Ross Girshick
Browse files

add copyright notices in files

parent 8abd6f35
...@@ -161,10 +161,10 @@ As an example, let's see how you would fine-tune a CNN for detection on PASCAL V ...@@ -161,10 +161,10 @@ As an example, let's see how you would fine-tune a CNN for detection on PASCAL V
0. Change directories to `external/caffe/examples/pascal-finetuning` 0. Change directories to `external/caffe/examples/pascal-finetuning`
0. Execute the fine-tuning code (make sure to replace `/path/to/rcnn` with the actual path to where R-CNN is installed): 0. Execute the fine-tuning code (make sure to replace `/path/to/rcnn` with the actual path to where R-CNN is installed):
<pre> <pre>
GLOG_logtostderr=1 ../../build/tools/finetune_net.bin \ GLOG_logtostderr=1 ../../build/tools/finetune_net.bin \
pascal_finetune_solver.prototxt \ pascal_finetune_solver.prototxt \
/path/to/rcnn/data/caffe_nets/ilsvrc_2012_train_iter_310k 2>&1 | tee log.txt /path/to/rcnn/data/caffe_nets/ilsvrc_2012_train_iter_310k 2>&1 | tee log.txt
</pre> </pre>
**Note:** In my experiments, I've let fine-tuning run for 70k iterations, although with hindsight it appears that improvement in mAP saturates at around 40k iterations. **Note:** In my experiments, I've let fine-tuning run for 70k iterations, although with hindsight it appears that improvement in mAP saturates at around 40k iterations.
...@@ -11,6 +11,16 @@ function pred_boxes = ... ...@@ -11,6 +11,16 @@ function pred_boxes = ...
% Outputs % Outputs
% pred_boxes Modified (hopefully better) ex_boxes % pred_boxes Modified (hopefully better) ex_boxes
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
if isempty(ex_boxes) if isempty(ex_boxes)
pred_boxes = []; pred_boxes = [];
return; return;
......
function res = rcnn_test_bbox_regressor(imdb, rcnn_model, bbox_reg, suffix) function res = rcnn_test_bbox_regressor(imdb, rcnn_model, bbox_reg, suffix)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
conf = rcnn_config('sub_dir', imdb.name); conf = rcnn_config('sub_dir', imdb.name);
image_ids = imdb.image_ids; image_ids = imdb.image_ids;
......
function bbox_reg = rcnn_train_bbox_regressor(imdb, rcnn_model, varargin) function bbox_reg = rcnn_train_bbox_regressor(imdb, rcnn_model, varargin)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
ip = inputParser; ip = inputParser;
ip.addRequired('imdb', @isstruct); ip.addRequired('imdb', @isstruct);
......
function vis_debug_bbox_pred(imdb, rcnn_model, bbox_reg, cls) function vis_debug_bbox_pred(imdb, rcnn_model, bbox_reg, cls)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
image_ids = imdb.image_ids; image_ids = imdb.image_ids;
min_overlap = 0.3; min_overlap = 0.3;
......
...@@ -2,6 +2,16 @@ function rcnn_make_window_file(imdb, out_dir) ...@@ -2,6 +2,16 @@ function rcnn_make_window_file(imdb, out_dir)
% Makes a window file that can be used by the caffe WindowDataLayer for % Makes a window file that can be used by the caffe WindowDataLayer for
% finetuning. % finetuning.
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
roidb = imdb.roidb_func(imdb); roidb = imdb.roidb_func(imdb);
% window_file format % window_file format
......
...@@ -11,4 +11,4 @@ max_iter: 100000 ...@@ -11,4 +11,4 @@ max_iter: 100000
momentum: 0.9 momentum: 0.9
weight_decay: 0.0005 weight_decay: 0.0005
snapshot: 10000 snapshot: 10000
snapshot_prefix: "./snapshots/v1/finetune_voc_2007_trainval" snapshot_prefix: "finetune_voc_2007_trainval"
function rcnn_cache_pool5_features(imdb, varargin) function rcnn_cache_pool5_features(imdb, varargin)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
ip = inputParser; ip = inputParser;
ip.addRequired('imdb', @isstruct); ip.addRequired('imdb', @isstruct);
ip.addOptional('start', 1, @isscalar); ip.addOptional('start', 1, @isscalar);
......
function rcnn_model = rcnn_create_model(cnn_definition_file, cnn_binary_file, cache_name) function rcnn_model = rcnn_create_model(cnn_definition_file, cnn_binary_file, cache_name)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
if ~exist('cache_name', 'var') || isempty(cache_name) if ~exist('cache_name', 'var') || isempty(cache_name)
cache_name = 'none'; cache_name = 'none';
......
function dets = rcnn_detect(im, rcnn_model) function dets = rcnn_detect(im, rcnn_model)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
% compute selective search candidates % compute selective search candidates
fprintf('Computing candidate regions...'); fprintf('Computing candidate regions...');
......
...@@ -5,6 +5,16 @@ function [batches, batch_padding] = rcnn_extract_regions(im, boxes, rcnn_model) ...@@ -5,6 +5,16 @@ function [batches, batch_padding] = rcnn_extract_regions(im, boxes, rcnn_model)
% (format: BGR channel order; single precision; mean subtracted; % (format: BGR channel order; single precision; mean subtracted;
% dimensions from fastest to slowest: width, height, channels, batch_index) % dimensions from fastest to slowest: width, height, channels, batch_index)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
% convert image to BGR and single % convert image to BGR and single
im = single(im(:,:,[3 2 1])); im = single(im(:,:,[3 2 1]));
num_boxes = size(boxes, 1); num_boxes = size(boxes, 1);
......
function [mean_norm, stdd] = rcnn_feature_stats(imdb, layer, rcnn_model) function [mean_norm, stdd] = rcnn_feature_stats(imdb, layer, rcnn_model)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
conf = rcnn_config('sub_dir', imdb.name); conf = rcnn_config('sub_dir', imdb.name);
save_file = sprintf('%s/feature_stats_%s_layer_%d_%s.mat', ... save_file = sprintf('%s/feature_stats_%s_layer_%d_%s.mat', ...
......
function feat = rcnn_features(im, boxes, rcnn_model) function feat = rcnn_features(im, boxes, rcnn_model)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
% make sure that caffe has been initialized for this model % make sure that caffe has been initialized for this model
if rcnn_model.cnn.init_key ~= caffe('get_init_key') if rcnn_model.cnn.init_key ~= caffe('get_init_key')
......
function window = rcnn_im_crop(im, bbox, crop_mode, crop_size, padding, image_mean) function window = rcnn_im_crop(im, bbox, crop_mode, crop_size, padding, image_mean)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
use_square = false; use_square = false;
if strcmp(crop_mode, 'square') if strcmp(crop_mode, 'square')
......
function d = rcnn_load_cached_pool5_features(cache_name, imdb_name, id) function d = rcnn_load_cached_pool5_features(cache_name, imdb_name, id)
% loads feat_cache/[cache_name]/[split]/[id].mat % loads feat_cache/[cache_name]/[split]/[id].mat
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
file = sprintf('./feat_cache/%s/%s/%s', cache_name, imdb_name, id); file = sprintf('./feat_cache/%s/%s/%s', cache_name, imdb_name, id);
if exist([file '.mat'], 'file') if exist([file '.mat'], 'file')
......
function rcnn_model = rcnn_load_model(rcnn_model_or_file, use_gpu) function rcnn_model = rcnn_load_model(rcnn_model_or_file, use_gpu)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
if isstr(rcnn_model_or_file) if isstr(rcnn_model_or_file)
assert(exist(rcnn_model_or_file, 'file') ~= 0); assert(exist(rcnn_model_or_file, 'file') ~= 0);
......
function feat = rcnn_pool5_to_fcX(feat, layer, rcnn_model) function feat = rcnn_pool5_to_fcX(feat, layer, rcnn_model)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
% no-op for layer <= 5 % no-op for layer <= 5
if layer > 5 if layer > 5
......
function res = rcnn_test(rcnn_model, imdb, suffix) function res = rcnn_test(rcnn_model, imdb, suffix)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
conf = rcnn_config('sub_dir', imdb.name); conf = rcnn_config('sub_dir', imdb.name);
image_ids = imdb.image_ids; image_ids = imdb.image_ids;
......
function result = op_selective_search_boxes(first_el, last_el, imdb) function result = op_selective_search_boxes(first_el, last_el, imdb)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
fast_mode = true; fast_mode = true;
mean_num = 0; mean_num = 0;
......
function [images, boxes] = selective_search_boxes_batch(imdb) function [images, boxes] = selective_search_boxes_batch(imdb)
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Ross Girshick
%
% This file is part of the R-CNN code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
fast_mode = true; fast_mode = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment