Object detection
YOLOX-S
Anchor-free YOLO-style detector from Megvii: finds and boxes 80 kinds of everyday objects. Apache-2.0.
About this model
YOLOX-S finds objects in a photo or camera frame and draws a box around each, with its class and a score, among the 80 COCO classes. It is Megvii's anchor-free take on YOLO, with 9.0 million parameters.
Unlike Ultralytics' models it is Apache-2.0, so closed-source products can ship it. Megvii reports 40.5 mAP 50-95 on COCO val2017 for YOLOX-S at 640 x 640.
What you can build
- Object detection in commercial apps without AGPL obligations
- People and vehicle counting from a camera
- Regions of interest before a second model
People crossing street
f16Mike Petrucci mikepetrucci, CC0, https://commons.wikimedia.org/wiki/File:People_crossing_street_(Unsplash).jpg
27 boxes on the Metal (FP16 pack), score 0.25 or more, duplicates removed at IoU 0.45: person 0.86 at [119, 360, 168, 450] person 0.84 at [382, 352, 432, 449] person 0.84 at [770, 373, 798, 439] person 0.82 at [525, 361, 565, 444] traffic light 0.80 at [65, 157, 89, 219] person 0.78 at [493, 362, 527, 441] motorcycle 0.77 at [0, 388, 54, 448] traffic light 0.76 at [851, 251, 871, 296] person 0.75 at [881, 373, 911, 438] person 0.74 at [439, 371, 467, 429] traffic light 0.73 at [881, 250, 900, 295] car 0.63 at [225, 350, 322, 424] person 0.58 at [702, 374, 717, 414] person 0.54 at [633, 375, 648, 418] person 0.54 at [33, 348, 61, 415] truck 0.53 at [226, 351, 320, 424] truck 0.51 at [318, 346, 372, 407] person 0.50 at [10, 346, 37, 406] car 0.49 at [421, 369, 446, 392] person 0.44 at [66, 348, 85, 412] car 0.41 at [368, 369, 392, 397] car 0.37 at [874, 413, 960, 495] motorcycle 0.35 at [78, 393, 109, 440] car 0.34 at [294, 352, 331, 417] car 0.32 at [316, 346, 371, 407] person 0.29 at [923, 375, 948, 409] person 0.27 at [583, 369, 597, 406]
Bus stop people
f16Retired electrician, CC0, https://commons.wikimedia.org/wiki/File:Moscow,_Paveletskaya_Square,_people_at_bus_stop_Sept_2025_02.jpg
14 boxes on the Metal (FP16 pack), score 0.25 or more, duplicates removed at IoU 0.45: person 0.92 at [327, 223, 450, 565] suitcase 0.92 at [529, 399, 614, 569] person 0.91 at [204, 229, 289, 470] person 0.91 at [116, 241, 212, 473] person 0.90 at [453, 219, 575, 562] bus 0.90 at [405, 35, 959, 505] suitcase 0.88 at [307, 410, 384, 574] backpack 0.73 at [461, 261, 531, 380] traffic light 0.64 at [27, 69, 47, 108] person 0.62 at [853, 188, 884, 308] bus 0.59 at [181, 41, 308, 205] bus 0.54 at [244, 21, 735, 429] truck 0.46 at [173, 42, 282, 203] handbag 0.34 at [210, 271, 258, 345]
Office desk computer
f16Jeff Sheldon ugmonk, CC0, https://commons.wikimedia.org/wiki/File:Office_desk_with_computer_and_music_player_(Unsplash).jpg
2 boxes on the Metal (FP16 pack), score 0.25 or more, duplicates removed at IoU 0.45: cup 0.94 at [619, 507, 775, 718] potted plant 0.54 at [807, 182, 959, 393]
Variants & downloads
Choose the build for your appModel files are hosted on Google Drive. Large files may open a confirmation page before downloading.
Small
SlabWeights stored as int8 in blocks of 64. Slab decodes them to float when loading, so it runs at the same speed; scores move more than with FP16 (see Accuracy).
Platforms: macos · android
yolox-s-int8.slab
11.6 MB · Hosted download
SHA-256 checksum
e767720badf00c50db7b069908d1c82201404651b9c6d3024e0954841f14130fLICENSE-YOLOX.txt
11 KB
SHA-256 checksum
0ec3668d3274bcf29e8a29e9576d5a2cd96fc78d3c5bec4387355a796e5d9088Conversion details
- command
- curl -LO https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.1rc0/yolox_s.pth python -c "import torch; from yolox.exp import get_exp; m = get_exp(None, 'yolox-s').get_model().eval(); m.load_state_dict(torch.load('yolox_s.pth', map_location='cpu', weights_only=True)['model']); m.head.decode_in_inference = True; torch.onnx.export(m, torch.zeros(1, 3, 640, 640), 'model.onnx', input_names=['images'], output_names=['output'], opset_version=17, dynamo=False)" python -c "from yolox.data.datasets import COCO_CLASSES; open('labels.txt', 'w').write('\n'.join(COCO_CLASSES))" slab-load convert model.onnx model.slab --input images=1x3x640x640 --meta task=detect --meta resize=letterbox --meta letterbox_pad:i64=114 --meta letterbox_align=top_left --meta normalize=raw255 --meta color=bgr --meta decode=yolox --meta labels:labels=@labels.txt slab-load quantize model.slab yolox-s-int8.slab slab-load meta set yolox-s-int8.slab default_backend.macos=gpu
Integration examples
Python
python
import slab
cfg = slab.Config(cache_dir="/tmp/slab_cache", license=open("license.slablic.txt").read())
session = slab.Session(cfg, "yolox-s-f16.slab", warmup=True)
out = session.run(slab.Input(frame=slab.Frame.open("photo.jpg")))
for b in out.boxes(score_threshold=0.25, iou_threshold=0.45):
print(b.label, round(b.score, 2), b.x1, b.y1, b.x2, b.y2)
Device & backend compatibility
Pack default: macos / GPU. The fastest backend on the Mac (about 8 ms per frame); the Neural Engine also gives the upstream boxes, at about 10 ms.
| Platform | Engine | Status | Precision |
|---|---|---|---|
| apple | CPU CPU | Supported Measured on macOS. | f32 |
| apple | Metal GPU | Supported Measured on macOS. The default. | f32 |
| apple | Apple Neural Engine NPU | Supported Measured on macOS. The Neural Engine computes in FP16. | f16 |
| android | CPU CPU | Supported Measured on a Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2, Adreno 740), Android 17. | f32 |
| android | Vulkan GPU | Supported Measured on a Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2, Adreno 740), Android 17. | f32 |
| android | Qualcomm Hexagon NPU (QNN) NPU | Supported Measured on a Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2, Adreno 740), Android 17. The NPU computes in FP16 (the int8 pack's weights are widened to FP16). | f16 |
Performance
Results depend on the device, runtime, and test conditions. Each measurement keeps its own context.
Mac with Apple M1 Max
Slab · CPU
macOS 26.6.2
71.1 ms
Measured time · scope below
Median of 100 warm runs of the model, box selection included (Slab's run time). From a 1920 x 1080 photo, letterboxing and decoding boxes included: 73.97 ms median.
Mac with Apple M1 Max
Slab · GPU
macOS 26.6.2
7.9 ms
Measured time · scope below
Median of 100 warm runs of the model, box selection included (Slab's run time). From a 1920 x 1080 photo, letterboxing and decoding boxes included: 8.73 ms median.
Mac with Apple M1 Max
Slab · NPU
macOS 26.6.2
9.8 ms
Measured time · scope below
Median of 100 warm runs of the model, box selection included (Slab's run time). From a 1920 x 1080 photo, letterboxing and decoding boxes included: 11.59 ms median.
Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2)
Slab · CPU
Android 17
459.0 ms
Measured time · scope below
Median of 27 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, letterboxing and decoding boxes included: 439 ms median. open_ms: opening the session. Peak memory (resident) after the runs: 190 MB.
Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2)
Slab · GPU
Android 17
148.0 ms
Measured time · scope below
Median of 80 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, letterboxing and decoding boxes included: 134 ms median. open_ms: opening the session with the GPU programs already in the cache folder (the first open on a device compiles them, about 0.3 s more). Peak memory (resident) after the runs: 118 MB.
Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2)
Slab · NPU
Android 17
10.8 ms
Measured time · scope below
Median of 100 warm runs of the model (Slab's run time). From a 1920 x 1080 photo, preprocessing on the CPU included: 23.6 ms median. open_ms: opening the session, including preparing the model for the Hexagon NPU. Peak memory (resident) after the runs: 113 MB.
Accuracy checks
macos · CPU · int8
The upstream PyTorch model with YOLOX's own preprocessing and postprocessing (score 0.25, NMS 0.45 per class), 67 public-domain photos (Wikimedia Commons), boxes scoring 0.25 or more; a box matches with the same class and IoU 0.5 or more
With Slab preprocessing: 301 of 308 boxes matched (mean IoU 0.989), 4 extra. On identical input tensors: 303 of 308 matched (mean IoU 0.990), 3 extra, largest score difference 0.099.
macos · GPU · int8
The upstream PyTorch model with YOLOX's own preprocessing and postprocessing (score 0.25, NMS 0.45 per class), 67 public-domain photos (Wikimedia Commons), boxes scoring 0.25 or more; a box matches with the same class and IoU 0.5 or more
With Slab preprocessing: 301 of 308 boxes matched (mean IoU 0.989), 4 extra. On identical input tensors: 303 of 308 matched (mean IoU 0.990), 3 extra, largest score difference 0.099.
macos · NPU · int8
The upstream PyTorch model with YOLOX's own preprocessing and postprocessing (score 0.25, NMS 0.45 per class), 67 public-domain photos (Wikimedia Commons), boxes scoring 0.25 or more; a box matches with the same class and IoU 0.5 or more
With Slab preprocessing: 300 of 308 boxes matched (mean IoU 0.985), 6 extra. On identical input tensors: 301 of 308 matched (mean IoU 0.984), 4 extra, largest score difference 0.128.
android · NPU · int8
Slab's CPU engine (FP32) on the same 1920 x 1080 photo
Cosine similarity of the output with the CPU's: 0.99999.
Before you choose this model
- Only the 80 COCO classes.
- Released in 2021; newer detectors are more accurate at the same size.
- Needs non-maximum suppression (Slab does it in out.boxes).