MCPcopy Create free account
hub / github.com/Tencent/TNN / GetInputType

Function GetInputType

tools/quantization/quantize.cc:99–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99bool GetInputType(std::string name, FileFormat& format) {
100 int pos = name.rfind('.');
101 if (pos == std::string::npos)
102 return false;
103
104 std::string suffix = name.substr(pos);
105 std::transform(suffix.begin(), suffix.end(), suffix.begin(), tolower);
106 if (suffix == ".txt") {
107 format = TEXT;
108 } else if (suffix == ".npy") {
109 format = NPY;
110 } else if (suffix == ".jpg") {
111 format = IMAGE;
112 } else if (suffix == ".jpeg") {
113 format = IMAGE;
114 } else if (suffix == ".png") {
115 format = IMAGE;
116 } else if (suffix == ".bmp") {
117 format = IMAGE;
118 } else {
119 return false;
120 }
121
122 return true;
123}
124
125int ImportDataSet(DataSet& dataset, std::string folder_path) {
126 dataset.file_list.clear();

Callers 1

ImportDataSetFunction · 0.70

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected