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

Method hasIOS17Features

mlmodel/src/Utils.cpp:648–685  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

646}
647
648bool CoreML::hasIOS17Features(const Specification::Model& model) {
649 // New in IOS17 features:
650 // - Revision 2 of Apple Vision feature extractor for scenes
651 // - BERT embedding for text classifier and word tagger (revision == 4)
652
653 return walkModelAndPipeline(
654 model,
655 [](const Specification::Model& m) {
656 switch (m.Type_case()) {
657 case Specification::Model::kVisionFeaturePrint:
658 if (m.visionfeatureprint().has_scene() &&
659 m.visionfeatureprint().scene().version() == 2) {
660 return true;
661 }
662 break;
663 case Specification::Model::kClassConfidenceThresholding:
664 return true;
665 case Specification::Model::kWordTagger:
666 if (m.wordtagger().revision() == 4) {
667 return true;
668 }
669 break;
670 case Specification::Model::kTextClassifier:
671 if (m.textclassifier().revision() == 4) {
672 return true;
673 }
674 break;
675 case Specification::Model::kMlProgram:
676 if (hasCoreML7Opsets(m)) {
677 return true;
678 }
679 break;
680 default:
681 break;
682 }
683 return false;
684 });
685}
686
687bool CoreML::hasIOS18Features(const Specification::Model& model) {
688 // New in IOS18 features:

Callers

nothing calls this directly

Calls 3

walkModelAndPipelineFunction · 0.85
hasCoreML7OpsetsFunction · 0.85
versionMethod · 0.80

Tested by

no test coverage detected