Skip to content

Commit af28eeb

Browse files
committed
Assert that number of points in .label and .bin files are the same
1 parent 2d350a5 commit af28eeb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/evaluation/kitti_loader.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ void KittiLoader::loadSemanticKittiLabels(const Path& path, std::vector<KittiPoi
3333
// load labels
3434
std::vector<uint16_t> labels_flattened = loadFlattenedPointCloud<uint16_t>(path);
3535
uint32_t num_points = labels_flattened.size() / 2;
36+
if (num_points != points.size())
37+
throw std::runtime_error("Number of points does not match (label/bin): " + std::to_string(num_points) + " / " +
38+
std::to_string(points.size()));
3639
int flattened_index = 0;
3740
for (int32_t i = 0; i < num_points; i++)
3841
{

0 commit comments

Comments
 (0)