From 1e5c6eb9e039c4e5761f3a8b9a0f68ed0ad772bf Mon Sep 17 00:00:00 2001 From: jakmro Date: Tue, 18 Feb 2025 17:06:11 +0100 Subject: [PATCH 1/2] Add list-downloaded-resources docs --- docs/docs/hookless-api/_category_.json | 2 +- docs/docs/module-api/_category_.json | 2 +- docs/docs/utils/_category_.json | 7 ++++ docs/docs/utils/list-downloaded-resources.md | 43 ++++++++++++++++++++ 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 docs/docs/utils/_category_.json create mode 100644 docs/docs/utils/list-downloaded-resources.md diff --git a/docs/docs/hookless-api/_category_.json b/docs/docs/hookless-api/_category_.json index 6c0a89084f..da9d655f2a 100644 --- a/docs/docs/hookless-api/_category_.json +++ b/docs/docs/hookless-api/_category_.json @@ -1,6 +1,6 @@ { "label": "Hookless API", - "position": 5, + "position": 7, "link": { "type": "generated-index" } diff --git a/docs/docs/module-api/_category_.json b/docs/docs/module-api/_category_.json index 0a152175c4..8cc82679ce 100644 --- a/docs/docs/module-api/_category_.json +++ b/docs/docs/module-api/_category_.json @@ -1,6 +1,6 @@ { "label": "Module API", - "position": 4, + "position": 6, "link": { "type": "generated-index" } diff --git a/docs/docs/utils/_category_.json b/docs/docs/utils/_category_.json new file mode 100644 index 0000000000..1a2a274306 --- /dev/null +++ b/docs/docs/utils/_category_.json @@ -0,0 +1,7 @@ +{ + "label": "Utils", + "position": 4, + "link": { + "type": "generated-index" + } +} diff --git a/docs/docs/utils/list-downloaded-resources.md b/docs/docs/utils/list-downloaded-resources.md new file mode 100644 index 0000000000..dd718255b9 --- /dev/null +++ b/docs/docs/utils/list-downloaded-resources.md @@ -0,0 +1,43 @@ +--- +title: List Downloaded Resources +sidebar_position: 1 +--- + +This module provides functions to retrieve a list of downloaded files stored in the application's document directory inside the `react-native-executorch/` directory. These utilities can help you manage your storage and clean up the downloaded files when they are no longer needed. + +## listDownloadedFiles + +Lists all the downloaded files used by React Native ExecuTorch. + +### Reference + +```typescript +import { listDownloadedFiles } from 'react-native-executorch'; + +const filesUris = await listDownloadedFiles(); +``` + +### Returns + +`Promise` - A promise, which resolves to an array of URIs for all the downloaded files. + +:::info +Since this function returns all the downloaded files, it also includes all the downloaded models. +If you want to list only the downloaded models, use the [listDownloadedModels](./list-downloaded-resources.md#listdownloadedmodels) function. +::: + +## listDownloadedModels + +Lists all the downloaded models used by React Native ExecuTorch. + +### Reference + +```typescript +import { listDownloadedModels } from 'react-native-executorch'; + +const modelsUris = await listDownloadedModels(); +``` + +### Returns + +`Promise` - A promise, which resolves to an array of URIs for all the downloaded models. From df6cd35235e579111808eddc6540db1f0fe7b0e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kopci=C5=84ski?= Date: Fri, 21 Feb 2025 14:54:35 +0100 Subject: [PATCH 2/2] Reordered sidebar --- docs/docs/benchmarks/_category_.json | 2 +- docs/docs/computer-vision/useObjectDetection.md | 2 +- docs/docs/computer-vision/useStyleTransfer.md | 2 +- docs/docs/hookless-api/ExecutorchModule.md | 2 +- docs/docs/hookless-api/LLMModule.md | 2 +- docs/docs/hookless-api/ObjectDetectionModule.md | 2 +- docs/docs/hookless-api/StyleTransferModule.md | 2 +- docs/docs/hookless-api/_category_.json | 2 +- docs/docs/module-api/_category_.json | 2 +- docs/docs/utils/_category_.json | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/docs/benchmarks/_category_.json b/docs/docs/benchmarks/_category_.json index 8e10f7a3fa..001b34959d 100644 --- a/docs/docs/benchmarks/_category_.json +++ b/docs/docs/benchmarks/_category_.json @@ -1,6 +1,6 @@ { "label": "Benchmarks", - "position": 5, + "position": 7, "link": { "type": "generated-index" } diff --git a/docs/docs/computer-vision/useObjectDetection.md b/docs/docs/computer-vision/useObjectDetection.md index dfda071884..0c71958b18 100644 --- a/docs/docs/computer-vision/useObjectDetection.md +++ b/docs/docs/computer-vision/useObjectDetection.md @@ -1,6 +1,6 @@ --- title: useObjectDetection -sidebar_position: 2 +sidebar_position: 3 --- Object detection is a computer vision technique that identifies and locates objects within images or video. It’s commonly used in applications like image recognition, video surveillance or autonomous driving. diff --git a/docs/docs/computer-vision/useStyleTransfer.md b/docs/docs/computer-vision/useStyleTransfer.md index f3a8a1b193..f58919e89c 100644 --- a/docs/docs/computer-vision/useStyleTransfer.md +++ b/docs/docs/computer-vision/useStyleTransfer.md @@ -1,6 +1,6 @@ --- title: useStyleTransfer -sidebar_position: 3 +sidebar_position: 2 --- Style transfer is a technique used in computer graphics and machine learning where the visual style of one image is applied to the content of another. This is achieved using algorithms that manipulate data from both images, typically with the aid of a neural network. The result is a new image that combines the artistic elements of one picture with the structural details of another, effectively merging art with traditional imagery. React Native ExecuTorch offers a dedicated hook `useStyleTransfer`, for this task. However before you start you'll need to obtain ExecuTorch-compatible model binary. diff --git a/docs/docs/hookless-api/ExecutorchModule.md b/docs/docs/hookless-api/ExecutorchModule.md index db3c3cd7c0..0b87095225 100644 --- a/docs/docs/hookless-api/ExecutorchModule.md +++ b/docs/docs/hookless-api/ExecutorchModule.md @@ -1,6 +1,6 @@ --- title: ExecuTorchModule -sidebar_position: 5 +sidebar_position: 2 --- Hookless implementation of the [useExecutorchModule](../module-api/executorch-bindings.md) hook. diff --git a/docs/docs/hookless-api/LLMModule.md b/docs/docs/hookless-api/LLMModule.md index 005a2f7c10..7656db14be 100644 --- a/docs/docs/hookless-api/LLMModule.md +++ b/docs/docs/hookless-api/LLMModule.md @@ -1,6 +1,6 @@ --- title: LLMModule -sidebar_position: 4 +sidebar_position: 3 --- Hookless implementation of the [useLLM](../llms/running-llms.md) hook. diff --git a/docs/docs/hookless-api/ObjectDetectionModule.md b/docs/docs/hookless-api/ObjectDetectionModule.md index eaaf644dd6..2cc3504ef4 100644 --- a/docs/docs/hookless-api/ObjectDetectionModule.md +++ b/docs/docs/hookless-api/ObjectDetectionModule.md @@ -1,6 +1,6 @@ --- title: ObjectDetectionModule -sidebar_position: 2 +sidebar_position: 5 --- Hookless implementation of the [useObjectDetection](../computer-vision/useObjectDetection.mdx) hook. diff --git a/docs/docs/hookless-api/StyleTransferModule.md b/docs/docs/hookless-api/StyleTransferModule.md index d1d2202363..f084d8cad5 100644 --- a/docs/docs/hookless-api/StyleTransferModule.md +++ b/docs/docs/hookless-api/StyleTransferModule.md @@ -1,6 +1,6 @@ --- title: StyleTransferModule -sidebar_position: 3 +sidebar_position: 4 --- Hookless implementation of the [useStyleTransfer](../computer-vision/useStyleTransfer.mdx) hook. diff --git a/docs/docs/hookless-api/_category_.json b/docs/docs/hookless-api/_category_.json index da9d655f2a..e96f518638 100644 --- a/docs/docs/hookless-api/_category_.json +++ b/docs/docs/hookless-api/_category_.json @@ -1,6 +1,6 @@ { "label": "Hookless API", - "position": 7, + "position": 4, "link": { "type": "generated-index" } diff --git a/docs/docs/module-api/_category_.json b/docs/docs/module-api/_category_.json index 8cc82679ce..b04000182d 100644 --- a/docs/docs/module-api/_category_.json +++ b/docs/docs/module-api/_category_.json @@ -1,6 +1,6 @@ { "label": "Module API", - "position": 6, + "position": 5, "link": { "type": "generated-index" } diff --git a/docs/docs/utils/_category_.json b/docs/docs/utils/_category_.json index 1a2a274306..4bbbc17380 100644 --- a/docs/docs/utils/_category_.json +++ b/docs/docs/utils/_category_.json @@ -1,6 +1,6 @@ { "label": "Utils", - "position": 4, + "position": 6, "link": { "type": "generated-index" }