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 #2968 #2986

Merged
merged 2 commits into from
Feb 12, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ protected DetectedObjects processFromBoxOutput(NDList list) {
float[] buf = reshapedResult.toFloatArray();
int numberRows = Math.toIntExact(shape.get(0));
int nClasses = Math.toIntExact(shape.get(1));
int padding = nClasses - classes.size();
if (padding != 0 && padding != 4) {
throw new IllegalStateException(
"Expected classes: " + (nClasses - 4) + ", got " + classes.size());
}

ArrayList<IntermediateResult> intermediateResults = new ArrayList<>();
// reverse order search in heap; searches through #maxBoxes for optimization when set
Expand All @@ -78,6 +83,7 @@ protected DetectedObjects processFromBoxOutput(NDList list) {
maxIndex = c;
}
}
maxIndex -= padding;

if (maxClassProb > threshold) {
float xPos = buf[index]; // center x
Expand Down
Loading