Post

Replies

Boosts

Views

Activity

Incorrect predictions (tensorflow model converted to core ml)
I converted my model with coremltools: model = tf.keras.models.load_model('mymodel') mlmodel = ct.convert(model, convert_to="mlprogram",inputs=[ct.ImageType( name="sequential_1_input", shape=(1, 192, 192, 3), scale=1.0 / 255.0, bias=[-10,-10,-10], color_layout="RGB"], source="tensorflow", classifier_config=ct.ClassifierConfig(class_labels) ) Set model author name mlmodel.author = 'name' Set the license of the model mlmodel.license ="license" Set a short description for the Xcode UI mlmodel.short_description ="desc " Set a version for the model mlmodel.version = "1.0" mlmodel.save("my model.mlpackage") ` Then use this on my iOS app let buffer = unwrapImage.buffer(with: CGSize(width:192, height:192)) # making sure the image is 192x192 let config = MLModelConfiguration() let imageClassifier = try MyModel(configuration: config) let result = try imageClassifier.prediction(sequential_1_input: buffer!) let className: String = result.classLabel let confidence: Double = result.classLabel_probs[result.classLabel] ?? 1.0 self.the_text = ("\(className)\nWith Confidence:\n\(confidence)") For testing prediction on Core ML I'm using exactly the same image I'm using in python, but the predictions are all the time wrong, not even close! So I'm guessing I'm doing something wrong, either when I do the conversion or after, any ideas?
0
0
600
Sep ’22
Padding top,leading and trailing not working on Iphone SE
Steps to reproduce: add padding 28 Check it out on Iphone 12 Pro Max -> all good Check it out on Iphone SE(2nd generation) -> padding for top, left, right is not showing up. Is it a setting or something? I'm afraid the review will say the spacing is not consistent. Expected result: padding should work in the same way in Iphone 12 Pro Max Actual result: Padding for top, leading, trailing is not working for SE version
0
0
842
Mar ’22