MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / CheckFile

Function CheckFile

rtpose_wrapper/python/caffe/_caffe.cpp:60–67  ·  view source on GitHub ↗

For convenience, check that input files can be opened, and raise an exception that boost will send to Python if not (caffe could still crash later if the input files are disturbed before they are actually used, but this saves frustration in most cases).

Source from the content-addressed store, hash-verified

58// later if the input files are disturbed before they are actually used, but
59// this saves frustration in most cases).
60static void CheckFile(const string& filename) {
61 std::ifstream f(filename.c_str());
62 if (!f.good()) {
63 f.close();
64 throw std::runtime_error("Could not open file " + filename);
65 }
66 f.close();
67}
68
69void CheckContiguousArray(PyArrayObject* arr, string name,
70 int channels, int height, int width) {

Callers 2

Net_InitFunction · 0.85
Net_Init_LoadFunction · 0.85

Calls 1

closeMethod · 0.80

Tested by

no test coverage detected