From 9c2c7a07be97a8f6e307d5feb6b2a3190dca80e5 Mon Sep 17 00:00:00 2001 From: Norbert Klockiewicz Date: Tue, 31 Mar 2026 15:45:54 +0200 Subject: [PATCH] chore: use coreml version of rf detr on iOS --- .../03-hooks/02-computer-vision/useObjectDetection.md | 2 +- .../03-hooks/02-computer-vision/useObjectDetection.md | 2 +- .../react-native-executorch/src/constants/modelUrls.ts | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/docs/03-hooks/02-computer-vision/useObjectDetection.md b/docs/docs/03-hooks/02-computer-vision/useObjectDetection.md index ff3fbbcc60..b58a98790d 100644 --- a/docs/docs/03-hooks/02-computer-vision/useObjectDetection.md +++ b/docs/docs/03-hooks/02-computer-vision/useObjectDetection.md @@ -121,7 +121,7 @@ See the full guide: [VisionCamera Integration](./visioncamera-integration.md). | Model | Number of classes | Class list | Multi-size Support | | ----------------------------------------------------------------------------------------------------------------------------- | ----------------- | ------------------------------------------------------------- | ------------------- | | [SSDLite320 MobileNetV3 Large](https://huggingface.co/software-mansion/react-native-executorch-ssdlite320-mobilenet-v3-large) | 91 | [COCO](../../06-api-reference/enumerations/CocoLabel.md) | No (fixed: 320×320) | -| [RF-DETR Nano](https://huggingface.co/software-mansion/react-native-executorch-rf-detr-nano) | 80 | [COCO](../../06-api-reference/enumerations/CocoLabel.md) | No (fixed: 312×312) | +| [RF-DETR Nano](https://huggingface.co/software-mansion/react-native-executorch-rf-detr-nano) | 80 | [COCO](../../06-api-reference/enumerations/CocoLabel.md) | No (fixed: 384×384) | | [YOLO26N](https://huggingface.co/software-mansion/react-native-executorch-yolo26) | 80 | [COCO YOLO](../../06-api-reference/enumerations/CocoLabel.md) | Yes (384/512/640) | | [YOLO26S](https://huggingface.co/software-mansion/react-native-executorch-yolo26) | 80 | [COCO YOLO](../../06-api-reference/enumerations/CocoLabel.md) | Yes (384/512/640) | | [YOLO26M](https://huggingface.co/software-mansion/react-native-executorch-yolo26) | 80 | [COCO YOLO](../../06-api-reference/enumerations/CocoLabel.md) | Yes (384/512/640) | diff --git a/docs/versioned_docs/version-0.8.x/03-hooks/02-computer-vision/useObjectDetection.md b/docs/versioned_docs/version-0.8.x/03-hooks/02-computer-vision/useObjectDetection.md index dea6f20719..1e6e9c8c69 100644 --- a/docs/versioned_docs/version-0.8.x/03-hooks/02-computer-vision/useObjectDetection.md +++ b/docs/versioned_docs/version-0.8.x/03-hooks/02-computer-vision/useObjectDetection.md @@ -121,7 +121,7 @@ See the full guide: [VisionCamera Integration](./visioncamera-integration.md). | Model | Number of classes | Class list | Multi-size Support | | ----------------------------------------------------------------------------------------------------------------------------- | ----------------- | ------------------------------------------------------------- | ------------------- | | [SSDLite320 MobileNetV3 Large](https://huggingface.co/software-mansion/react-native-executorch-ssdlite320-mobilenet-v3-large) | 91 | [COCO](../../06-api-reference/enumerations/CocoLabel.md) | No (fixed: 320×320) | -| [RF-DETR Nano](https://huggingface.co/software-mansion/react-native-executorch-rf-detr-nano) | 80 | [COCO](../../06-api-reference/enumerations/CocoLabel.md) | No (fixed: 312×312) | +| [RF-DETR Nano](https://huggingface.co/software-mansion/react-native-executorch-rf-detr-nano) | 80 | [COCO](../../06-api-reference/enumerations/CocoLabel.md) | No (fixed: 384×384) | | [YOLO26N](https://huggingface.co/software-mansion/react-native-executorch-yolo26) | 80 | [COCO YOLO](../../06-api-reference/enumerations/CocoLabel.md) | Yes (384/512/640) | | [YOLO26S](https://huggingface.co/software-mansion/react-native-executorch-yolo26) | 80 | [COCO YOLO](../../06-api-reference/enumerations/CocoLabel.md) | Yes (384/512/640) | | [YOLO26M](https://huggingface.co/software-mansion/react-native-executorch-yolo26) | 80 | [COCO YOLO](../../06-api-reference/enumerations/CocoLabel.md) | Yes (384/512/640) | diff --git a/packages/react-native-executorch/src/constants/modelUrls.ts b/packages/react-native-executorch/src/constants/modelUrls.ts index f9abe3e2fc..963d2220fa 100644 --- a/packages/react-native-executorch/src/constants/modelUrls.ts +++ b/packages/react-native-executorch/src/constants/modelUrls.ts @@ -452,7 +452,10 @@ const SSDLITE_320_MOBILENET_V3_LARGE_MODEL = Platform.OS === 'ios' ? `${URL_PREFIX}-ssdlite320-mobilenet-v3-large/${VERSION_TAG}/coreml/ssdlite320_mobilenet_v3_large_coreml_fp16.pte` : `${URL_PREFIX}-ssdlite320-mobilenet-v3-large/${VERSION_TAG}/xnnpack/ssdlite320_mobilenet_v3_large_xnnpack_fp32.pte`; -const RF_DETR_NANO_MODEL = `${URL_PREFIX}-rfdetr-nano-detector/${VERSION_TAG}/rfdetr_detector.pte`; +const RF_DETR_NANO_MODEL = + Platform.OS === 'ios' + ? `${URL_PREFIX}-rfdetr-nano-detector/${VERSION_TAG}/coreml/rfdetr_n_det_coreml_int8.pte` + : `${URL_PREFIX}-rfdetr-nano-detector/${VERSION_TAG}/rfdetr_detector.pte`; /** * @category Models - Object Detection @@ -861,7 +864,10 @@ const YOLO26S_SEG_MODEL = `${URL_PREFIX}-yolo26-seg/${VERSION_TAG}/yolo26s-seg/x const YOLO26M_SEG_MODEL = `${URL_PREFIX}-yolo26-seg/${VERSION_TAG}/yolo26m-seg/xnnpack/yolo26m-seg.pte`; const YOLO26L_SEG_MODEL = `${URL_PREFIX}-yolo26-seg/${VERSION_TAG}/yolo26l-seg/xnnpack/yolo26l-seg.pte`; const YOLO26X_SEG_MODEL = `${URL_PREFIX}-yolo26-seg/${VERSION_TAG}/yolo26x-seg/xnnpack/yolo26x-seg.pte`; -const RF_DETR_NANO_SEG_MODEL = `${URL_PREFIX}-rfdetr-nano-segmentation/${VERSION_TAG}/rfdetr_segmentation.pte`; +const RF_DETR_NANO_SEG_MODEL = + Platform.OS === 'ios' + ? `${URL_PREFIX}-rfdetr-nano-segmentation/${VERSION_TAG}/coreml/rfdetr_n_seg_coreml_int8.pte` + : `${URL_PREFIX}-rfdetr-nano-segmentation/${VERSION_TAG}/rfdetr_segmentation.pte`; /** * @category Models - Instance Segmentation */