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

Function matchExt

rtpose_wrapper/src/caffe/util/io.cpp:106–117  ·  view source on GitHub ↗

Do the file extension and encoding match?

Source from the content-addressed store, hash-verified

104
105// Do the file extension and encoding match?
106static bool matchExt(const std::string & fn,
107 std::string en) {
108 size_t p = fn.rfind('.');
109 std::string ext = p != fn.npos ? fn.substr(p) : fn;
110 std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
111 std::transform(en.begin(), en.end(), en.begin(), ::tolower);
112 if ( ext == en )
113 return true;
114 if ( en == "jpg" && ext == "jpeg" )
115 return true;
116 return false;
117}
118
119bool ReadImageToDatum(const string& filename, const int label,
120 const int height, const int width, const bool is_color,

Callers 1

ReadImageToDatumFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected