mlboydaisuke commited on
Commit
3fde452
·
verified ·
1 Parent(s): fac480b

gen-cards: regenerate Use-it block

Browse files
Files changed (1) hide show
  1. README.md +40 -0
README.md CHANGED
@@ -24,6 +24,46 @@ The **dense-detector** counterpart to
24
  needs no NMS, YOLOX is the classic `score = obj · cls` + **per-class NMS** pipeline.
25
 
26
  <!-- gen-cards:use-it begin id=yolox-s (managed by scripts/gen-cards — edit cards.json / QuickStart.swift, not this block) -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  <!-- gen-cards:use-it end -->
28
 
29
  ## Bundle
 
24
  needs no NMS, YOLOX is the classic `score = obj · cls` + **per-class NMS** pipeline.
25
 
26
  <!-- gen-cards:use-it begin id=yolox-s (managed by scripts/gen-cards — edit cards.json / QuickStart.swift, not this block) -->
27
+ ## Use it
28
+
29
+ ▶️ **Run it (source)** — the [DetectCamera runner](https://github.com/john-rocky/coreai-kit/tree/main/Examples/DetectCamera)
30
+ (real-time object detection on the zero-copy camera path):
31
+
32
+ ```bash
33
+ git clone https://github.com/john-rocky/coreai-kit
34
+ open coreai-kit/Examples/DetectCamera/DetectCamera.xcodeproj
35
+ # → Run, then pick "YOLOX" in the model picker
36
+
37
+ # agents / headless (macOS):
38
+ cd coreai-kit/Examples/DetectCamera
39
+ swift run detect-cli --model yolox-s --image Resources/gate_image.jpg
40
+ ```
41
+
42
+ 💻 **Build with it** — complete; the glue is kit API, copy-paste runs:
43
+
44
+ ```swift
45
+ import CoreAIKitVision
46
+
47
+ let detector = try await KitDetector(catalog: "yolox-s")
48
+ let image = try ImageFile.load(imageURL) // any image file → CGImage + EXIF orientation
49
+ let detections = try await detector.detect(in: image.cgImage)
50
+ // detections: [Detection] — label, score, normalized box (top-left origin)
51
+ ```
52
+
53
+ The take-home is [`Examples/DetectCamera/Sources/QuickStart.swift`](https://github.com/john-rocky/coreai-kit/blob/main/Examples/DetectCamera/Sources/QuickStart.swift)
54
+ — this exact code as one typed function, no UI; the CLI is an argument shell over it, and
55
+ the GUI runs the same detector per camera frame on a zero-copy pixel-buffer fast path.
56
+ YOLOX is a dense detector — `KitDetector` runs the obj·cls threshold + per-class NMS
57
+ host-side; the DETR family needs none. Same `detect(in:)` either way.
58
+
59
+ **Integration checklist**
60
+
61
+ - SPM: `https://github.com/john-rocky/coreai-kit` → product **CoreAIKitVision**
62
+ - Info.plist: `NSCameraUsageDescription` — only for the live camera; the snippet needs none
63
+ - Entitlements: none needed
64
+ - First run downloads the model — 0.0 GB (Mac) / 0.0 GB (iPhone) — then it loads from the
65
+ local cache (Application Support; progress via the `downloadProgress` callback)
66
+ - Measure in Release — Debug is ~3× slower on per-token host work
67
  <!-- gen-cards:use-it end -->
68
 
69
  ## Bundle