You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm trying to training the app using SwiftOCRTraining,
SwiftOCRTraining().trainWithCharSet()
but i find after the generate method finished, the trainData does not have any items
let trainData = generateRealisticCharSet(numberOfTrainImages/4)
// trainData is empty
this is caused by the blobs is not equal to 6,
if blobs.count == 6 {
for blobIndex in 0..<blobs.count {
let blob = blobs[blobIndex]
let imageData = ocrInstance.convertImageToFloatArray(blob.0)
var imageAnswer = [Float](repeating: 0, count: recognizableCharacters.characters.count)
if let index = Array(recognizableCharacters.characters).index(of: Array(code.characters)[blobIndex]) {
imageAnswer[index] = 1
}
trainingSet.append((imageData,imageAnswer))
}
}
I don't know why this happened, can anybody help me?
Many thanks.
The text was updated successfully, but these errors were encountered:
Hi,
I'm trying to training the app using SwiftOCRTraining,
but i find after the generate method finished, the trainData does not have any items
this is caused by the blobs is not equal to 6,
I don't know why this happened, can anybody help me?
Many thanks.
The text was updated successfully, but these errors were encountered: