Skip to content

Commit

Permalink
[Fix] fix csharp api detector release result (#620)
Browse files Browse the repository at this point in the history
* fix csharp api detector release result

* fix wrong count arg of xxx_release_result in c# api
  • Loading branch information
irexyc authored Jun 21, 2022
1 parent 9c8168f commit f30eacf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions csrc/mmdeploy/apis/csharp/MMDeploy/APIs/Classifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,14 @@ public List<ClassifierOutput> Apply(Mat[] mats)

private unsafe void FormatResult(int matCount, int* resultCount, Label* results, ref List<ClassifierOutput> output, out int total)
{
total = 0;
total = matCount;
for (int i = 0; i < matCount; i++)
{
ClassifierOutput outi = default;
for (int j = 0; j < resultCount[i]; j++)
{
outi.Add(results->Id, results->Score);
results++;
total++;
}

output.Add(outi);
Expand Down
3 changes: 1 addition & 2 deletions csrc/mmdeploy/apis/csharp/MMDeploy/APIs/Detector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,14 @@ public List<DetectorOutput> Apply(Mat[] mats)

private unsafe void FormatResult(int matCount, int* resultCount, CDetect* results, ref List<DetectorOutput> output, out int total)
{
total = 0;
total = matCount;
for (int i = 0; i < matCount; i++)
{
DetectorOutput outi = default;
for (int j = 0; j < resultCount[i]; j++)
{
outi.Add(results);
results++;
total++;
}

output.Add(outi);
Expand Down
3 changes: 1 addition & 2 deletions csrc/mmdeploy/apis/csharp/MMDeploy/APIs/TextDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,14 @@ public List<TextDetectorOutput> Apply(Mat[] mats)

private unsafe void FormatResult(int matCount, int* resultCount, TextDetect* results, ref List<TextDetectorOutput> output, out int total)
{
total = 0;
total = matCount;
for (int i = 0; i < matCount; i++)
{
TextDetectorOutput outi = default;
for (int j = 0; j < resultCount[i]; j++)
{
outi.Add(results);
results++;
total++;
}

output.Add(outi);
Expand Down

0 comments on commit f30eacf

Please sign in to comment.