Skocz do zawartości

Tobi Marsh

Społeczność Astropolis
  • Postów

    1
  • Dołączył

  • Ostatnia wizyta

Ostatnie wizyty

Blok z ostatnimi odwiedzającymi dany profil jest wyłączony i nie jest wyświetlany użytkownikom.

Osiągnięcia Tobi Marsh

0

Reputacja

  1. I'm pursuing Machine Learning advance course and here is my question. What I would like to do is that once I open the picture library from the camera to select a photo, I will be able to make it identified by a Machine Learning Model. Does anyone know how to do it? This is the code to classify the photo: @State private var isShowPicker: Bool = false @State private var image: Image? = Image("") @State private var classificationLabel: String = "" let model = MobileNetV2() private func performImageClassification() { let currentImageName = ImagePicker(image: self.$image) guard let img = UIImage(named: "\(String(describing: currentImageName))"), let resizedImage = img.resizeTo(size: CGSize(width: 224, height: 224)), let pixelBuffer = resizedImage.toCVPixelBuffer() else { return } let output = try? model.prediction(image: pixelBuffer) if let output = output { self.classificationLabel = output.classLabel } } I am assuming I will have to call it somewhere in the image Picker Controller function which is this one: func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { let uiImage = info[UIImagePickerController.InfoKey.originalImage] as! UIImage image = Image(uiImage: uiImage) presentationMode.dismiss() }
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.