MCPcopy Create free account
hub / github.com/apple/coremltools / hasIOS14Features

Method hasIOS14Features

mlmodel/src/Utils.cpp:579–607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577}
578
579bool CoreML::hasIOS14Features(const Specification::Model& model) {
580 // New IOS14 features:
581 // - new layers in Neural Network
582 // - Non-zero values for optional inputs
583 // - VisionFeaturePrint.Object
584 // - Float32 input/output for Non-Maximum Suppression
585 // - Apple Word Tagger using transfer learning (revision == 3)
586
587 return walkModelAndPipeline(
588 model,
589 [](const Specification::Model& m) {
590 switch (m.Type_case()) {
591 case Specification::Model::kSerializedModel:
592 // SerializedModel proto message was added in ios14
593 return true;
594 case Specification::Model::kWordTagger:
595 if (m.wordtagger().revision() == 3) {
596 return true;
597 }
598 break;
599 default:
600 break;
601 }
602 return
603 hasIOS14NeuralNetworkFeatures(m) ||
604 isObjectPrint(m) ||
605 nonMaxSuppressionUsesFloat32InputsOrOutputs(m);
606 });
607}
608
609bool CoreML::hasIOS15Features(const Specification::Model& model) {
610 // New in IOS15 features:

Callers

nothing calls this directly

Calls 4

walkModelAndPipelineFunction · 0.85
isObjectPrintFunction · 0.85

Tested by

no test coverage detected