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

Function ReadLabelsFile

tensorflow/examples/speech_commands/label_wav.cc:58–70  ·  view source on GitHub ↗

Takes a file name, and loads a list of labels from it, one per line, and returns a vector of the strings.

Source from the content-addressed store, hash-verified

56// Takes a file name, and loads a list of labels from it, one per line, and
57// returns a vector of the strings.
58Status ReadLabelsFile(const string& file_name, std::vector<string>* result) {
59 std::ifstream file(file_name);
60 if (!file) {
61 return tensorflow::errors::NotFound("Labels file ", file_name,
62 " not found.");
63 }
64 result->clear();
65 string line;
66 while (std::getline(file, line)) {
67 result->push_back(line);
68 }
69 return Status::OK();
70}
71
72// Analyzes the output of the graph to retrieve the highest scores and
73// their positions in the tensor.

Callers 1

mainFunction · 0.70

Calls 3

NotFoundFunction · 0.85
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected