| 373 | } |
| 374 | |
| 375 | int main(int argc, char* argv[]) |
| 376 | { |
| 377 | // params |
| 378 | int repeat_count = DEFAULT_REPEAT_CNT; |
| 379 | |
| 380 | std::string model_format; |
| 381 | std::string proto_file; |
| 382 | std::string model_file; |
| 383 | std::string label_file; |
| 384 | std::string image_file; |
| 385 | int model_fnum = 0; |
| 386 | |
| 387 | int img_h = 224; |
| 388 | int img_w = 224; |
| 389 | float scale = 1.f; |
| 390 | float mean[3] = {104.007, 116.669, 122.679}; |
| 391 | |
| 392 | std::vector<int> hw; |
| 393 | std::vector<float> ms; |
| 394 | int res; |
| 395 | |
| 396 | if(argc == 1) |
| 397 | { |
| 398 | std::cout << "[Usage]: " << argv[0] << " [-h]\n" |
| 399 | << " [-f model_format] [-p proto_file] [-m model_file]\n" |
| 400 | << " [-l label_file] [-i image_file] [-g img_h,img_w]\n" |
| 401 | << " [-s scale] [-w mean[0],mean[1],mean[2]] [-r repeat_count]\n"; |
| 402 | return 0; |
| 403 | } |
| 404 | while((res = getopt(argc, argv, "f:p:m:l:i:g:s:w:r:h")) != -1) |
| 405 | { |
| 406 | switch(res) |
| 407 | { |
| 408 | case 'f': |
| 409 | model_format = optarg; |
| 410 | break; |
| 411 | case 'p': |
| 412 | proto_file = optarg; |
| 413 | break; |
| 414 | case 'm': |
| 415 | model_file = optarg; |
| 416 | break; |
| 417 | case 'l': |
| 418 | label_file = optarg; |
| 419 | break; |
| 420 | case 'i': |
| 421 | image_file = optarg; |
| 422 | break; |
| 423 | case 'g': |
| 424 | hw = ParseString<int>(optarg); |
| 425 | if(hw.size() != 2) |
| 426 | { |
| 427 | std::cerr << "Error -g parameter.\n"; |
| 428 | return -1; |
| 429 | } |
| 430 | img_h = hw[0]; |
| 431 | img_w = hw[1]; |
| 432 | break; |
nothing calls this directly
no test coverage detected