react-native-executorch 0.7.0-nightly-b4770df-20260205 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/common/rnexecutorch/ErrorCodes.h +15 -30
  2. package/common/rnexecutorch/host_objects/ModelHostObject.h +5 -0
  3. package/common/rnexecutorch/models/llm/LLM.cpp +7 -0
  4. package/common/rnexecutorch/models/llm/LLM.h +1 -0
  5. package/lib/module/constants/llmDefaults.js +31 -0
  6. package/lib/module/constants/llmDefaults.js.map +1 -1
  7. package/lib/module/constants/modelUrls.js +220 -0
  8. package/lib/module/constants/modelUrls.js.map +1 -1
  9. package/lib/module/constants/ocr/models.js +255 -73
  10. package/lib/module/constants/ocr/models.js.map +1 -1
  11. package/lib/module/constants/ocr/symbols.js +4 -0
  12. package/lib/module/constants/ocr/symbols.js.map +1 -1
  13. package/lib/module/constants/tts/models.js +6 -2
  14. package/lib/module/constants/tts/models.js.map +1 -1
  15. package/lib/module/constants/tts/voices.js +27 -3
  16. package/lib/module/constants/tts/voices.js.map +1 -1
  17. package/lib/module/constants/versions.js +2 -2
  18. package/lib/module/controllers/LLMController.js +9 -0
  19. package/lib/module/controllers/LLMController.js.map +1 -1
  20. package/lib/module/errors/ErrorCodes.js +54 -0
  21. package/lib/module/errors/ErrorCodes.js.map +1 -1
  22. package/lib/module/errors/errorUtils.js +30 -6
  23. package/lib/module/errors/errorUtils.js.map +1 -1
  24. package/lib/module/hooks/computer_vision/useClassification.js +7 -0
  25. package/lib/module/hooks/computer_vision/useClassification.js.map +1 -1
  26. package/lib/module/hooks/computer_vision/useImageEmbeddings.js +8 -0
  27. package/lib/module/hooks/computer_vision/useImageEmbeddings.js.map +1 -1
  28. package/lib/module/hooks/computer_vision/useImageSegmentation.js +7 -0
  29. package/lib/module/hooks/computer_vision/useImageSegmentation.js.map +1 -1
  30. package/lib/module/hooks/computer_vision/useOCR.js +7 -0
  31. package/lib/module/hooks/computer_vision/useOCR.js.map +1 -1
  32. package/lib/module/hooks/computer_vision/useObjectDetection.js +7 -0
  33. package/lib/module/hooks/computer_vision/useObjectDetection.js.map +1 -1
  34. package/lib/module/hooks/computer_vision/useStyleTransfer.js +7 -0
  35. package/lib/module/hooks/computer_vision/useStyleTransfer.js.map +1 -1
  36. package/lib/module/hooks/computer_vision/useTextToImage.js +7 -0
  37. package/lib/module/hooks/computer_vision/useTextToImage.js.map +1 -1
  38. package/lib/module/hooks/computer_vision/useVerticalOCR.js +7 -0
  39. package/lib/module/hooks/computer_vision/useVerticalOCR.js.map +1 -1
  40. package/lib/module/hooks/general/useExecutorchModule.js +8 -0
  41. package/lib/module/hooks/general/useExecutorchModule.js.map +1 -1
  42. package/lib/module/hooks/natural_language_processing/useLLM.js +11 -3
  43. package/lib/module/hooks/natural_language_processing/useLLM.js.map +1 -1
  44. package/lib/module/hooks/natural_language_processing/useSpeechToText.js +8 -0
  45. package/lib/module/hooks/natural_language_processing/useSpeechToText.js.map +1 -1
  46. package/lib/module/hooks/natural_language_processing/useTextEmbeddings.js +7 -0
  47. package/lib/module/hooks/natural_language_processing/useTextEmbeddings.js.map +1 -1
  48. package/lib/module/hooks/natural_language_processing/useTextToSpeech.js +8 -0
  49. package/lib/module/hooks/natural_language_processing/useTextToSpeech.js.map +1 -1
  50. package/lib/module/hooks/natural_language_processing/useTokenizer.js +7 -0
  51. package/lib/module/hooks/natural_language_processing/useTokenizer.js.map +1 -1
  52. package/lib/module/hooks/natural_language_processing/useVAD.js +7 -0
  53. package/lib/module/hooks/natural_language_processing/useVAD.js.map +1 -1
  54. package/lib/module/hooks/useModule.js +12 -0
  55. package/lib/module/hooks/useModule.js.map +1 -1
  56. package/lib/module/index.js +10 -1
  57. package/lib/module/index.js.map +1 -1
  58. package/lib/module/modules/BaseModule.js +22 -0
  59. package/lib/module/modules/BaseModule.js.map +1 -1
  60. package/lib/module/modules/computer_vision/ClassificationModule.js +20 -0
  61. package/lib/module/modules/computer_vision/ClassificationModule.js.map +1 -1
  62. package/lib/module/modules/computer_vision/ImageEmbeddingsModule.js +19 -0
  63. package/lib/module/modules/computer_vision/ImageEmbeddingsModule.js.map +1 -1
  64. package/lib/module/modules/computer_vision/ImageSegmentationModule.js +22 -0
  65. package/lib/module/modules/computer_vision/ImageSegmentationModule.js.map +1 -1
  66. package/lib/module/modules/computer_vision/OCRModule.js +26 -0
  67. package/lib/module/modules/computer_vision/OCRModule.js.map +1 -1
  68. package/lib/module/modules/computer_vision/ObjectDetectionModule.js +22 -0
  69. package/lib/module/modules/computer_vision/ObjectDetectionModule.js.map +1 -1
  70. package/lib/module/modules/computer_vision/StyleTransferModule.js +20 -0
  71. package/lib/module/modules/computer_vision/StyleTransferModule.js.map +1 -1
  72. package/lib/module/modules/computer_vision/TextToImageModule.js +33 -0
  73. package/lib/module/modules/computer_vision/TextToImageModule.js.map +1 -1
  74. package/lib/module/modules/computer_vision/VerticalOCRModule.js +27 -0
  75. package/lib/module/modules/computer_vision/VerticalOCRModule.js.map +1 -1
  76. package/lib/module/modules/general/ExecutorchModule.js +21 -0
  77. package/lib/module/modules/general/ExecutorchModule.js.map +1 -1
  78. package/lib/module/modules/natural_language_processing/LLMModule.js +104 -0
  79. package/lib/module/modules/natural_language_processing/LLMModule.js.map +1 -1
  80. package/lib/module/modules/natural_language_processing/SpeechToTextModule.js +67 -21
  81. package/lib/module/modules/natural_language_processing/SpeechToTextModule.js.map +1 -1
  82. package/lib/module/modules/natural_language_processing/TextEmbeddingsModule.js +21 -0
  83. package/lib/module/modules/natural_language_processing/TextEmbeddingsModule.js.map +1 -1
  84. package/lib/module/modules/natural_language_processing/TextToSpeechModule.js +40 -0
  85. package/lib/module/modules/natural_language_processing/TextToSpeechModule.js.map +1 -1
  86. package/lib/module/modules/natural_language_processing/TokenizerModule.js +54 -2
  87. package/lib/module/modules/natural_language_processing/TokenizerModule.js.map +1 -1
  88. package/lib/module/modules/natural_language_processing/VADModule.js +20 -0
  89. package/lib/module/modules/natural_language_processing/VADModule.js.map +1 -1
  90. package/lib/module/types/classification.js +4 -0
  91. package/lib/module/types/classification.js.map +1 -0
  92. package/lib/module/types/common.js +96 -0
  93. package/lib/module/types/common.js.map +1 -1
  94. package/lib/module/types/executorchModule.js +4 -0
  95. package/lib/module/types/executorchModule.js.map +1 -0
  96. package/lib/module/types/imageEmbeddings.js +4 -0
  97. package/lib/module/types/imageEmbeddings.js.map +1 -0
  98. package/lib/module/types/imageSegmentation.js +22 -1
  99. package/lib/module/types/imageSegmentation.js.map +1 -1
  100. package/lib/module/types/llm.js +80 -2
  101. package/lib/module/types/llm.js.map +1 -1
  102. package/lib/module/types/objectDetection.js +42 -2
  103. package/lib/module/types/objectDetection.js.map +1 -1
  104. package/lib/module/types/styleTransfer.js +4 -0
  105. package/lib/module/types/styleTransfer.js.map +1 -0
  106. package/lib/module/types/textEmbeddings.js +4 -0
  107. package/lib/module/types/textEmbeddings.js.map +1 -0
  108. package/lib/module/types/tokenizer.js +4 -0
  109. package/lib/module/types/tokenizer.js.map +1 -0
  110. package/lib/module/types/tti.js +4 -0
  111. package/lib/module/types/tti.js.map +1 -0
  112. package/lib/module/types/vad.js +2 -0
  113. package/lib/module/utils/ResourceFetcher.js +63 -0
  114. package/lib/module/utils/ResourceFetcher.js.map +1 -1
  115. package/lib/module/utils/llm.js +24 -1
  116. package/lib/module/utils/llm.js.map +1 -1
  117. package/lib/typescript/constants/llmDefaults.d.ts +27 -0
  118. package/lib/typescript/constants/llmDefaults.d.ts.map +1 -1
  119. package/lib/typescript/constants/modelUrls.d.ts +165 -0
  120. package/lib/typescript/constants/modelUrls.d.ts.map +1 -1
  121. package/lib/typescript/constants/ocr/models.d.ts +189 -315
  122. package/lib/typescript/constants/ocr/models.d.ts.map +1 -1
  123. package/lib/typescript/constants/ocr/symbols.d.ts +3 -0
  124. package/lib/typescript/constants/ocr/symbols.d.ts.map +1 -1
  125. package/lib/typescript/constants/tts/models.d.ts +4 -0
  126. package/lib/typescript/constants/tts/models.d.ts.map +1 -1
  127. package/lib/typescript/constants/tts/voices.d.ts +24 -0
  128. package/lib/typescript/constants/tts/voices.d.ts.map +1 -1
  129. package/lib/typescript/constants/versions.d.ts +2 -2
  130. package/lib/typescript/controllers/LLMController.d.ts +2 -0
  131. package/lib/typescript/controllers/LLMController.d.ts.map +1 -1
  132. package/lib/typescript/errors/ErrorCodes.d.ts +54 -0
  133. package/lib/typescript/errors/ErrorCodes.d.ts.map +1 -1
  134. package/lib/typescript/errors/errorUtils.d.ts +9 -0
  135. package/lib/typescript/errors/errorUtils.d.ts.map +1 -1
  136. package/lib/typescript/hooks/computer_vision/useClassification.d.ts +9 -15
  137. package/lib/typescript/hooks/computer_vision/useClassification.d.ts.map +1 -1
  138. package/lib/typescript/hooks/computer_vision/useImageEmbeddings.d.ts +9 -15
  139. package/lib/typescript/hooks/computer_vision/useImageEmbeddings.d.ts.map +1 -1
  140. package/lib/typescript/hooks/computer_vision/useImageSegmentation.d.ts +9 -38
  141. package/lib/typescript/hooks/computer_vision/useImageSegmentation.d.ts.map +1 -1
  142. package/lib/typescript/hooks/computer_vision/useOCR.d.ts +9 -19
  143. package/lib/typescript/hooks/computer_vision/useOCR.d.ts.map +1 -1
  144. package/lib/typescript/hooks/computer_vision/useObjectDetection.d.ts +9 -15
  145. package/lib/typescript/hooks/computer_vision/useObjectDetection.d.ts.map +1 -1
  146. package/lib/typescript/hooks/computer_vision/useStyleTransfer.d.ts +9 -15
  147. package/lib/typescript/hooks/computer_vision/useStyleTransfer.d.ts.map +1 -1
  148. package/lib/typescript/hooks/computer_vision/useTextToImage.d.ts +9 -22
  149. package/lib/typescript/hooks/computer_vision/useTextToImage.d.ts.map +1 -1
  150. package/lib/typescript/hooks/computer_vision/useVerticalOCR.d.ts +9 -20
  151. package/lib/typescript/hooks/computer_vision/useVerticalOCR.d.ts.map +1 -1
  152. package/lib/typescript/hooks/general/useExecutorchModule.d.ts +9 -13
  153. package/lib/typescript/hooks/general/useExecutorchModule.d.ts.map +1 -1
  154. package/lib/typescript/hooks/natural_language_processing/useLLM.d.ts +9 -10
  155. package/lib/typescript/hooks/natural_language_processing/useLLM.d.ts.map +1 -1
  156. package/lib/typescript/hooks/natural_language_processing/useSpeechToText.d.ts +9 -19
  157. package/lib/typescript/hooks/natural_language_processing/useSpeechToText.d.ts.map +1 -1
  158. package/lib/typescript/hooks/natural_language_processing/useTextEmbeddings.d.ts +9 -16
  159. package/lib/typescript/hooks/natural_language_processing/useTextEmbeddings.d.ts.map +1 -1
  160. package/lib/typescript/hooks/natural_language_processing/useTextToSpeech.d.ts +9 -15
  161. package/lib/typescript/hooks/natural_language_processing/useTextToSpeech.d.ts.map +1 -1
  162. package/lib/typescript/hooks/natural_language_processing/useTokenizer.d.ts +9 -18
  163. package/lib/typescript/hooks/natural_language_processing/useTokenizer.d.ts.map +1 -1
  164. package/lib/typescript/hooks/natural_language_processing/useVAD.d.ts +9 -15
  165. package/lib/typescript/hooks/natural_language_processing/useVAD.d.ts.map +1 -1
  166. package/lib/typescript/hooks/useModule.d.ts +12 -0
  167. package/lib/typescript/hooks/useModule.d.ts.map +1 -1
  168. package/lib/typescript/index.d.ts +10 -1
  169. package/lib/typescript/index.d.ts.map +1 -1
  170. package/lib/typescript/modules/BaseModule.d.ts +20 -0
  171. package/lib/typescript/modules/BaseModule.d.ts.map +1 -1
  172. package/lib/typescript/modules/computer_vision/ClassificationModule.d.ts +21 -1
  173. package/lib/typescript/modules/computer_vision/ClassificationModule.d.ts.map +1 -1
  174. package/lib/typescript/modules/computer_vision/ImageEmbeddingsModule.d.ts +17 -0
  175. package/lib/typescript/modules/computer_vision/ImageEmbeddingsModule.d.ts.map +1 -1
  176. package/lib/typescript/modules/computer_vision/ImageSegmentationModule.d.ts +21 -3
  177. package/lib/typescript/modules/computer_vision/ImageSegmentationModule.d.ts.map +1 -1
  178. package/lib/typescript/modules/computer_vision/OCRModule.d.ts +25 -2
  179. package/lib/typescript/modules/computer_vision/OCRModule.d.ts.map +1 -1
  180. package/lib/typescript/modules/computer_vision/ObjectDetectionModule.d.ts +20 -0
  181. package/lib/typescript/modules/computer_vision/ObjectDetectionModule.d.ts.map +1 -1
  182. package/lib/typescript/modules/computer_vision/StyleTransferModule.d.ts +18 -0
  183. package/lib/typescript/modules/computer_vision/StyleTransferModule.d.ts.map +1 -1
  184. package/lib/typescript/modules/computer_vision/TextToImageModule.d.ts +29 -0
  185. package/lib/typescript/modules/computer_vision/TextToImageModule.d.ts.map +1 -1
  186. package/lib/typescript/modules/computer_vision/VerticalOCRModule.d.ts +26 -2
  187. package/lib/typescript/modules/computer_vision/VerticalOCRModule.d.ts.map +1 -1
  188. package/lib/typescript/modules/general/ExecutorchModule.d.ts +19 -0
  189. package/lib/typescript/modules/general/ExecutorchModule.d.ts.map +1 -1
  190. package/lib/typescript/modules/natural_language_processing/LLMModule.d.ts +97 -7
  191. package/lib/typescript/modules/natural_language_processing/LLMModule.d.ts.map +1 -1
  192. package/lib/typescript/modules/natural_language_processing/SpeechToTextModule.d.ts +62 -4
  193. package/lib/typescript/modules/natural_language_processing/SpeechToTextModule.d.ts.map +1 -1
  194. package/lib/typescript/modules/natural_language_processing/TextEmbeddingsModule.d.ts +19 -0
  195. package/lib/typescript/modules/natural_language_processing/TextEmbeddingsModule.d.ts.map +1 -1
  196. package/lib/typescript/modules/natural_language_processing/TextToSpeechModule.d.ts +37 -2
  197. package/lib/typescript/modules/natural_language_processing/TextToSpeechModule.d.ts.map +1 -1
  198. package/lib/typescript/modules/natural_language_processing/TokenizerModule.d.ts +47 -2
  199. package/lib/typescript/modules/natural_language_processing/TokenizerModule.d.ts.map +1 -1
  200. package/lib/typescript/modules/natural_language_processing/VADModule.d.ts +18 -0
  201. package/lib/typescript/modules/natural_language_processing/VADModule.d.ts.map +1 -1
  202. package/lib/typescript/types/classification.d.ts +50 -0
  203. package/lib/typescript/types/classification.d.ts.map +1 -0
  204. package/lib/typescript/types/common.d.ts +92 -0
  205. package/lib/typescript/types/common.d.ts.map +1 -1
  206. package/lib/typescript/types/executorchModule.d.ts +45 -0
  207. package/lib/typescript/types/executorchModule.d.ts.map +1 -0
  208. package/lib/typescript/types/imageEmbeddings.d.ts +48 -0
  209. package/lib/typescript/types/imageEmbeddings.d.ts.map +1 -0
  210. package/lib/typescript/types/imageSegmentation.d.ts +55 -0
  211. package/lib/typescript/types/imageSegmentation.d.ts.map +1 -1
  212. package/lib/typescript/types/llm.d.ts +193 -5
  213. package/lib/typescript/types/llm.d.ts.map +1 -1
  214. package/lib/typescript/types/objectDetection.d.ts +71 -2
  215. package/lib/typescript/types/objectDetection.d.ts.map +1 -1
  216. package/lib/typescript/types/ocr.d.ts +97 -2
  217. package/lib/typescript/types/ocr.d.ts.map +1 -1
  218. package/lib/typescript/types/stt.d.ts +114 -0
  219. package/lib/typescript/types/stt.d.ts.map +1 -1
  220. package/lib/typescript/types/styleTransfer.d.ts +48 -0
  221. package/lib/typescript/types/styleTransfer.d.ts.map +1 -0
  222. package/lib/typescript/types/textEmbeddings.d.ts +53 -0
  223. package/lib/typescript/types/textEmbeddings.d.ts.map +1 -0
  224. package/lib/typescript/types/tokenizer.d.ts +75 -0
  225. package/lib/typescript/types/tokenizer.d.ts.map +1 -0
  226. package/lib/typescript/types/tti.d.ts +74 -0
  227. package/lib/typescript/types/tti.d.ts.map +1 -0
  228. package/lib/typescript/types/tts.d.ts +77 -0
  229. package/lib/typescript/types/tts.d.ts.map +1 -1
  230. package/lib/typescript/types/vad.d.ts +53 -0
  231. package/lib/typescript/types/vad.d.ts.map +1 -1
  232. package/lib/typescript/utils/ResourceFetcher.d.ts +55 -0
  233. package/lib/typescript/utils/ResourceFetcher.d.ts.map +1 -1
  234. package/lib/typescript/utils/llm.d.ts +22 -0
  235. package/lib/typescript/utils/llm.d.ts.map +1 -1
  236. package/package.json +1 -1
  237. package/src/constants/llmDefaults.ts +27 -0
  238. package/src/constants/modelUrls.ts +166 -0
  239. package/src/constants/ocr/models.ts +192 -266
  240. package/src/constants/ocr/symbols.ts +3 -0
  241. package/src/constants/tts/models.ts +6 -2
  242. package/src/constants/tts/voices.ts +27 -3
  243. package/src/constants/versions.ts +2 -2
  244. package/src/controllers/LLMController.ts +15 -0
  245. package/src/errors/ErrorCodes.ts +54 -0
  246. package/src/errors/errorUtils.ts +37 -17
  247. package/src/hooks/computer_vision/useClassification.ts +15 -7
  248. package/src/hooks/computer_vision/useImageEmbeddings.ts +15 -7
  249. package/src/hooks/computer_vision/useImageSegmentation.ts +15 -7
  250. package/src/hooks/computer_vision/useOCR.ts +9 -21
  251. package/src/hooks/computer_vision/useObjectDetection.ts +15 -7
  252. package/src/hooks/computer_vision/useStyleTransfer.ts +15 -7
  253. package/src/hooks/computer_vision/useTextToImage.ts +9 -26
  254. package/src/hooks/computer_vision/useVerticalOCR.ts +9 -19
  255. package/src/hooks/general/useExecutorchModule.ts +12 -7
  256. package/src/hooks/natural_language_processing/useLLM.ts +24 -28
  257. package/src/hooks/natural_language_processing/useSpeechToText.ts +13 -5
  258. package/src/hooks/natural_language_processing/useTextEmbeddings.ts +15 -10
  259. package/src/hooks/natural_language_processing/useTextToSpeech.ts +10 -6
  260. package/src/hooks/natural_language_processing/useTokenizer.ts +10 -6
  261. package/src/hooks/natural_language_processing/useVAD.ts +9 -7
  262. package/src/hooks/useModule.ts +15 -0
  263. package/src/index.ts +10 -5
  264. package/src/modules/BaseModule.ts +20 -0
  265. package/src/modules/computer_vision/ClassificationModule.ts +19 -1
  266. package/src/modules/computer_vision/ImageEmbeddingsModule.ts +17 -0
  267. package/src/modules/computer_vision/ImageSegmentationModule.ts +21 -1
  268. package/src/modules/computer_vision/OCRModule.ts +25 -2
  269. package/src/modules/computer_vision/ObjectDetectionModule.ts +20 -0
  270. package/src/modules/computer_vision/StyleTransferModule.ts +18 -0
  271. package/src/modules/computer_vision/TextToImageModule.ts +29 -0
  272. package/src/modules/computer_vision/VerticalOCRModule.ts +26 -2
  273. package/src/modules/general/ExecutorchModule.ts +19 -0
  274. package/src/modules/natural_language_processing/LLMModule.ts +104 -18
  275. package/src/modules/natural_language_processing/SpeechToTextModule.ts +63 -39
  276. package/src/modules/natural_language_processing/TextEmbeddingsModule.ts +19 -0
  277. package/src/modules/natural_language_processing/TextToSpeechModule.ts +43 -2
  278. package/src/modules/natural_language_processing/TokenizerModule.ts +51 -3
  279. package/src/modules/natural_language_processing/VADModule.ts +18 -0
  280. package/src/types/classification.ts +51 -0
  281. package/src/types/common.ts +93 -0
  282. package/src/types/executorchModule.ts +50 -0
  283. package/src/types/imageEmbeddings.ts +51 -0
  284. package/src/types/imageSegmentation.ts +64 -1
  285. package/src/types/llm.ts +208 -11
  286. package/src/types/objectDetection.ts +79 -1
  287. package/src/types/ocr.ts +107 -2
  288. package/src/types/stt.ts +136 -1
  289. package/src/types/styleTransfer.ts +51 -0
  290. package/src/types/textEmbeddings.ts +58 -0
  291. package/src/types/tokenizer.ts +86 -0
  292. package/src/types/tti.ts +87 -0
  293. package/src/types/tts.ts +85 -2
  294. package/src/types/vad.ts +58 -0
  295. package/src/utils/ResourceFetcher.ts +55 -0
  296. package/src/utils/llm.ts +22 -1
