diff --git a/README.md b/README.md index 5f9dee6..36ad527 100644 --- a/README.md +++ b/README.md @@ -19,16 +19,16 @@ i. Initialize path variables using: > initialize; ii. To generate proposals, you can use either of the following commands: -> proposals = runObjectProposals('< proposalname >', 'path\to\image.jpg'); +> proposals = runObjectProposal('< proposalname >', 'path\to\image.jpg'); or -> im=imread('path\to\image.jpg'); proposals = runObjectProposals('< proposal name >', im); +> im=imread('path\to\image.jpg'); proposals = runObjectProposal('< proposal name >', im); iii. For long-running jobs, open config.json; Set *imageLocation*, and *outputLocation* to locations of your choice. Once *imageLocation*, and *outputLocation* are set, you can call ->runObjectProposals('< proposal name >'); +>runObjectProposal('< proposal name >'); This will generate proposals for all the images in the *imageLocation* and save the proposals in the *outputLocation*. diff --git a/evaluation-metrics/data/best_candid/MCG/best_candidates_file.mat b/evaluation-metrics/data/best_candid/MCG/best_candidates_file.mat new file mode 100644 index 0000000..d1385da Binary files /dev/null and b/evaluation-metrics/data/best_candid/MCG/best_candidates_file.mat differ diff --git a/evaluation-metrics/data/best_candid/Rantalankila/best_candidates_file.mat b/evaluation-metrics/data/best_candid/Rantalankila/best_candidates_file.mat new file mode 100644 index 0000000..ff71b9a Binary files /dev/null and b/evaluation-metrics/data/best_candid/Rantalankila/best_candidates_file.mat differ diff --git a/evaluation-metrics/data/best_candid/edgebox/best_candidates_file.mat b/evaluation-metrics/data/best_candid/edgebox/best_candidates_file.mat new file mode 100644 index 0000000..fa736e6 Binary files /dev/null and b/evaluation-metrics/data/best_candid/edgebox/best_candidates_file.mat differ diff --git a/evaluation-metrics/data/best_candid/endres/best_candidates_file.mat b/evaluation-metrics/data/best_candid/endres/best_candidates_file.mat new file mode 100644 index 0000000..2a00ce7 Binary files /dev/null and b/evaluation-metrics/data/best_candid/endres/best_candidates_file.mat differ diff --git a/evaluation-metrics/data/best_candid/objectness/best_candidates_file.mat b/evaluation-metrics/data/best_candid/objectness/best_candidates_file.mat new file mode 100644 index 0000000..938fe47 Binary files /dev/null and b/evaluation-metrics/data/best_candid/objectness/best_candidates_file.mat differ diff --git a/evaluation-metrics/data/best_candid/rahtubest/best_candidates_file.mat b/evaluation-metrics/data/best_candid/rahtubest/best_candidates_file.mat new file mode 100644 index 0000000..dabb11f Binary files /dev/null and b/evaluation-metrics/data/best_candid/rahtubest/best_candidates_file.mat differ diff --git a/evaluation-metrics/data/best_candid/randomized_prims/best_candidates_file.mat b/evaluation-metrics/data/best_candid/randomized_prims/best_candidates_file.mat new file mode 100644 index 0000000..a3a8225 Binary files /dev/null and b/evaluation-metrics/data/best_candid/randomized_prims/best_candidates_file.mat differ diff --git a/evaluation-metrics/data/best_candid/selective_search/best_candidates_file.mat b/evaluation-metrics/data/best_candid/selective_search/best_candidates_file.mat new file mode 100644 index 0000000..15ddbe3 Binary files /dev/null and b/evaluation-metrics/data/best_candid/selective_search/best_candidates_file.mat differ diff --git a/evaluation-metrics/demo_result/endres/2007_009084.jpg.mat b/evaluation-metrics/demo_result/endres/2007_009084.jpg.mat new file mode 100644 index 0000000..e71aad6 Binary files /dev/null and b/evaluation-metrics/demo_result/endres/2007_009084.jpg.mat differ diff --git a/evaluation-metrics/demo_result/endres/2010_000238.jpg.mat b/evaluation-metrics/demo_result/endres/2010_000238.jpg.mat new file mode 100644 index 0000000..005de67 Binary files /dev/null and b/evaluation-metrics/demo_result/endres/2010_000238.jpg.mat differ diff --git a/evaluation-metrics/demo_result/endres/2010_002868.jpg.mat b/evaluation-metrics/demo_result/endres/2010_002868.jpg.mat new file mode 100644 index 0000000..78ce7f4 Binary files /dev/null and b/evaluation-metrics/demo_result/endres/2010_002868.jpg.mat differ diff --git a/evaluation-metrics/demo_result/endres/2010_003781.jpg.mat b/evaluation-metrics/demo_result/endres/2010_003781.jpg.mat new file mode 100644 index 0000000..4ead263 Binary files /dev/null and b/evaluation-metrics/demo_result/endres/2010_003781.jpg.mat differ diff --git a/evaluation-metrics/get_config.m b/evaluation-metrics/get_config.m new file mode 100644 index 0000000..a043da7 --- /dev/null +++ b/evaluation-metrics/get_config.m @@ -0,0 +1,10 @@ +function [config] = get_config() + + + % this is where best candidates and all other computed data are stored + config.precomputed_candidates = 'C:\Users\Prateek\Desktop\best_candid'; + + if config.precomputed_candidates(end) ~= '\' + config.precomputed_candidates = [config.precomputed_candidates '\']; + end +end diff --git a/evaluation-metrics/getmethod.m b/evaluation-metrics/getmethod.m new file mode 100644 index 0000000..cdeceb7 --- /dev/null +++ b/evaluation-metrics/getmethod.m @@ -0,0 +1,192 @@ +function methods = getmethod() + + +colormap = [ ... +255, 255, 50 ; ... +100, 163, 163 ; ... +218, 71, 71 ; ... +200, 36, 36 ; ... +145, 92, 146 ; ... +183, 36, 73 ; ... +135, 200, 170 ; ... +150, 150, 27 ; ... +140, 190, 200 ; ... +138, 180, 66 ; ... +255, 150, 255 ; ... +92, 172, 158 ; ... +195,189,40; +0, 255, 255; +88, 128, 189; +255, 255, 0; +] ./ 256; + + config = get_config(); + precomputed_prefix = config.precomputed_candidates; + + methods = []; + + i = numel(methods) + 1; + methods(i).name = 'Objectness'; + methods(i).short_name = 'O'; + prefix = [precomputed_prefix 'objectness\']; +% methods(i).candidate_dir = [prefix 'mat_nms_10k']; +% methods(i).repeatability_candidate_dir = [prefix 'repeatability_mat']; + methods(i).best_voc07_candidates_file = [prefix 'best_candidates_file.mat']; + methods(i).best_imagenet_candidates_file = [prefix 'best_candidates_imagenet.mat']; +% methods(i).repeatability_matching_file = [prefix 'repeatability_matching.mat']; + methods(i).order = 'descend'; +% methods(i).extract = @run_objectness; + methods(i).num_candidates = true; + methods(i).color = colormap(i,:); + methods(i).is_baseline = false; + + i = numel(methods) + 1; + methods(i).name = 'Rahtu'; + methods(i).short_name = 'Rah'; + prefix = [precomputed_prefix 'rahtubest\']; + methods(i).candidate_dir = [prefix 'mat']; +% methods(i).repeatability_candidate_dir = [prefix 'repeatability_mat']; + methods(i).best_voc07_candidates_file = [prefix 'best_candidates_file.mat']; + methods(i).best_imagenet_candidates_file = [prefix 'best_candidates_imagenet.mat']; +% methods(i).repeatability_matching_file = [prefix 'repeatability_matching.mat']; + methods(i).order = 'none'; +% methods(i).extract = @run_rahtubest; + methods(i).num_candidates = true; + methods(i).color = colormap(i,:); + methods(i).is_baseline = false; + + i = numel(methods) + 1; + methods(i).name = 'Sel.Search'; + methods(i).short_name = 'S.S'; + prefix = [precomputed_prefix 'selective_search\']; +% methods(i).candidate_dir = [prefix 'mat']; +% methods(i).repeatability_candidate_dir = [prefix 'repeatability_mat']; + methods(i).best_voc07_candidates_file = [prefix 'best_candidates_file.mat']; + methods(i).best_imagenet_candidates_file = [prefix 'best_candidates_imagenet.mat']; +% methods(i).repeatability_matching_file = [prefix 'repeatability_matching.mat']; + methods(i).order = 'ascend'; +% methods(i).extract = @run_selective_search; + methods(i).num_candidates = true; + methods(i).color = colormap(i,:); + methods(i).is_baseline = false; + + i = numel(methods) + 1; + methods(i).name = 'Rand.Prim'; + methods(i).short_name = 'R.P'; + prefix = [precomputed_prefix 'randomized_prims\']; + methods(i).candidate_dir = [prefix 'mat']; + methods(i).gt_recall_num_candidates = 20000; +% methods(i).repeatability_candidate_dir = [prefix 'repeatability_mat']; + methods(i).best_voc07_candidates_file = [prefix 'best_candidates_file.mat']; + methods(i).best_imagenet_candidates_file = [prefix 'best_candidates_imagenet.mat']; +% methods(i).repeatability_matching_file = [prefix 'repeatability_matching.mat']; +% methods(i).rerun_num_candidates = 10 .^ (0:0.25:5); + methods(i).rerun_num_candidates = []; +% methods(i).repeatability_num_candidates = 5000; +% methods(i).gt_recall_num_cand_idxs = [1 4 6 8 10 12 14 17 19]; + methods(i).order = 'none'; +% methods(i).extract = @run_randomized_prims; + methods(i).num_candidates = true; + methods(i).color = colormap(i,:); + methods(i).is_baseline = false; + + + i = numel(methods) + 1; + methods(i).name = 'Endres'; + methods(i).short_name = 'En'; + prefix = [precomputed_prefix 'endres\']; + methods(i).candidate_dir = [prefix 'mat']; +% methods(i).repeatability_candidate_dir = [prefix 'repeatability_mat']; + methods(i).best_voc07_candidates_file = [prefix 'best_candidates_file.mat']; + methods(i).best_imagenet_candidates_file = [prefix 'best_candidates_imagenet.mat']; +% methods(i).repeatability_matching_file = [prefix 'repeatability_matching.mat']; + methods(i).order = 'none'; +% methods(i).extract = @run_prop; + methods(i).num_candidates = false; + methods(i).color = colormap(i,:); + methods(i).is_baseline = false; + + i = numel(methods) + 1; + methods(i).name = 'Rantalankila'; + methods(i).short_name = 'R.K'; + prefix = [precomputed_prefix 'Rantalankila\']; + methods(i).candidate_dir = [prefix 'mat']; +% methods(i).repeatability_candidate_dir = [prefix 'repeatability_mat']; + methods(i).best_voc07_candidates_file = [prefix 'best_candidates_file.mat']; + methods(i).best_imagenet_candidates_file = [prefix 'best_candidates_imagenet.mat']; +% methods(i).repeatability_matching_file = [prefix 'repeatability_matching.mat']; + methods(i).order = 'none'; +% methods(i).extract = @run_rantalankila; + methods(i).num_candidates = true; + methods(i).rerun_num_candidates = [10 100 1000 10000]; + methods(i).color = colormap(i,:); + methods(i).is_baseline = false; + +% + i = numel(methods) + 1; + methods(i).name = 'EdgeBoxes'; + methods(i).short_name = 'EB'; + prefix = [precomputed_prefix 'edgebox\']; + methods(i).candidate_dir = [prefix 'mat']; +% methods(i).repeatability_candidate_dir = [prefix 'repeatability_mat']; + methods(i).best_voc07_candidates_file = [prefix 'best_candidates_file.mat']; + methods(i).best_imagenet_candidates_file = [prefix 'best_candidates_imagenet.mat']; +% methods(i).repeatability_matching_file = [prefix 'repeatability_matching.mat']; + methods(i).order = 'descend'; +% methods(i).extract = @run_edgeboxes; + methods(i).num_candidates = true; + methods(i).color = colormap(i,:); + methods(i).is_baseline = false; +% +% + i = numel(methods) + 1; + methods(i).name = 'MCG'; + methods(i).short_name = 'M'; + prefix = [precomputed_prefix 'MCG\']; + methods(i).candidate_dir = [prefix 'mat']; +% methods(i).repeatability_candidate_dir = [prefix 'repeatability_mat']; + methods(i).best_voc07_candidates_file = [prefix 'best_candidates_file.mat']; + methods(i).best_imagenet_candidates_file = [prefix 'best_candidates_imagenet.mat']; +% methods(i).repeatability_matching_file = [prefix 'repeatability_matching.mat']; + methods(i).order = 'none'; +% methods(i).extract = @run_MCG; + methods(i).num_candidates = true; + methods(i).color = colormap(i,:); + methods(i).is_baseline = false; +% + % add your own method here: + if false + i = numel(methods) + 1; + methods(i).name = 'The full name of your method'; + methods(i).short_name = 'a very short version of the name'; + prefix = [precomputed_prefix 'my-method/']; + methods(i).candidate_dir = [prefix 'mat']; +% methods(i).repeatability_candidate_dir = [prefix 'repeatability_mat']; + methods(i).best_voc07_candidates_file = [prefix 'best_candidates_file.mat']; +% methods(i).best_imagenet_candidates_file = [prefix 'best_candidates_imagenet.mat']; +% methods(i).repeatability_matching_file = [prefix 'repeatability_matching.mat']; + + % A function pointer to a method that runs your proposal detector. +% methods(i).extract = @run_edgeboxes; + +% methods(i).rerun_num_candidates = []; % ceil(10 .^ (2:0.5:4)); + % Specifies whether or not your method takes the desired number of candidates + % as an input. + + methods(i).num_candidates = true; + % colormap for drawing + methods(i).color = colormap(i,:); + % This should be false. Is used for drawing baselines dashed. + methods(i).is_baseline = false; + end + + % do the sorting dance + sort_keys = [num2cell([methods.is_baseline])', {methods.name}']; + for i = 1:numel(methods) + sort_keys{i,1} = sprintf('%d', sort_keys{i,1}); + end + [~,idx] = sortrows(sort_keys); + for i = 1:numel(methods) + methods(idx(i)).sort_key = i; + end +end diff --git a/evaluation-metrics/maxRow.m b/evaluation-metrics/maxRow.m index 5e95d53..d0d22ce 100644 --- a/evaluation-metrics/maxRow.m +++ b/evaluation-metrics/maxRow.m @@ -1,4 +1,4 @@ -function [matching, objective] = greedy_matching_rowwise(iou_matrix) +function [matching, objective] = maxRow(iou_matrix) assert(size(iou_matrix, 1) <= size(iou_matrix, 2)); n = size(iou_matrix, 1); matching = zeros(n, 1); diff --git a/evaluation-metrics/methods.mat b/evaluation-metrics/methods.mat index c4ef2aa..659a2b9 100644 Binary files a/evaluation-metrics/methods.mat and b/evaluation-metrics/methods.mat differ diff --git a/evaluation-metrics/newmethods.mat b/evaluation-metrics/newmethods.mat new file mode 100644 index 0000000..8e2c38a Binary files /dev/null and b/evaluation-metrics/newmethods.mat differ diff --git a/evaluation-metrics/plotMetric.m b/evaluation-metrics/plotMetric.m index 67e53fa..4d77cf5 100644 --- a/evaluation-metrics/plotMetric.m +++ b/evaluation-metrics/plotMetric.m @@ -8,7 +8,9 @@ function plotMetric(configjson) % figures/. parDir = configjson.params.parDir; testset = load(fullfile(parDir, 'evaluation-metrics', 'data/pascal_gt_data.mat')); - methods = getMethods(configjson); + methods = getMethods(configjson);% This function is not available in the repository + % Use methods = getmethods() instead , make changes accoriding to your + % need compute_best_recall_candidates(testset, methods);