openbr.h
7.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright 2012 The MITRE Corporation *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef OPENBR_H
#define OPENBR_H
#include <openbr/openbr_export.h>
#ifdef __cplusplus
extern "C" {
#endif
BR_EXPORT const char *br_about();
BR_EXPORT void br_cat(int num_input_galleries, const char *input_galleries[], const char *output_gallery);
BR_EXPORT void br_deduplicate(const char *input_gallery, const char *output_gallery, const char *threshold);
BR_EXPORT void br_cluster(int num_simmats, const char *simmats[], float aggressiveness, const char *csv);
BR_EXPORT void br_combine_masks(int num_input_masks, const char *input_masks[], const char *output_mask, const char *method);
BR_EXPORT void br_compare(const char *target_gallery, const char *query_gallery, const char *output = "");
BR_EXPORT void br_compare_n(int num_targets, const char *target_galleries[], const char *query_gallery, const char *output);
BR_EXPORT void br_pairwise_compare(const char *target_gallery, const char *query_gallery, const char *output = "");
BR_EXPORT void br_convert(const char *file_type, const char *input_file, const char *output_file);
BR_EXPORT void br_enroll(const char *input, const char *gallery = "");
BR_EXPORT void br_enroll_n(int num_inputs, const char *inputs[], const char *gallery = "");
BR_EXPORT void br_project(const char *input, const char *output);
BR_EXPORT float br_eval(const char *simmat, const char *mask, const char *csv = "", int matches = 0);
BR_EXPORT void br_assert_eval(const char *simmat, const char *mask, const float accuracy);
BR_EXPORT float br_inplace_eval(const char * simmat, const char *target, const char *query, const char *csv = "");
BR_EXPORT void br_eval_classification(const char *predicted_gallery, const char *truth_gallery, const char *predicted_property = "", const char *truth_property = "");
BR_EXPORT void br_eval_clustering(const char *clusters, const char *truth_gallery, const char *truth_property = "", bool cluster_csv = true, const char *cluster_property = "");
BR_EXPORT float br_eval_detection(const char *predicted_gallery, const char *truth_gallery, const char *csv = "", bool normalize = false, int minSize = 0, int maxSize = 0);
BR_EXPORT float br_eval_landmarking(const char *predicted_gallery, const char *truth_gallery, const char *csv = "", int normalization_index_a = 0, int normalization_index_b = 1, int sample_index = 0, int total_examples = 5);
BR_EXPORT void br_eval_regression(const char *predicted_gallery, const char *truth_gallery, const char *predicted_property = "", const char *truth_property = "");
BR_EXPORT void br_eval_knn(const char *knnGraph, const char *knnTruth, const char *iet = "");
BR_EXPORT void br_finalize();
BR_EXPORT void br_fuse(int num_input_simmats, const char *input_simmats[],
const char *normalization, const char *fusion, const char *output_simmat);
BR_EXPORT void br_initialize(int &argc, char *argv[], const char *sdk_path = "", bool use_gui = false);
BR_EXPORT void br_initialize_default();
BR_EXPORT bool br_is_classifier(const char *algorithm);
BR_EXPORT void br_make_mask(const char *target_input, const char *query_input, const char *mask);
BR_EXPORT void br_make_pairwise_mask(const char *target_input, const char *query_input, const char *mask);
BR_EXPORT int br_most_recent_message(char * buffer, int buffer_length);
BR_EXPORT int br_objects(char * buffer, int buffer_length, const char *abstractions = ".*", const char *implementations = ".*", bool parameters = true);
BR_EXPORT bool br_plot(int num_files, const char *files[], const char *destination, bool show = false);
BR_EXPORT bool br_plot_detection(int num_files, const char *files[], const char *destination, bool show = false);
BR_EXPORT bool br_plot_landmarking(int num_files, const char *files[], const char *destination, bool show = false);
BR_EXPORT bool br_plot_metadata(int num_files, const char *files[], const char *columns, bool show = false);
BR_EXPORT float br_progress();
BR_EXPORT void br_read_pipe(const char *pipe, int *argc, char ***argv);
BR_EXPORT int br_scratch_path(char * buffer, int buffer_length);
BR_EXPORT const char *br_sdk_path();
BR_EXPORT void br_get_header(const char *matrix, const char **target_gallery, const char **query_gallery);
BR_EXPORT void br_set_header(const char *matrix, const char *target_gallery, const char *query_gallery);
BR_EXPORT void br_set_property(const char *key, const char *value);
BR_EXPORT int br_time_remaining();
BR_EXPORT void br_train(const char *input, const char *model = "");
BR_EXPORT void br_train_n(int num_inputs, const char *inputs[], const char *model = "");
BR_EXPORT const char *br_version();
BR_EXPORT void br_slave_process(const char * baseKey);
BR_EXPORT void br_likely(const char *input_type, const char *output_type, const char *output_source_file);
// to avoid having to include unwanted headers
// this will be this header's conception of a Template
// any functions that need a Template pointer
// will take this typedef and cast it
typedef void* br_template;
typedef void* br_template_list;
typedef void* br_gallery;
typedef void* br_matrix_output;
BR_EXPORT br_template br_load_img(const char *data, int len);
BR_EXPORT unsigned char* br_unload_img(br_template tmpl);
BR_EXPORT br_template_list br_template_list_from_buffer(const char *buf, int len);
BR_EXPORT void br_free_template(br_template tmpl);
BR_EXPORT void br_free_template_list(br_template_list tl);
BR_EXPORT void br_free_output(br_matrix_output output);
BR_EXPORT int br_img_rows(br_template tmpl);
BR_EXPORT int br_img_cols(br_template tmpl);
BR_EXPORT int br_img_channels(br_template tmpl);
BR_EXPORT bool br_img_is_empty(br_template tmpl);
BR_EXPORT int br_get_filename(char * buffer, int buffer_length, br_template tmpl);
BR_EXPORT void br_set_filename(br_template tmpl, const char *filename);
BR_EXPORT int br_get_metadata_string(char * buffer, int buffer_length, br_template tmpl, const char *key);
BR_EXPORT br_template_list br_enroll_template(br_template tmpl);
BR_EXPORT void br_enroll_template_list(br_template_list tl);
BR_EXPORT br_matrix_output br_compare_template_lists(br_template_list target, br_template_list query);
BR_EXPORT float br_get_matrix_output_at(br_matrix_output output, int row, int col);
BR_EXPORT br_template br_get_template(br_template_list tl, int index);
BR_EXPORT int br_num_templates(br_template_list tl);
BR_EXPORT br_gallery br_make_gallery(const char *gallery);
BR_EXPORT br_template_list br_load_from_gallery(br_gallery gallery);
BR_EXPORT void br_add_template_to_gallery(br_gallery gallery, br_template tmpl);
BR_EXPORT void br_add_template_list_to_gallery(br_gallery gallery, br_template_list tl);
BR_EXPORT void br_close_gallery(br_gallery gallery);
#ifdef __cplusplus
}
#endif
#endif // OPENBR_H