Add YOLOS-tiny exported with apple/coreai-models
Browse files- .gitattributes +1 -0
- README.md +54 -0
- yolos-tiny.aimodel/main.hash +0 -0
- yolos-tiny.aimodel/main.mlirb +3 -0
- yolos-tiny.aimodel/metadata.json +8 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
yolos-tiny.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: hustvl/yolos-tiny
|
| 4 |
+
pipeline_tag: object-detection
|
| 5 |
+
library_name: coreai
|
| 6 |
+
tags:
|
| 7 |
+
- coreai
|
| 8 |
+
- ios
|
| 9 |
+
- object-detection
|
| 10 |
+
- react-native
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# YOLOS-tiny for Core AI
|
| 14 |
+
|
| 15 |
+
[hustvl/yolos-tiny](https://huggingface.co/hustvl/yolos-tiny) (6.5M parameters, COCO classes) exported to Apple Core AI, unmodified, with the [`apple/coreai-models`](https://github.com/apple/coreai-models) recipe. It runs on iOS 27 and macOS 27 with the `ObjectDetector` from the `CoreAIObjectDetection` product of `coreai-models`.
|
| 16 |
+
|
| 17 |
+
## Files
|
| 18 |
+
|
| 19 |
+
`yolos-tiny.aimodel/` is the exported model, float32, static shape (23 MB).
|
| 20 |
+
|
| 21 |
+
## Use
|
| 22 |
+
|
| 23 |
+
With [`@react-native-ai/core-ai`](https://github.com/callstackincubator/ai), download the folder and pass its path:
|
| 24 |
+
|
| 25 |
+
```typescript
|
| 26 |
+
import { CoreAI } from '@react-native-ai/core-ai'
|
| 27 |
+
|
| 28 |
+
const result = await CoreAI.runTask(
|
| 29 |
+
'object-detection',
|
| 30 |
+
{ id: 'yolos-tiny', sourceType: 'file', sourceUri: yolosModelPath },
|
| 31 |
+
{ imageUri },
|
| 32 |
+
{ threshold: 0.7 }
|
| 33 |
+
)
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
In Swift:
|
| 37 |
+
|
| 38 |
+
```swift
|
| 39 |
+
let detector = try await ObjectDetector(resourcesAt: "yolos-tiny.aimodel")
|
| 40 |
+
let detections = try await detector.detect(image: cgImage)
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Export
|
| 44 |
+
|
| 45 |
+
From [`apple/coreai-models`](https://github.com/apple/coreai-models) at `09ff139`, with `coreai-core` 1.0.0b3:
|
| 46 |
+
|
| 47 |
+
```bash
|
| 48 |
+
cd models/yolo
|
| 49 |
+
uv run export.py --model hustvl/yolos-tiny
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## License
|
| 53 |
+
|
| 54 |
+
Apache-2.0, as the original model. YOLOS is by Y. Fang et al., [You Only Look at One Sequence](https://arxiv.org/abs/2106.00666).
|
yolos-tiny.aimodel/main.hash
ADDED
|
Binary file (32 Bytes). View file
|
|
|
yolos-tiny.aimodel/main.mlirb
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:30f8c40b24807815119cf89e695e91f82e80d8ca2027349e55b68313f3998f00
|
| 3 |
+
size 23616392
|
yolos-tiny.aimodel/metadata.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"producer" : "coreai-core 1.0.0b3",
|
| 3 |
+
"author" : "Y. Fang et al.",
|
| 4 |
+
"assetVersion" : "2.0",
|
| 5 |
+
"creationDate" : "20261025T200808Z",
|
| 6 |
+
"description" : "YOLOS (You Only Look at One Sequence) applies a plain Vision Transformer directly to image patches and predicts object queries as bounding boxes and class logits. Source: https:\/\/huggingface.co\/hustvl\/yolos-tiny",
|
| 7 |
+
"license" : "Apache-2.0"
|
| 8 |
+
}
|