@@ -0,0 +1,45 @@
1
+ import { ResourceSource, TensorPtr } from '../types/common';
2
+ import { RnExecutorchError } from '../errors/errorUtils';
3
+ /**
4
+ * Props for the `useExecutorchModule` hook.
5
+ *
6
+ * @category Types
7
+ * @property {ResourceSource} modelSource - The source of the ExecuTorch model binary.
8
+ * @property {boolean} [preventLoad] - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
9
+ */
10
+ export interface ExecutorchModuleProps {
11
+ modelSource: ResourceSource;
12
+ preventLoad?: boolean;
13
+ }
14
+ /**
15
+ * Return type for the `useExecutorchModule` hook.
16
+ * Manages the state and core execution methods for a general ExecuTorch model.
17
+ *
18
+ * @category Types
19
+ */
20
+ export interface ExecutorchModuleType {
21
+ /**
22
+ * Contains the error object if the model failed to load, download, or encountered a runtime error.
23
+ */
24
+ error: RnExecutorchError | null;
25
+ /**
26
+ * Indicates whether the ExecuTorch model binary has successfully loaded into memory and is ready for inference.
27
+ */
28
+ isReady: boolean;
29
+ /**
30
+ * Indicates whether the model is currently processing a forward pass.
31
+ */
32
+ isGenerating: boolean;
33
+ /**
34
+ * Represents the download progress of the model binary as a value between 0 and 1.
35
+ */
36
+ downloadProgress: number;
37
+ /**
38
+ * Executes the model's forward pass with the provided input tensors.
39
+ * @param inputTensor - An array of `TensorPtr` objects representing the input tensors required by the model.
40
+ * @returns A Promise that resolves to an array of output `TensorPtr` objects resulting from the model's inference.
41
+ * @throws {RnExecutorchError} If the model is not loaded or is currently processing another request.
42
+ */
43
+ forward: (inputTensor: TensorPtr[]) => Promise<TensorPtr[]>;
44
+ }
45
+ //# sourceMappingURL=executorchModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executorchModule.d.ts","sourceRoot":"","sources":["../../../src/types/executorchModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,cAAc,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,OAAO,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;CAC7D"}
@@ -0,0 +1,48 @@
1
+ import { RnExecutorchError } from '../errors/errorUtils';
2
+ import { ResourceSource } from './common';
3
+ /**
4
+ * Props for the `useImageEmbeddings` hook.
5
+ *
6
+ * @category Types
7
+ * @property {Object} model - An object containing the model source.
8
+ * @property {ResourceSource} model.modelSource - The source of the image embeddings model binary.
9
+ * @property {boolean} [preventLoad] - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
10
+ */
11
+ export interface ImageEmbeddingsProps {
12
+ model: {
13
+ modelSource: ResourceSource;
14
+ };
15
+ preventLoad?: boolean;
16
+ }
17
+ /**
18
+ * Return type for the `useImageEmbeddings` hook.
19
+ * Manages the state and operations for generating image embeddings (feature vectors) used in Computer Vision tasks.
20
+ *
21
+ * @category Types
22
+ */
23
+ export interface ImageEmbeddingsType {
24
+ /**
25
+ * Contains the error object if the model failed to load, download, or encountered a runtime error during embedding generation.
26
+ */
27
+ error: RnExecutorchError | null;
28
+ /**
29
+ * Indicates whether the image embeddings model is loaded and ready to process images.
30
+ */
31
+ isReady: boolean;
32
+ /**
33
+ * Indicates whether the model is currently generating embeddings for an image.
34
+ */
35
+ isGenerating: boolean;
36
+ /**
37
+ * Represents the download progress of the model binary as a value between 0 and 1.
38
+ */
39
+ downloadProgress: number;
40
+ /**
41
+ * Executes the model's forward pass to generate embeddings (a feature vector) for the provided image.
42
+ * @param imageSource - A string representing the image source (e.g., a file path, URI, or base64 string) to be processed.
43
+ * @returns A Promise that resolves to a `Float32Array` containing the generated embedding vector.
44
+ * @throws {RnExecutorchError} If the model is not loaded or is currently processing another image.
45
+ */
46
+ forward: (imageSource: string) => Promise<Float32Array>;
47
+ }
48
+ //# sourceMappingURL=imageEmbeddings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imageEmbeddings.d.ts","sourceRoot":"","sources":["../../../src/types/imageEmbeddings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE;QAAE,WAAW,EAAE,cAAc,CAAA;KAAE,CAAC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CACzD"}
@@ -1,3 +1,10 @@
1
+ import { RnExecutorchError } from '../errors/errorUtils';
2
+ import { ResourceSource } from './common';
3
+ /**
4
+ * Labels used in the DeepLab image segmentation model.
5
+ *
6
+ * @category Types
7
+ */
1
8
  export declare enum DeeplabLabel {
2
9
  BACKGROUND = 0,
3
10
  AEROPLANE = 1,
@@ -22,4 +29,52 @@ export declare enum DeeplabLabel {
22
29
  TVMONITOR = 20,
23
30
  ARGMAX = 21
24
31
  }
32
+ /**
33
+ * Props for the `useImageSegmentation` hook.
34
+ *
35
+ * @property {Object} model - An object containing the model source.
36
+ * @property {ResourceSource} model.modelSource - The source of the image segmentation model binary.
37
+ * @property {boolean} [preventLoad] - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
38
+ *
39
+ * @category Types
40
+ */
41
+ export interface ImageSegmentationProps {
42
+ model: {
43
+ modelSource: ResourceSource;
44
+ };
45
+ preventLoad?: boolean;
46
+ }
47
+ /**
48
+ * Return type for the `useImageSegmentation` hook.
49
+ * Manages the state and operations for Computer Vision image segmentation (e.g., DeepLab).
50
+ *
51
+ * @category Types
52
+ */
53
+ export interface ImageSegmentationType {
54
+ /**
55
+ * Contains the error object if the model failed to load, download, or encountered a runtime error during segmentation.
56
+ */
57
+ error: RnExecutorchError | null;
58
+ /**
59
+ * Indicates whether the segmentation model is loaded and ready to process images.
60
+ */
61
+ isReady: boolean;
62
+ /**
63
+ * Indicates whether the model is currently processing an image.
64
+ */
65
+ isGenerating: boolean;
66
+ /**
67
+ * Represents the download progress of the model binary as a value between 0 and 1.
68
+ */
69
+ downloadProgress: number;
70
+ /**
71
+ * Executes the model's forward pass to perform semantic segmentation on the provided image.
72
+ * @param imageSource - A string representing the image source (e.g., a file path, URI, or base64 string) to be processed.
73
+ * @param classesOfInterest - An optional array of `DeeplabLabel` enums. If provided, the model will only return segmentation masks for these specific classes.
74
+ * @param resize - An optional boolean indicating whether the output segmentation masks should be resized to match the original image dimensions. Defaults to standard model behavior if undefined.
75
+ * @returns A Promise that resolves to an object mapping each detected `DeeplabLabel` to its corresponding segmentation mask (represented as a flattened array of numbers).
76
+ * @throws {RnExecutorchError} If the model is not loaded or is currently processing another image.
77
+ */
78
+ forward: (imageSource: string, classesOfInterest?: DeeplabLabel[], resize?: boolean) => Promise<Partial<Record<DeeplabLabel, number[]>>>;
79
+ }
25
80
  //# sourceMappingURL=imageSegmentation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"imageSegmentation.d.ts","sourceRoot":"","sources":["../../../src/types/imageSegmentation.ts"],"names":[],"mappings":"AACA,oBAAY,YAAY;IACtB,UAAU,IAAA;IACV,SAAS,IAAA;IACT,OAAO,IAAA;IACP,IAAI,IAAA;IACJ,IAAI,IAAA;IACJ,MAAM,IAAA;IACN,GAAG,IAAA;IACH,GAAG,IAAA;IACH,GAAG,IAAA;IACH,KAAK,IAAA;IACL,GAAG,KAAA;IACH,WAAW,KAAA;IACX,GAAG,KAAA;IACH,KAAK,KAAA;IACL,SAAS,KAAA;IACT,MAAM,KAAA;IACN,WAAW,KAAA;IACX,KAAK,KAAA;IACL,IAAI,KAAA;IACJ,KAAK,KAAA;IACL,SAAS,KAAA;IACT,MAAM,KAAA;CACP"}
1
+ {"version":3,"file":"imageSegmentation.d.ts","sourceRoot":"","sources":["../../../src/types/imageSegmentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;GAIG;AACH,oBAAY,YAAY;IACtB,UAAU,IAAA;IACV,SAAS,IAAA;IACT,OAAO,IAAA;IACP,IAAI,IAAA;IACJ,IAAI,IAAA;IACJ,MAAM,IAAA;IACN,GAAG,IAAA;IACH,GAAG,IAAA;IACH,GAAG,IAAA;IACH,KAAK,IAAA;IACL,GAAG,KAAA;IACH,WAAW,KAAA;IACX,GAAG,KAAA;IACH,KAAK,KAAA;IACL,SAAS,KAAA;IACT,MAAM,KAAA;IACN,WAAW,KAAA;IACX,KAAK,KAAA;IACL,IAAI,KAAA;IACJ,KAAK,KAAA;IACL,SAAS,KAAA;IACT,MAAM,KAAA;CACP;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE;QAAE,WAAW,EAAE,cAAc,CAAA;KAAE,CAAC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;;;;;OAOG;IACH,OAAO,EAAE,CACP,WAAW,EAAE,MAAM,EACnB,iBAAiB,CAAC,EAAE,YAAY,EAAE,EAClC,MAAM,CAAC,EAAE,OAAO,KACb,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;CACvD"}
@@ -1,49 +1,237 @@
1
1
  import { RnExecutorchError } from '../errors/errorUtils';
2
+ import { ResourceSource } from './common';
3
+ /**
4
+ * Properties for initializing and configuring a Large Language Model (LLM) instance.
5
+ *
6
+ * @category Types
7
+ */
8
+ export interface LLMProps {
9
+ model: {
10
+ /**
11
+ * `ResourceSource` that specifies the location of the model binary.
12
+ */
13
+ modelSource: ResourceSource;
14
+ /**
15
+ * `ResourceSource` pointing to the JSON file which contains the tokenizer.
16
+ */
17
+ tokenizerSource: ResourceSource;
18
+ /**
19
+ * `ResourceSource` pointing to the JSON file which contains the tokenizer config.
20
+ */
21
+ tokenizerConfigSource?: ResourceSource;
22
+ };
23
+ /**
24
+ * Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
25
+ */
26
+ preventLoad?: boolean;
27
+ }
28
+ /**
29
+ * React hook for managing a Large Language Model (LLM) instance.
30
+ *
31
+ * @category Types
32
+ */
2
33
  export interface LLMType {
34
+ /**
35
+ * History containing all messages in conversation. This field is updated after model responds to sendMessage.
36
+ */
3
37
  messageHistory: Message[];
38
+ /**
39
+ * State of the generated response. This field is updated with each token generated by the model.
40
+ */
4
41
  response: string;
42
+ /**
43
+ * The most recently generated token.
44
+ */
5
45
  token: string;
46
+ /**
47
+ * Indicates whether the model is ready.
48
+ */
6
49
  isReady: boolean;
50
+ /**
51
+ * Indicates whether the model is currently generating a response.
52
+ */
7
53
  isGenerating: boolean;
54
+ /**
55
+ * Represents the download progress as a value between 0 and 1, indicating the extent of the model file retrieval.
56
+ */
8
57
  downloadProgress: number;
58
+ /**
59
+ * Contains the error message if the model failed to load.
60
+ */
9
61
  error: RnExecutorchError | null;
10
- configure: ({ chatConfig, toolsConfig, generationConfig, }: {
11
- chatConfig?: Partial<ChatConfig>;
12
- toolsConfig?: ToolsConfig;
13
- generationConfig?: GenerationConfig;
14
- }) => void;
62
+ /**
63
+ * Configures chat and tool calling.
64
+ * See [Configuring the model](https://docs.swmansion.com/react-native-executorch/docs/hooks/natural-language-processing/useLLM#configuring-the-model) for details.
65
+ *
66
+ * @param {LLMConfig} configuration - Configuration object containing `chatConfig`, `toolsConfig`, and `generationConfig`.
67
+ */
68
+ configure: ({ chatConfig, toolsConfig, generationConfig }: LLMConfig) => void;
69
+ /**
70
+ * Returns the number of tokens generated so far in the current generation.
71
+ *
72
+ * @returns The count of generated tokens.
73
+ */
15
74
  getGeneratedTokenCount: () => number;
75
+ /**
76
+ * Runs model to complete chat passed in `messages` argument. It doesn't manage conversation context.
77
+ *
78
+ * @param messages - Array of messages representing the chat history.
79
+ * @param tools - Optional array of tools that can be used during generation.
80
+ * @returns The generated tokens as `string`.
81
+ */
16
82
  generate: (messages: Message[], tools?: LLMTool[]) => Promise<string>;
83
+ /**
84
+ * Returns the number of total tokens from the previous generation.This is a sum of prompt tokens and generated tokens.
85
+ *
86
+ * @returns The count of prompt and generated tokens.
87
+ */
88
+ getTotalTokenCount: () => number;
89
+ /**
90
+ * Returns the number of prompt tokens in the last message.
91
+ *
92
+ * @returns The count of prompt token.
93
+ */
94
+ getPromptTokenCount: () => number;
95
+ /**
96
+ * Function to add user message to conversation.
97
+ * After model responds, `messageHistory` will be updated with both user message and model response.
98
+ *
99
+ * @param message - The message string to send.
100
+ * @returns The model's response as a `string`.
101
+ */
17
102
  sendMessage: (message: string) => Promise<string>;
103
+ /**
104
+ * Deletes all messages starting with message on `index` position. After deletion `messageHistory` will be updated.
105
+ *
106
+ * @param index - The index of the message to delete from history.
107
+ */
18
108
  deleteMessage: (index: number) => void;
109
+ /**
110
+ * Function to interrupt the current inference.
111
+ */
19
112
  interrupt: () => void;
20
113
  }
114
+ /**
115
+ * Configuration object for initializing and customizing a Large Language Model (LLM) instance.
116
+ *
117
+ * @category Types
118
+ */
119
+ export interface LLMConfig {
120
+ /**
121
+ * Object configuring chat management, contains following properties:
122
+ *
123
+ * `systemPrompt` - Often used to tell the model what is its purpose, for example - "Be a helpful translator".
124
+ *
125
+ * `initialMessageHistory` - An array of `Message` objects that represent the conversation history. This can be used to provide initial context to the model.
126
+ *
127
+ * `contextWindowLength` - The number of messages from the current conversation that the model will use to generate a response. The higher the number, the more context the model will have. Keep in mind that using larger context windows will result in longer inference time and higher memory usage.
128
+ */
129
+ chatConfig?: Partial<ChatConfig>;
130
+ /**
131
+ * Object configuring options for enabling and managing tool use. **It will only have effect if your model's chat template support it**. Contains following properties:
132
+ *
133
+ * `tools` - List of objects defining tools.
134
+ *
135
+ * `executeToolCallback` - Function that accepts `ToolCall`, executes tool and returns the string to model.
136
+ *
137
+ * `displayToolCalls` - If set to true, JSON tool calls will be displayed in chat. If false, only answers will be displayed.
138
+ */
139
+ toolsConfig?: ToolsConfig;
140
+ /**
141
+ * Object configuring generation settings.
142
+ *
143
+ * `outputTokenBatchSize` - Soft upper limit on the number of tokens in each token batch (in certain cases there can be more tokens in given batch, i.e. when the batch would end with special emoji join character).
144
+ *
145
+ * `batchTimeInterval` - Upper limit on the time interval between consecutive token batches.
146
+ *
147
+ * `temperature` - Scales output logits by the inverse of temperature. Controls the randomness / creativity of text generation.
148
+ *
149
+ * `topp` - Only samples from the smallest set of tokens whose cumulative probability exceeds topp.
150
+ */
151
+ generationConfig?: GenerationConfig;
152
+ }
153
+ /**
154
+ * Roles that a message sender can have.
155
+ *
156
+ * @category Types
157
+ */
21
158
  export type MessageRole = 'user' | 'assistant' | 'system';
159
+ /**
160
+ * Represents a message in the conversation.
161
+ *
162
+ * @category Types
163
+ * @property {MessageRole} role - Role of the message sender of type `MessageRole`.
164
+ * @property {string} content - Content of the message.
165
+ */
22
166
  export interface Message {
23
167
  role: MessageRole;
24
168
  content: string;
25
169
  }
170
+ /**
171
+ * Represents a tool call made by the model.
172
+ *
173
+ * @category Types
174
+ * @property {string} toolName - The name of the tool being called.
175
+ * @property {Object} arguments - The arguments passed to the tool.
176
+ */
26
177
  export interface ToolCall {
27
178
  toolName: string;
28
179
  arguments: Object;
29
180
  }
181
+ /**
182
+ * Represents a tool that can be used by the model.
183
+ * Usually tool is represented with dictionary (Object), but fields depend on the model.
184
+ * Unfortunately there's no one standard so it's hard to type it better.
185
+ *
186
+ * @category Types
187
+ */
30
188
  export type LLMTool = Object;
189
+ /**
190
+ * Object configuring chat management.
191
+ *
192
+ * @category Types
193
+ * @property {Message[]} initialMessageHistory - An array of `Message` objects that represent the conversation history. This can be used to provide initial context to the model.
194
+ * @property {number} contextWindowLength - The number of messages from the current conversation that the model will use to generate a response. The higher the number, the more context the model will have. Keep in mind that using larger context windows will result in longer inference time and higher memory usage.
195
+ * @property {string} systemPrompt - Often used to tell the model what is its purpose, for example - "Be a helpful translator".
196
+ */
31
197
  export interface ChatConfig {
32
198
  initialMessageHistory: Message[];
33
199
  contextWindowLength: number;
34
200
  systemPrompt: string;
35
201
  }
202
+ /**
203
+ * Object configuring options for enabling and managing tool use. **It will only have effect if your model's chat template support it**.
204
+ *
205
+ * @category Types
206
+ * @property {LLMTool[]} tools - List of objects defining tools.
207
+ * @property {(call: ToolCall) => Promise<string | null>} executeToolCallback - Function that accepts `ToolCall`, executes tool and returns the string to model.
208
+ * @property {boolean} [displayToolCalls] - If set to true, JSON tool calls will be displayed in chat. If false, only answers will be displayed.
209
+ */
36
210
  export interface ToolsConfig {
37
211
  tools: LLMTool[];
38
212
  executeToolCallback: (call: ToolCall) => Promise<string | null>;
39
213
  displayToolCalls?: boolean;
40
214
  }
215
+ /**
216
+ * Object configuring generation settings.
217
+ *
218
+ * @category Types
219
+ * @property {number} [temperature] - Scales output logits by the inverse of temperature. Controls the randomness / creativity of text generation.
220
+ * @property {number} [topp] - Only samples from the smallest set of tokens whose cumulative probability exceeds topp.
221
+ * @property {number} [outputTokenBatchSize] - Soft upper limit on the number of tokens in each token batch (in certain cases there can be more tokens in given batch, i.e. when the batch would end with special emoji join character).
222
+ * @property {number} [batchTimeInterval] - Upper limit on the time interval between consecutive token batches.
223
+ */
41
224
  export interface GenerationConfig {
42
225
  temperature?: number;
43
226
  topp?: number;
44
227
  outputTokenBatchSize?: number;
45
228
  batchTimeInterval?: number;
46
229
  }
230
+ /**
231
+ * Special tokens used in Large Language Models (LLMs).
232
+ *
233
+ * @category Types
234
+ */
47
235
  export declare const SPECIAL_TOKENS: {
48
236
  BOS_TOKEN: string;
49
237
  EOS_TOKEN: string;
@@ -1 +1 @@
1
- {"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../../../src/types/llm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,OAAO;IACtB,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAChC,SAAS,EAAE,CAAC,EACV,UAAU,EACV,WAAW,EACX,gBAAgB,GACjB,EAAE;QACD,UAAU,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QACjC,WAAW,CAAC,EAAE,WAAW,CAAC;QAC1B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;KACrC,KAAK,IAAI,CAAC;IACX,sBAAsB,EAAE,MAAM,MAAM,CAAC;IACrC,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACtE,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAClD,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE1D,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB,Q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,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,qBAAqB,EAAE,OAAO,EAAE,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,mBAAmB,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAChE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;CAQ1B,CAAC"}
@@ -1,15 +1,39 @@
1
+ import { RnExecutorchError } from '../errors/errorUtils';
2
+ import { ResourceSource } from './common';
3
+ /**
4
+ * Represents a bounding box for a detected object in an image.
5
+ *
6
+ * @category Types
7
+ * @property {number} x1 - The x-coordinate of the bottom-left corner of the bounding box.
8
+ * @property {number} y1 - The y-coordinate of the bottom-left corner of the bounding box.
9
+ * @property {number} x2 - The x-coordinate of the top-right corner of the bounding box.
10
+ * @property {number} y2 - The y-coordinate of the top-right corner of the bounding box.
11
+ */
1
12
  export interface Bbox {
2
13
  x1: number;
3
14
  x2: number;
4
15
  y1: number;
5
16
  y2: number;
6
17
  }
18
+ /**
19
+ * Represents a detected object within an image, including its bounding box, label, and confidence score.
20
+ *
21
+ * @category Types
22
+ * @property {Bbox} bbox - The bounding box of the detected object, defined by its top-left (x1, y1) and bottom-right (x2, y2) coordinates.
23
+ * @property {keyof typeof CocoLabel} label - The class label of the detected object, represented as a key from the `CocoLabel` enum.
24
+ * @property {number} score - The confidence score of the detection, typically ranging from 0 to 1.
25
+ */
7
26
  export interface Detection {
8
27
  bbox: Bbox;
9
28
  label: keyof typeof CocoLabel;
10
29
  score: number;
11
30
  }
12
- declare enum CocoLabel {
31
+ /**
32
+ * COCO dataset class labels used for object detection.
33
+ *
34
+ * @category Types
35
+ */
36
+ export declare enum CocoLabel {
13
37
  PERSON = 1,
14
38
  BICYCLE = 2,
15
39
  CAR = 3,
@@ -101,5 +125,50 @@ declare enum CocoLabel {
101
125
  TOOTHBRUSH = 90,
102
126
  HAIR_BRUSH = 91
103
127
  }
104
- export {};
128
+ /**
129
+ * Props for the `useObjectDetection` hook.
130
+ *
131
+ * @category Types
132
+ * @property {Object} model - An object containing the model source.
133
+ * @property {ResourceSource} model.modelSource - The source of the object detection model binary.
134
+ * @property {boolean} [preventLoad] - Boolean that can prevent automatic model loading (and downloading the data if you load it for the first time) after running the hook.
135
+ */
136
+ export interface ObjectDetectionProps {
137
+ model: {
138
+ modelSource: ResourceSource;
139
+ };
140
+ preventLoad?: boolean;
141
+ }
142
+ /**
143
+ * Return type for the `useObjectDetection` hook.
144
+ * Manages the state and operations for Computer Vision object detection tasks.
145
+ *
146
+ * @category Types
147
+ */
148
+ export interface ObjectDetectionType {
149
+ /**
150
+ * Contains the error object if the model failed to load, download, or encountered a runtime error during detection.
151
+ */
152
+ error: RnExecutorchError | null;
153
+ /**
154
+ * Indicates whether the object detection model is loaded and ready to process images.
155
+ */
156
+ isReady: boolean;
157
+ /**
158
+ * Indicates whether the model is currently processing an image.
159
+ */
160
+ isGenerating: boolean;
161
+ /**
162
+ * Represents the download progress of the model binary as a value between 0 and 1.
163
+ */
164
+ downloadProgress: number;
165
+ /**
166
+ * Executes the model's forward pass to detect objects within the provided image.
167
+ * @param imageSource - A string representing the image source (e.g., a file path, URI, or base64 string) to be processed.
168
+ * @param detectionThreshold - An optional number between 0 and 1 representing the minimum confidence score required for an object to be included in the results. Default is 0.7.
169
+ * @returns A Promise that resolves to an array of `Detection` objects, where each object typically contains bounding box coordinates, a class label, and a confidence score.
170
+ * @throws {RnExecutorchError} If the model is not loaded or is currently processing another image.
171
+ */
172
+ forward: (imageSource: string, detectionThreshold?: number) => Promise<Detection[]>;
173
+ }
105
174
  //# sourceMappingURL=objectDetection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"objectDetection.d.ts","sourceRoot":"","sources":["../../../src/types/objectDetection.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,OAAO,SAAS,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,aAAK,SAAS;IACZ,MAAM,IAAI;IACV,OAAO,IAAI;IACX,GAAG,IAAI;IACP,UAAU,IAAI;IACd,QAAQ,IAAI;IACZ,GAAG,IAAI;IACP,KAAK,IAAI;IACT,KAAK,IAAI;IACT,IAAI,IAAI;IACR,aAAa,KAAK;IAClB,YAAY,KAAK;IACjB,WAAW,KAAK;IAChB,SAAS,KAAK;IACd,OAAO,KAAK;IACZ,KAAK,KAAK;IACV,IAAI,KAAK;IACT,GAAG,KAAK;IACR,GAAG,KAAK;IACR,KAAK,KAAK;IACV,KAAK,KAAK;IACV,GAAG,KAAK;IACR,QAAQ,KAAK;IACb,IAAI,KAAK;IACT,KAAK,KAAK;IACV,OAAO,KAAK;IACZ,GAAG,KAAK;IACR,QAAQ,KAAK;IACb,QAAQ,KAAK;IACb,IAAI,KAAK;IACT,GAAG,KAAK;IACR,OAAO,KAAK;IACZ,GAAG,KAAK;IACR,QAAQ,KAAK;IACb,OAAO,KAAK;IACZ,IAAI,KAAK;IACT,SAAS,KAAK;IACd,MAAM,KAAK;IACX,IAAI,KAAK;IACT,QAAQ,KAAK;IACb,UAAU,KAAK;IACf,SAAS,KAAK;IACd,aAAa,KAAK;IAClB,MAAM,KAAK;IACX,KAAK,KAAK;IACV,UAAU,KAAK;IACf,GAAG,KAAK;IACR,IAAI,KAAK;IACT,KAAK,KAAK;IACV,KAAK,KAAK;IACV,IAAI,KAAK;IACT,MAAM,KAAK;IACX,KAAK,KAAK;IACV,QAAQ,KAAK;IACb,MAAM,KAAK;IACX,QAAQ,KAAK;IACb,MAAM,KAAK;IACX,OAAO,KAAK;IACZ,KAAK,KAAK;IACV,KAAK,KAAK;IACV,IAAI,KAAK;IACT,KAAK,KAAK;IACV,KAAK,KAAK;IACV,YAAY,KAAK;IACjB,GAAG,KAAK;IACR,MAAM,KAAK;IACX,YAAY,KAAK;IACjB,MAAM,KAAK;IACX,IAAI,KAAK;IACT,MAAM,KAAK;IACX,IAAI,KAAK;IACT,EAAE,KAAK;IACP,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,KAAK;IACX,QAAQ,KAAK;IACb,UAAU,KAAK;IACf,SAAS,KAAK;IACd,IAAI,KAAK;IACT,OAAO,KAAK;IACZ,IAAI,KAAK;IACT,YAAY,KAAK;IACjB,OAAO,KAAK;IACZ,IAAI,KAAK;IACT,KAAK,KAAK;IACV,IAAI,KAAK;IACT,QAAQ,KAAK;IACb,UAAU,KAAK;IACf,UAAU,KAAK;IACf,UAAU,KAAK;IACf,UAAU,KAAK;CAChB"}
1
+ {"version":3,"file":"objectDetection.d.ts","sourceRoot":"","sources":["../../../src/types/objectDetection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA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AAE,CAAC,CAAC;CAC3B"}
@@ -1,12 +1,107 @@
1
1
  import { symbols } from '../constants/ocr/symbols';
2
+ import { RnExecutorchError } from '../errors/errorUtils';
3
+ import { ResourceSource } from './common';
4
+ /**
5
+ * OCRDetection represents a single detected text instance in an image,
6
+ * including its bounding box, recognized text, and confidence score.
7
+ *
8
+ * @category Types
9
+ * @property {Point[]} bbox - An array of points defining the bounding box around the detected text.
10
+ * @property {string} text - The recognized text within the bounding box.
11
+ * @property {number} score - The confidence score of the OCR detection, ranging from 0 to 1.
12
+ */
2
13
  export interface OCRDetection {
3
- bbox: OCRBbox[];
14
+ bbox: Point[];
4
15
  text: string;
5
16
  score: number;
6
17
  }
7
- export interface OCRBbox {
18
+ /**
19
+ * Point represents a coordinate in 2D space.
20
+ *
21
+ * @category Types
22
+ * @property {number} x - The x-coordinate of the point.
23
+ * @property {number} y - The y-coordinate of the point.
24
+ */
25
+ export interface Point {
8
26
  x: number;
9
27
  y: number;
10
28
  }
29
+ /**
30
+ * Configuration properties for the `useOCR` hook.
31
+ *
32
+ * @category Types
33
+ */
34
+ export interface OCRProps {
35
+ /**
36
+ * Object containing the necessary model sources and configuration for the OCR pipeline.
37
+ */
38
+ model: {
39
+ /**
40
+ * `ResourceSource` that specifies the location of the text detector model binary.
41
+ */
42
+ detectorSource: ResourceSource;
43
+ /**
44
+ * `ResourceSource` that specifies the location of the text recognizer model binary.
45
+ */
46
+ recognizerSource: ResourceSource;
47
+ /**
48
+ * The language configuration enum for the OCR model (e.g., English, Polish, etc.).
49
+ */
50
+ language: OCRLanguage;
51
+ };
52
+ /**
53
+ * Boolean that can prevent automatic model loading (and downloading the data if loaded for the first time) after running the hook.
54
+ * Defaults to `false`.
55
+ */
56
+ preventLoad?: boolean;
57
+ }
58
+ /**
59
+ * Configuration properties for the `useVerticalOCR` hook.
60
+ *
61
+ * @category Types
62
+ */
63
+ export interface VerticalOCRProps extends OCRProps {
64
+ /**
65
+ * Boolean indicating whether to treat each character independently during recognition.
66
+ * Defaults to `false`.
67
+ */
68
+ independentCharacters?: boolean;
69
+ }
70
+ /**
71
+ * Return type for the `useOCR` hook.
72
+ * Manages the state and operations for Optical Character Recognition (OCR).
73
+ *
74
+ * @category Types
75
+ */
76
+ export interface OCRType {
77
+ /**
78
+ * Contains the error object if the models failed to load, download, or encountered a runtime error during recognition.
79
+ */
80
+ error: RnExecutorchError | null;
81
+ /**
82
+ * Indicates whether both detector and recognizer models are loaded and ready to process images.
83
+ */
84
+ isReady: boolean;
85
+ /**
86
+ * Indicates whether the model is currently processing an image.
87
+ */
88
+ isGenerating: boolean;
89
+ /**
90
+ * Represents the total download progress of the model binaries as a value between 0 and 1.
91
+ */
92
+ downloadProgress: number;
93
+ /**
94
+ * Executes the OCR pipeline (detection and recognition) on the provided image.
95
+ * @param imageSource - A string representing the image source (e.g., a file path, URI, or base64 string) to be processed.
96
+ * @returns A Promise that resolves to the OCR results (typically containing the recognized text strings and their bounding boxes).
97
+ * @throws {RnExecutorchError} If the models are not loaded or are currently processing another image.
98
+ */
99
+ forward: (imageSource: string) => Promise<OCRDetection[]>;
100
+ }
101
+ /**
102
+ * Enumeration of supported OCR languages based on available symbol sets.
103
+ *
104
+ * @category Types
105
+ */
11
106
  export type OCRLanguage = keyof typeof symbols;
12
107
  //# sourceMappingURL=ocr.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ocr.d.ts","sourceRoot":"","sources":["../../../src/types/ocr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,OAAO;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,OAAO,CAAC"}
1
+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