| 24 | virtual ~SqueezeNetTest() = default; |
| 25 | |
| 26 | std::string root() { |
| 27 | #ifdef __APPLE__ |
| 28 | auto bundle = CFBundleGetMainBundle(); |
| 29 | auto url = CFBundleCopyBundleURL(bundle); |
| 30 | auto string = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); |
| 31 | CFRelease(url); |
| 32 | auto cstring = CFStringGetCStringPtr(string, kCFStringEncodingUTF8); |
| 33 | auto css = std::string(cstring); |
| 34 | CFRelease(string); |
| 35 | return css; |
| 36 | #else |
| 37 | return "../resource"; // assume run in build dir |
| 38 | #endif |
| 39 | } |
| 40 | |
| 41 | std::string path() { |
| 42 | return this->root() + "/model/SqueezeNet"; |