efficient darknet parser for commented line
efficient darknet parser for commented line
This commit is contained in:
@@ -224,11 +224,10 @@ namespace tk { namespace dnn {
|
|||||||
darknetFields_t fields; // will be filled with layers fields
|
darknetFields_t fields; // will be filled with layers fields
|
||||||
std::string line;
|
std::string line;
|
||||||
while(std::getline(if_cfg, line)) {
|
while(std::getline(if_cfg, line)) {
|
||||||
// remove comments
|
// skip commented line
|
||||||
std::size_t found = line.find("#");
|
std::size_t found = line.find("#");
|
||||||
if ( found != std::string::npos ) {
|
if ( found != std::string::npos )
|
||||||
line = line.substr(0, found);
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
// skip empty lines
|
// skip empty lines
|
||||||
if(line.size() == 0)
|
if(line.size() == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user