Image classification works in preview, but not simulator

Following the guide found here, I've been able to preview image classification in Create ML and Xcode. However, when I swap out the MobileNet model for my own and try running it as an app, images are not classified accurately.

When I check the same images using my model in its Xcode preview tab, the guesses are accurate.

I've tried changing this line to the different available options, but it doesn't seem to help:

imageClassificationRequest.imageCropAndScaleOption = .centerCrop

Does anyone know why a model would work well in preview but not while running in the app? Thanks in advance.

Replies

same problem

Model preview recognize stuff right, while the app on the simulator doesnt.

Did u find any solution, johnny?

  • I found the same thing... breaks in the simulator, but runs well on a device.

Add a Comment