aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzongwave <wei.zong@intel.com>2019-03-28 10:32:17 +0800
committerZong Wei <wei.zong@intel.com>2019-03-28 18:10:52 +0800
commitd59a869bb8cc47c008525c87197f75074b64ba27 (patch)
tree659562a2e255931e537aae15df26d4067eeaf2fb
parenteab35b74c71e933ab6390fa63e5fe26d6d96c705 (diff)
downloadlibxcam-d59a869bb8cc47c008525c87197f75074b64ba27.tar.gz
dnn: enable cldnn path
* command line: ./test-dnn-inference --input street-pedestrian-001.jpg \ --model-file pedestrian-and-vehicle-detector-adas-0001.xml \ --target-dev gpu
-rw-r--r--tests/test-dnn-inference.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/tests/test-dnn-inference.cpp b/tests/test-dnn-inference.cpp
index e3b7baf..68d0c63 100644
--- a/tests/test-dnn-inference.cpp
+++ b/tests/test-dnn-inference.cpp
@@ -232,23 +232,19 @@ static void usage (const char* arg0)
"\t--model-file model file name\n"
"\t--input input image \n"
"\t--save save output image \n"
- "\t--loop optional, how many loops need to run, default: 1\n"
"\t--help usage\n",
arg0);
}
int main (int argc, char *argv[])
{
- int loop = 1;
-
const struct option long_opts[] = {
{"plugin", required_argument, NULL, 'p'},
- {"target-dev", required_argument, NULL, 't'},
+ {"target-dev", required_argument, NULL, 'd'},
{"ext-path", required_argument, NULL, 'x'},
{"model-file", required_argument, NULL, 'm'},
{"input", required_argument, NULL, 'i'},
{"save", required_argument, NULL, 's'},
- {"loop", required_argument, NULL, 'l'},
{"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, 0},
};
@@ -270,9 +266,22 @@ int main (int argc, char *argv[])
XCAM_ASSERT (optarg);
infer_config.plugin_path = optarg;
break;
- case 't':
+ case 'd':
XCAM_ASSERT (optarg);
infer_config.target_id = (DnnInferTargetDeviceType)(atoi (optarg));
+ if (!strcasecmp (optarg, "CPU")) {
+ infer_config.target_id = DnnInferDeviceCPU;
+ } else if (!strcasecmp (optarg, "GPU")) {
+ infer_config.target_id = DnnInferDeviceGPU;
+ } else if (!strcasecmp (optarg, "FPGA")) {
+ infer_config.target_id = DnnInferDeviceFPGA;
+ } else if (!strcasecmp (optarg, "Myriad")) {
+ infer_config.target_id = DnnInferDeviceMyriad;
+ } else {
+ XCAM_LOG_ERROR ("target device unknown type: %s", optarg);
+ usage (argv[0]);
+ return -1;
+ }
break;
case 'x':
XCAM_ASSERT (optarg);
@@ -290,11 +299,6 @@ int main (int argc, char *argv[])
XCAM_ASSERT (optarg);
save_output = (strcasecmp (optarg, "false") == 0 ? false : true);
break;
-
- case 'l':
- XCAM_ASSERT (optarg);
- loop = atoi (optarg);
- break;
case 'h':
usage (argv[0]);
return 0;
@@ -325,7 +329,6 @@ int main (int argc, char *argv[])
printf ("extention path:\t\t%s\n", (ext_path != NULL) ? ext_path : "NULL");
printf ("input image:\t\t%s\n", (input_image != NULL) ? input_image : "NULL");
printf ("model file name:\t\t%s\n", (infer_config.model_filename != NULL) ? infer_config.model_filename : "NULL");
- printf ("loop count:\t\t%d\n", loop);
// --------------------------- 1. Set input image file names -----------------------------------------------------------
XCAM_LOG_DEBUG ("1. Set input image file names");