Open ily-R opened 1 year ago
I think it's going to be a lot easier to add NMS to your Keras model, then convert that updated model to Core ML. I would recommend taking that approach.
will it be slower ? Also coremltools doesnt support https://www.tensorflow.org/api_docs/python/tf/image/non_max_suppression
The converted model should not be any slower. For TensorFlow we support both NonMaxSuppression
and NonMaxSuppressionV5
.
But does this mean that the "old" way of making a Pipeline with merging two or more mlmodel files (Model, (Postprocessing Model) and NMS) don't work with mlpackage files instead of mlmodel anymore ? Because starting with minimum_deployment_target=ct.target.iOS15 it is only possible to create a mlpackage with coremltools.convert. So a pipeline is only possible with minimum_deployment_target=ct.target.iOS14 ? Or is it somehow possible to get a "Standonly" mlmodel file after converting a pytorch model with minimum_deployment_target=ct.target.iOS15 & iOs16 ?
Hi, thank you for filing this issue. I can confirm that this is unfortunately a bug, possibly an issue both in coremltools and CoreML framework , which doesn't initialize a pipeline model correctly, that contains an mlprogram.
I am going to mark this a bug, and we will be investigating it.
Has this issue been resolved? The sample below is an mlprogram with NMS added.
https://gist.github.com/otmb/72cac326837bff4b4ad1dda508a91428
Thank.
❓Question
I have a detection keras model
EfficientDetLite2
That I converted tomlprogram
as follows:it has two outputs:
Identity
representing the boxes_coordinates of shape(1, 37629, 4)
Identity_1
representing the scores of shape(1, 37629)
✅ The model is converted successfully.
Now I wanted to add NMS to the model like follows:
✅ NMS model was saved successfully
Now I wanted to combine the models into a pipeline as follows:
Now i want to save the pipeline as mlprogram
This raises the following warning :
running the convertion script with
sudo
gives the following warning:In both cases I cant open the model with Xcode 14.1, i get the error
missingMetadataField(named: "inputSchema")
I tried again with this saving medthod instead:
✅ I get No warnings ✅ I can load the model in Xcode 14.1 ❌ I get no detections even with confidenceThreshold = 0.0 . ❌ I can't load the model into Netron.app
I dont know what I did wrong, I am guessing im no passing the weight correctly, but even with wrong weights, I should get detection with 0.0 threhsold.