MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / main

Function main

tensorflow/lite/testing/nnapi_example.cc:58–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58int main(int argc, char* argv[]) {
59 bool use_nnapi = true;
60 if (argc == 4) {
61 use_nnapi = strcmp(argv[3], "1") == 0 ? true : false;
62 }
63 if (argc < 3) {
64 fprintf(stderr,
65 "Compiled " __DATE__ __TIME__
66 "\n"
67 "Usage!!!: %s <tflite model> <examples to test> "
68 "{ use nn api i.e. 0,1}\n",
69 argv[0]);
70 return 1;
71 }
72
73 std::string base_dir = dirname(argv[1]);
74 DIR* dir = opendir(base_dir.c_str());
75 if (dir == nullptr) {
76 fprintf(stderr, "Can't open dir %s\n", base_dir.c_str());
77 return 1;
78 }
79 while (struct dirent* ent = readdir(dir)) {
80 std::string name = ent->d_name;
81 if (name.rfind(".txt") == name.length() - 4) {
82 printf("%s: ", name.c_str());
83 if (Interpret((base_dir + "/" + name).c_str(), use_nnapi)) {
84 printf(" %s\n", "OK");
85 } else {
86 printf(" %s\n", "FAIL");
87 }
88 }
89 }
90 closedir(dir);
91
92 return 0;
93}

Callers

nothing calls this directly

Calls 4

dirnameFunction · 0.85
InterpretFunction · 0.85
c_strMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected