this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #1 from ArtemBernatskyy/patch-1

Added "confidence" field to json

authored by

Lihang Xu and committed by
GitHub
64f1b8c6 1bde420a

+2
+2
OCR/main.swift
··· 70 70 var line:[String:Any] = [:] 71 71 let candidate = observation.topCandidates(1).first 72 72 let string = candidate?.string 73 + let confidence = candidate?.confidence 73 74 // Find the bounding-box observation for the string range. 74 75 let stringRange = string!.startIndex..<string!.endIndex 75 76 let boxObservation = try? candidate?.boundingBox(for: stringRange) ··· 82 83 Int(imgRef.height)) 83 84 84 85 line["text"] = string ?? "" 86 + line["confidence"] = confidence ?? "" 85 87 line["x"] = Int(rect.minX) 86 88 line["width"] = Int(rect.size.width) 87 89 line["y"] = Int(CGFloat(imgRef.height) - rect.minY - rect.size.height)