Skip to content

Commit

Permalink
fix: raise exception when a bbox file contains invalid classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bycob committed Feb 14, 2023
1 parent 6db03be commit 3a82a9d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/backends/torch/torchdataset.cc
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,12 @@ namespace dd
std::string val;
iss >> val;
int cls = std::stoi(val);
if (cls <= 0)
{
throw InputConnectorBadParamException(
"Dataset contains an invalid class:" + std::to_string(cls)
+ " in file " + bboxfname);
}
classes.push_back(target_to_tensor(cls));

std::vector<double> bbox(4);
Expand Down

0 comments on commit 3a82a9d

Please sign in to comment.