Section 16/161 menit

16. Ringkasan & Decision Guide

16. Ringkasan & Decision Guide

Pilih Pendekatan yang Tepat

Skenario Rekomendasi
Klasifikasi gambar (foto) Vision + VNCoreMLRequest
Deteksi objek real-time (kamera) Vision + VNCoreMLRequest + AVFoundation
Analisis teks / NLP NaturalLanguage framework
Model custom dari PyTorch/TF coremltools convert → .mlpackage → Core ML
Training model baru Create ML (tanpa code) atau coremltools (Python)
Model besar, akurasi prioritas Server API (bukan Core ML)
Performa maksimum computeUnits = .all, cache model instance
Privasi sensitif Core ML on-device selalu
Model berubah sering Core ML Deployment via CloudKit atau in-app download
Personalisasi per-user Updatable Model + MLUpdateTask

Checklist Sebelum Shipping

swift
□ Model di-load sekali, tidak setiap prediction
□ Input validation ada (image nil check, shape check)
□ Prediksi dijalankan di background thread atau async
□ computeUnits = .all kecuali ada alasan spesifik
□ Model di-benchmark di device (bukan simulator)
□ Memory warning handling untuk model besar
□ Model ukuran dicek — pertimbangkan Float16 quantization jika >50MB
□ Error handling untuk semua `try` calls
□ Tested di device fisik, bukan hanya simulator

Core ML adalah pilihan pertama untuk semua ML tasks di iOS/macOS — ekosistem yang matang, terintegrasi dengan Vision dan NaturalLanguage, dan dioptimasi sangat baik untuk hardware Apple. Langkah selanjutnya: eksplorasi Create ML untuk training custom model, dan coremltools untuk konversi dan optimasi model dari framework ML lain.