Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] fix csharp api detector release result #620

Merged
merged 2 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
irexyc marked this conversation as resolved.
Show resolved Hide resolved
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