I am trying to rebuild the Apple test App for image detection via CoreML, but I have the error:
Cannot subscript a value of type '[String : Any]' with an index of type 'UIImagePickerController.InfoKey
extension ImageClassificationViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String: Any]) {
picker.dismiss(animated: true)
let image = info[UIImagePickerControllerOriginalImage] as! UIImage
imageView.image = image
updateClassifications(for: image)
}
The error comes in the line:
let image = info[UIImagePickerControllerOriginalImage] as! UIImage