From 9e48e3daaa9de4dcc5592b41c4e12411643fa1c8 Mon Sep 17 00:00:00 2001 From: xiefangqi Date: Mon, 18 May 2020 22:13:32 +0800 Subject: [PATCH] del CR in VOC txt --- mindspore/ccsrc/dataset/engine/datasetops/source/voc_op.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/dataset/engine/datasetops/source/voc_op.cc b/mindspore/ccsrc/dataset/engine/datasetops/source/voc_op.cc index 63deec26a..5896126be 100644 --- a/mindspore/ccsrc/dataset/engine/datasetops/source/voc_op.cc +++ b/mindspore/ccsrc/dataset/engine/datasetops/source/voc_op.cc @@ -270,7 +270,11 @@ Status VOCOp::ParseImageIds() { } std::string id; while (getline(in_file, id)) { - image_ids_.push_back(id); + if (id[id.size() - 1] == '\r') { + image_ids_.push_back(id.substr(0, id.size() - 1)); + } else { + image_ids_.push_back(id); + } } in_file.close(); image_ids_.shrink_to_fit(); -- GitLab