1

I have trained IBM Watson to recognize objects of interest. Since remote execution isn’t a requirement I want to export to .mlmodel with the tool provided and run in macOS.

Unfortunately learning Swift and macOS development isn’t a requirement either. It is possible to invoke Vision directly from the command line or from a scripting language? As alternative anybody knows a skeleton of macOS app to run Vision over a list of files and obtain classification scores in tabular form? Thanks.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
WuMing2
  • 73
  • 7
  • Have you been able to do this successfully? I am looking to do the same thing but having no luck. – joffd Jul 27 '19 at 10:28

2 Answers2

0

The code mentioned in this article uses a downloaded Core ML model in an iOS App through Watson SDK.

Additionally, Here’s a code sample that uses Watson Visual Recognition and Core ML to classify images. The workspace has two projects

  • Core ML Vision Simple: Classify images locally with Visual Recognition.
  • Core ML Vision Custom: Train a custom Visual Recognition model for more specialized classification.

Refer the code and instructions here

Also, there’s a starter kit that comes with Watson Visual Recognition preconfigured with Core ML - https://console.bluemix.net/developer/appledevelopment/starter-kits/custom-vision-model-for-core-ml-with-watson

Vidyasagar Machupalli
  • 2,737
  • 1
  • 19
  • 29
  • Used Core ML Vision Simple to generate a minimal iOS app for recognition one image at a time. It works but I am looking for something for macOS. Thanks for sharing. – WuMing2 Dec 11 '18 at 02:28
0

You can also load the mlmodel into Python and use the coremltools package to make predictions. I wouldn't use that in a production environment, but it's OK to get something basic up and running.

Matthijs Hollemans
  • 7,706
  • 2
  • 16
  • 23
  • Isn’t clear from the description how prediction works. Would I be able to pass images to it through Vision? Thanks for sharing. – WuMing2 Dec 11 '18 at 02:29
  • From your Python code you'd load the mlmodel file into an `MLModel` object, then call `mlmodel.predict{"image": img}` where `img` is a PIL image object. The result is a dictionary with the classification results. – Matthijs Hollemans Dec 11 '18 at 09:46