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AAM,mBAAmB,GACnD,MAAM,mBAAmB,GAAe,IACxC,EACJ,KAAK,KAAO,sBAAsB,wBAAwB,KAAK,GAAI,GACnE,KAAK,QAAU,IAAI,gBAAgB,KAAK,GAC1C,CAEA,UAAM,CAAK,GAET,aADM,KAAK,KACJ,sBAAsB,KAAK,KAAK,GAAI,EAC7C,CAEA,SAAM,CAAI,EAAa,GAErB,aADM,KAAK,KACJ,sBAAsB,IAAI,KAAK,GAAI,OAA2B,IAAd,GAA0B,EACnF,CAEA,WAAM,CAAM,GAEV,aADM,KAAK,KACJ,sBAAsB,MAAM,KAAK,GAAI,EAC9C,CAEA,WAAM,GAEJ,aADM,KAAK,KACJ,KAAK,OACd,CAEA,WAAM,GAEJ,aADM,KAAK,KACJ,sBAAsB,MAAM,KAAK,GAC1C,CAEA,WAAM,GAEJ,aADM,KAAK,KACJ,sBAAsB,MAAM,KAAK,GAC1C,EAGF,MAAM,mBACJ,WAAA,CAAY,GACV,KAAK,GAAK,OACV,EAAY,MAA+C,MAA3C,MAAM,mBAAmB,EAAY,OACjD,MAAM,mBAAmB,EAAY,OAAG,IACxC,EAAY,MAEhB,EAAa,OAAgD,MAA5C,MAAM,mBAAmB,EAAa,QACnD,MAAM,mBAAmB,EAAa,QAAG,IACzC,EAAa,OAEjB,KAAK,KAAO,mBAAmB,oBAAoB,KAAK,GAAI,EAC9D,CAEA,eAAM,CAAU,GAOd,aANM,KAAK,KAEX,EAAY,MAA+C,MAA3C,MAAM,mBAAmB,EAAY,OACjD,MAAM,mBAAmB,EAAY,OAAG,IACxC,EAAY,MAET,mBAAmB,UAAU,KAAK,GAAI,EAC/C,CAEA,WAAM,GAEJ,aADM,KAAK,KACJ,mBAAmB,MAAM,KAAK,GACvC,SAGO,WAAY","file":"/npm/react-native-tensorflow@0.1.8/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/react-native-tensorflow@0.1.8/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\nimport { NativeModules, Image } from 'react-native';\nimport uuid from 'uuid/v1';\n\nconst { RNImageRecognition, RNTensorFlowInference, RNTensorFlowGraph, RNTensorFlowGraphOperations } = NativeModules;\n\nclass TensorFlowOperation {\n  constructor(id, opName) {\n    this.id = id\n    this.opName = opName\n  }\n\n  inputListLength(name) {\n    return RNTensorFlowGraphOperations.inputListLength(this.id, this.opName, name);\n  }\n\n  name() {\n    return RNTensorFlowGraphOperations.name(this.id, this.opName)\n  }\n\n  numOutputs() {\n    return RNTensorFlowGraphOperations.numOutputs(this.id, this.opName)\n  }\n\n  output(index) {\n    return RNTensorFlowGraphOperations.output(this.id, this.opName, index)\n  }\n\n  outputList(index, length) {\n    return RNTensorFlowGraphOperations.outputList(this.id, this.opName, index, length)\n  }\n\n  outputListLength(name) {\n    return RNTensorFlowGraphOperations.outputListLength(this.id, this.opName, name)\n  }\n\n  type() {\n    return RNTensorFlowGraphOperations.type(this.id, this.opName)\n  }\n}\n\nclass TensorFlowGraph {\n  constructor(id) {\n    this.id = id\n  }\n\n  importGraphDef(graphDef) {\n    return RNTensorFlowGraph.importGraphDef(this.id, graphDef)\n  }\n\n  importGraphDefWithPrefix(graphDef, prefix) {\n    return RNTensorFlowGraph.importGraphDefWithPrefix(this.id, graphDef, prefix)\n  }\n\n  toGraphDef() {\n    return RNTensorFlowGraph.toGraphDef(this.id)\n  }\n\n  operation(name) {\n    return new TensorFlowOperation(this.id, name)\n  }\n\n  close() {\n    return RNTensorFlowGraph.close(this.id)\n  }\n}\n\nclass TensorFlow {\n\n  constructor(modelLocation) {\n    this.id = uuid()\n    const resolvedModelLocation = Image.resolveAssetSource(modelLocation) != null\n      ? Image.resolveAssetSource(modelLocation).uri\n      : modelLocation\n    this.init = RNTensorFlowInference.initTensorFlowInference(this.id, resolvedModelLocation)\n    this.tfGraph = new TensorFlowGraph(this.id)\n  }\n\n  async feed(data) {\n    await this.init\n    return RNTensorFlowInference.feed(this.id, data)\n  }\n\n  async run(outputNames, withStats) {\n    await this.init\n    return RNTensorFlowInference.run(this.id, outputNames, withStats !== undefined ? withStats : false)\n  }\n\n  async fetch(outputName) {\n    await this.init\n    return RNTensorFlowInference.fetch(this.id, outputName)\n  }\n\n  async graph() {\n    await this.init\n    return this.tfGraph\n  }\n\n  async reset() {\n    await this.init\n    return RNTensorFlowInference.reset(this.id)\n  }\n  \n  async close() {\n    await this.init\n    return RNTensorFlowInference.close(this.id)\n  }\n}\n\nclass TfImageRecognition {\n  constructor(data) {\n    this.id = uuid()\n    data['model'] = Image.resolveAssetSource(data['model']) != null\n      ? Image.resolveAssetSource(data['model']).uri\n      : data['model']\n\n    data['labels'] = Image.resolveAssetSource(data['labels']) != null\n      ? Image.resolveAssetSource(data['labels']).uri\n      : data['labels']\n\n    this.init = RNImageRecognition.initImageRecognizer(this.id, data)\n  }\n\n  async recognize(data) {\n    await this.init\n\n    data['image'] = Image.resolveAssetSource(data['image']) != null\n      ? Image.resolveAssetSource(data['image']).uri\n      : data['image']\n\n    return RNImageRecognition.recognize(this.id, data)\n  }\n\n  async close() {\n    await this.init\n    return RNImageRecognition.close(this.id)\n  }\n}\n\nexport { TensorFlow, TfImageRecognition }\n"]}