Skip to content

Commit cb7b5e2

Browse files
committed
Fix bug with batch size
1 parent c117f0f commit cb7b5e2

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

example/CarsCounting.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ bool CarsCounting::InitDetector(cv::UMat frame)
181181
config.emplace("nmsThreshold", "0.4");
182182
config.emplace("swapRB", "0");
183183
config.emplace("maxCropRatio", "-1");
184+
if (m_batchSize > 1)
185+
config.emplace("maxBatch", std::to_string(m_batchSize));
184186

185187
config.emplace("white_list", std::to_string((objtype_t)ObjectTypes::obj_person));
186188
config.emplace("white_list", std::to_string((objtype_t)ObjectTypes::obj_car));

example/examples.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ class YoloDarknetExample final : public VideoExample
637637
}
638638
if (maxBatch < m_batchSize)
639639
maxBatch = m_batchSize;
640-
config.emplace("maxBatch", std::to_string(m_batchSize));
640+
config.emplace("maxBatch", std::to_string(maxBatch));
641641
config.emplace("classNames", pathToModel + "coco.names");
642642
config.emplace("maxCropRatio", "-1");
643643
}
@@ -901,7 +901,7 @@ class YoloTensorRTExample final : public VideoExample
901901
}
902902
if (maxBatch < m_batchSize)
903903
maxBatch = m_batchSize;
904-
config.emplace("maxBatch", std::to_string(m_batchSize));
904+
config.emplace("maxBatch", std::to_string(maxBatch));
905905
config.emplace("classNames", pathToModel + "coco.names");
906906
}
907907
else

0 commit comments

Comments
 (0)