Views
No views yet
Mirror ofmlboydaisuke/YOLOX-CoreAI— the canonical repo (CoreAI Model Zoo). Updates land there first.
.aimodel) — a single-stage anchor-free object detector running as
one static graph on every Apple compute unit (Mac GPU / iPhone GPU / Neural Engine). Part
of the Core AI model zoo
(model card).score = obj · cls + per-class NMS pipeline.1git clone https://github.com/john-rocky/coreai-kit
2open coreai-kit/Examples/DetectCamera/DetectCamera.xcodeproj
3# → Run, then pick "YOLOX" in the model picker
4
5# agents / headless (macOS):
6cd coreai-kit/Examples/DetectCamera
7swift run detect-cli --model yolox-s --image Resources/gate_image.jpg1import CoreAIKitVision
2
3let detector = try await KitDetector(catalog: "yolox-s")
4let image = try ImageFile.load(imageURL) // any image file → CGImage + EXIF orientation
5let detections = try await detector.detect(in: image.cgImage)
6// detections: [Detection] — label, score, normalized box (top-left origin)Examples/DetectCamera/Sources/QuickStart.swift
— this exact code as one typed function, no UI; the CLI is an argument shell over it, and
the GUI runs the same detector per camera frame on a zero-copy pixel-buffer fast path.
YOLOX is a dense detector — KitDetector runs the obj·cls threshold + per-class NMS
host-side; the DETR family needs none. Same detect(in:) either way.https://github.com/john-rocky/coreai-kit → product CoreAIKitVisionNSCameraUsageDescription — only for the live camera; the snippet needs nonedownloadProgress callback)yolox-s_float32.aimodel — YOLOX-S, 640² input, 8.97M params, fp32 (the ship dtype;
detection has no bandwidth-bound decode loop, so fp16 is no faster on the GPU and only adds
near-tie noise). 36 MB. Same bundle on macOS and iOS.input "image" [1,3,640,640] f32 BGR, 0-255, letterboxed (pad 114, top-left) — YOLOX-native (no /255, no mean/std)
output "preds" [1,8400,85] f32 [cx,cy,w,h, obj, cls_0..cls_79]; box DECODED to 640-px, obj/cls SIGMOID-ed (in-graph)score = obj · max_class, threshold, per-class NMS (IoU 0.45), then
un-letterbox the survivors. Anchors A = 80² + 40² + 20² = 8400 (strides 8/16/32).1import CoreAIKitVision
2let detector = try await YOLOXDetector(model: .yoloxS) // downloads this repo
3let detections = try await detector.detect(in: pixelBuffer, scoreThreshold: 0.3)conversion/export_yolox.py
— --variant s --yolox-repo <YOLOX checkout> --weights yolox_s.pth, gated end-to-end with
--verify-image <img> --unit {cpu,gpu}. The script also maps nano/tiny/m/l/x.