Skip to content

Lite API: Machine Learning

Hayun Lee edited this page Dec 21, 2020 · 4 revisions

Parent Document: ANT APIs

Machine Learning API comprises of basic ML element functions and task-specific ML element functions.

var mlAPI = require('ant').ml;

Basic ML Element

createMLElement()

  • Object createMLElement(String modelPath, Array inputShapes, String inputTypes, String inputNames, Array outputShapes, String outputTypes, String outputNames, String taskName)

Task-specific ML Element

createImgClsImagenetElement()

  • Object createImgClsImagenetElement(String modelPath)

createObjDetCocoElement()

  • Object createObjDetCocoElement(string modelPath, Number resolution, Number maxBoundingBoxes)

createMLFragmentElement()

  • Object createMLFragmentElement(String modelPath, Array inputShapes, String inputTypes, String inputNames, String taskName, Number numFragments, String targetUri)

ML Utility

toFloatArray()

  • Array toFloatArray(Array buffer)

getMaxOfBuffer()

  • Object getMaxOfBuffer(Array Buffer, String type)

downloadModel()

  • String downloadModel(String modelUrl, String overwriteIfExists)