[Benchmark]Add SegmentationDiff to compare SegmentationResult diff (#1404)

* avoid mem copy for cpp benchmark

* set CMAKE_BUILD_TYPE to Release

* Add SegmentationDiff

* change pointer to reference

* fixed bug

* cast uint8 to int32
This commit is contained in:
WJJ1995
2023-02-22 14:42:21 +08:00
committed by GitHub
parent dd527388bc
commit 2f8d9c9a57
6 changed files with 177 additions and 45 deletions

View File

@@ -49,7 +49,7 @@ int main(int argc, char* argv[]) {
benchmark::ResultManager::LoadClassifyResult(&res_loaded, cls_result_path);
// Calculate diff between two results.
auto cls_diff =
benchmark::ResultManager::CalculateDiffStatis(&res, &res_loaded);
benchmark::ResultManager::CalculateDiffStatis(res, res_loaded);
std::cout << "Labels diff: mean=" << cls_diff.labels.mean
<< ", max=" << cls_diff.labels.max
<< ", min=" << cls_diff.labels.min << std::endl;