MCPcopy Create free account
hub / github.com/OAID/Tengine / main

Function main

examples/faster_rcnn/faster_rcnn.cpp:169–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169int main(int argc, char* argv[])
170{
171 int ret = -1;
172 const std::string root_path = get_root_path();
173 std::string proto_file;
174 std::string model_file;
175 std::string image_file;
176 std::string save_name = "save.jpg";
177
178 int res;
179 while((res = getopt(argc, argv, "p:m:i:")) != -1)
180 {
181 switch(res)
182 {
183 case 'p':
184 proto_file = optarg;
185 break;
186 case 'm':
187 model_file = optarg;
188 break;
189 case 'i':
190 image_file = optarg;
191 break;
192 default:
193 break;
194 }
195 }
196
197 // init tengine
198 if(init_tengine() < 0)
199 {
200 std::cout << " init tengine failed\n";
201 return 1;
202 }
203 if(request_tengine_version("0.9") != 1)
204 {
205 std::cout << " request tengine version failed\n";
206 return 1;
207 }
208
209 // load model
210 if(proto_file.empty())
211 {
212 proto_file = root_path + DEF_PROTO;
213 std::cout << "proto file not specified,using " << proto_file << " by default\n";
214 }
215 if(model_file.empty())
216 {
217 model_file = root_path + DEF_MODEL;
218 std::cout << "model file not specified,using " << model_file << " by default\n";
219 }
220 if(image_file.empty())
221 {
222 image_file = root_path + DEF_IMAGE;
223 std::cout << "image file not specified,using " << image_file << " by default\n";
224 }
225 // check file
226 if(!check_file_exist(proto_file) or (!check_file_exist(model_file) or !check_file_exist(image_file)))

Callers

nothing calls this directly

Calls 15

get_root_pathFunction · 0.85
init_tengineFunction · 0.85
request_tengine_versionFunction · 0.85
create_graphFunction · 0.85
get_tengine_errnoFunction · 0.85
set_graph_attrFunction · 0.85
imreadFunction · 0.85
maxFunction · 0.85
minFunction · 0.85
get_graph_tensorFunction · 0.85
set_tensor_shapeFunction · 0.85
set_tensor_bufferFunction · 0.85

Tested by

no test coverage detected