!24329 fix operator SBUDataset

Merge pull request !24329 from ckczzj/debug_sbu_dataset
This commit is contained in:
i-robot 2021-09-29 01:11:54 +00:00 committed by Gitee
commit 00f769d06f
1 changed files with 2 additions and 1 deletions

View File

@ -209,7 +209,8 @@ Status SBUOp::GetAvailablePairs(std::ifstream &url_file_reader, std::ifstream &c
}
Status SBUOp::ParsePair(const std::string &url, const std::string &caption) {
std::string image_name = url.substr(23, std::string::npos);
CHECK_FAIL_RETURN_UNEXPECTED(url.length() > 23, "Invalid url in " + url_path_.ToString() + ": " + url);
std::string image_name = url.substr(23);
RETURN_IF_NOT_OK(this->ReplaceAll(&image_name, "/", "_"));
Path image_path = image_folder_ / Path(image_name);