From 05316e666db595def7523d39af085f3af46c4ddf Mon Sep 17 00:00:00 2001 From: Xin Chen Date: Mon, 20 Jun 2022 11:23:09 +0800 Subject: [PATCH 1/2] fix csharp api detector release result --- csrc/mmdeploy/apis/csharp/MMDeploy/APIs/Detector.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/csrc/mmdeploy/apis/csharp/MMDeploy/APIs/Detector.cs b/csrc/mmdeploy/apis/csharp/MMDeploy/APIs/Detector.cs index 584c63aa87..852012afff 100644 --- a/csrc/mmdeploy/apis/csharp/MMDeploy/APIs/Detector.cs +++ b/csrc/mmdeploy/apis/csharp/MMDeploy/APIs/Detector.cs @@ -205,7 +205,7 @@ public List Apply(Mat[] mats) private unsafe void FormatResult(int matCount, int* resultCount, CDetect* results, ref List output, out int total) { - total = 0; + total = matCount; for (int i = 0; i < matCount; i++) { DetectorOutput outi = default; @@ -213,7 +213,6 @@ private unsafe void FormatResult(int matCount, int* resultCount, CDetect* result { outi.Add(results); results++; - total++; } output.Add(outi); From 2960cf9d6ed228d6e9e1bbd9143b2e289a0f814c Mon Sep 17 00:00:00 2001 From: Xin Chen Date: Mon, 20 Jun 2022 22:38:28 +0800 Subject: [PATCH 2/2] fix wrong count arg of xxx_release_result in c# api --- csrc/mmdeploy/apis/csharp/MMDeploy/APIs/Classifier.cs | 3 +-- csrc/mmdeploy/apis/csharp/MMDeploy/APIs/TextDetector.cs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/csrc/mmdeploy/apis/csharp/MMDeploy/APIs/Classifier.cs b/csrc/mmdeploy/apis/csharp/MMDeploy/APIs/Classifier.cs index 5bdb155443..9a2e4d1c05 100644 --- a/csrc/mmdeploy/apis/csharp/MMDeploy/APIs/Classifier.cs +++ b/csrc/mmdeploy/apis/csharp/MMDeploy/APIs/Classifier.cs @@ -106,7 +106,7 @@ public List Apply(Mat[] mats) private unsafe void FormatResult(int matCount, int* resultCount, Label* results, ref List output, out int total) { - total = 0; + total = matCount; for (int i = 0; i < matCount; i++) { ClassifierOutput outi = default; @@ -114,7 +114,6 @@ private unsafe void FormatResult(int matCount, int* resultCount, Label* results, { outi.Add(results->Id, results->Score); results++; - total++; } output.Add(outi); diff --git a/csrc/mmdeploy/apis/csharp/MMDeploy/APIs/TextDetector.cs b/csrc/mmdeploy/apis/csharp/MMDeploy/APIs/TextDetector.cs index 958e629020..87026f9cdf 100644 --- a/csrc/mmdeploy/apis/csharp/MMDeploy/APIs/TextDetector.cs +++ b/csrc/mmdeploy/apis/csharp/MMDeploy/APIs/TextDetector.cs @@ -184,7 +184,7 @@ public List Apply(Mat[] mats) private unsafe void FormatResult(int matCount, int* resultCount, TextDetect* results, ref List output, out int total) { - total = 0; + total = matCount; for (int i = 0; i < matCount; i++) { TextDetectorOutput outi = default; @@ -192,7 +192,6 @@ private unsafe void FormatResult(int matCount, int* resultCount, TextDetect* res { outi.Add(results); results++; - total++; } output.Add(outi);