[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[clari8] 02 prediction




| model image dataAsset input inputs results |
model := Clarifai sharedInstance generalModel.
image := CAIImage withURL: NSURL @ 'http://www.tripatrek.com/wp-content/uploads/2017/04/Big-Lagoon-El-Nido.jpg'.
dataAsset := CAIDataAsset withImage: image.
input := CAIInput withDataAsset: dataAsset.
inputs := NSArray withObject: input.
results := #().
model	predict: inputs concepts: [:concept|
	results add: concept name
] then: [ self alert: results toString "sayIn: #en-US" ]
onError: [:nsError| self error: nsError ].


| model image dataAsset input inputs result |
model := Clarifai sharedInstance generalModel.
image := CAIImage withURL: NSURL @ 'https://www.gettingstamped.com/wp-content/uploads/2014/03/El-Nido-Philippines-Day-Trip-C-31.jpg'.
dataAsset := CAIDataAsset withImage: image.
input := CAIInput withDataAsset: dataAsset.
inputs := NSArray withObject: input.
model	predict: inputs
	conceptNames: [:array| array toString sayIn: #en-US ]
	onError: [:nsError| self error: nsError ].