yahoo / open_nsfw

Not Suitable for Work (NSFW) classification using deep neural network Caffe models.
BSD 2-Clause "Simplified" License
5.86k stars 1.05k forks source link

caffemodel converted to iOS CoreML(.mlmodel) Model it's returning result in Multiarray #59

Open ravi-kotadiya opened 7 years ago

ravi-kotadiya commented 7 years ago

Recently I converted your caffemodel to CoreMode(.mlmodel) but whenever I put in Xcode it's automatically detect mlmodel file and it's giving me Multiarray result.

chika-kasymov commented 6 years ago

@ravi-kotadiya @ycchen1 I think you can access the first element from that array and that is the result (double value).

Example:

let prediction = ...  // your model prediction
let prob = prediction.prob  // the MLMultiArray result, in your case may be other name
let precision = prob![0].doubleValue  // the result like 0.7512