Skip to content

Commit

Permalink
Fix the zero output case handling
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 276485691
  • Loading branch information
yyoon authored and Copybara-Service committed Oct 24, 2019
1 parent 348ea2d commit 4fcc9a4
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -190,6 +190,9 @@ class ModelDataHandler: NSObject {
/// sorted in descending order.
func formatResults(boundingBox: [Float], outputClasses: [Float], outputScores: [Float], outputCount: Int, width: CGFloat, height: CGFloat) -> [Inference]{
var resultsArray: [Inference] = []
if (outputCount == 0) {
return resultsArray
}
for i in 0...outputCount - 1 {

let score = outputScores[i]
Expand Down

0 comments on commit 4fcc9a4

Please sign in to comment.