Skip to content
Other

inference4j/yolox-s

lightweight object detector in ONNX format

2 min read

The model recognizes objects in images and returns their coordinates along with labels from 80 standard COCO dataset categories (people, vehicles, animals, household items). This is an official export of the YOLOX-S architecture by Megvii into the universal ONNX format (an open standard for running AI models across different platforms), mirrored for working with the Java library inference4j. The main advantage over newer versions like YOLOv8 is the permissive Apache-2.0 license for both code and weights, free from the strict restrictions of AGPL. Its compact size of 9 million parameters makes the model easy to integrate into Java backend services and cross-platform applications.

Key features

  • Anchor-free YOLOX-S architecture with a decoupled head totaling 9.0 million parameters.
  • Support for 80 base object classes from the COCO dataset (ranging from people to household items).
  • Fully permissive Apache-2.0 license allowing commercial use without disclosing source code.
  • Ready-to-use official ONNX graph opset 11 with a fixed 640×640 pixel input.

What you can do

  • Embed object recognition into Java applications or microservices using the inference4j library without spinning up a separate Python server.
  • Deploy the model in any environment supporting ONNX Runtime for basic photo and video frame analysis.

Example

try (ObjectDetector detector = YoloXDetector.s().build()) {
    List detections = detector.detect(Path.of("street.jpg"));
    detections.forEach(d -> System.out.printf("%s (%.0f%%) at [%.0f, %.0f, %.0f, %.0f]%n",
        d.label(), d.confidence() * 100,
        d.box().x1(), d.box().y1(), d.box().x2(), d.box().y2()));
}
Read moreDetails
Quality metric: 40.5 COCO AP (on the val2017 validation set at 640×640 resolution).
Trained from scratch on COCO 2017 train without ImageNet pre-training.
Input: tensor [1, 3, 640, 640] in BGR format (values 0–255, without mean/std normalization) with padding filled with value 114.
Post-processing (coordinate decoding and NMS with an IoU threshold of 0.45) is performed outside the ONNX graph.
Discuss Telegram 0

Will it run?

Runs in BF16

Fits without quantisation.

  • BF16weights 0.0 GB · ready files0.5 GB
  • FP8 / INT8recommendedweights 0.0 GB0.5 GB
  • 4-bitweights 0.0 GB0.5 GB

Tip: go 8-bit.FP8 / INT8 is within about a percent of full precision in quality, takes half the memory and runs faster on RTX 40/50 and H100. Full precision only pays off for fine-tuning.

What to get for this model

Massed ComputeOpen Massed Compute

Your own GPU: FP8 / INT8 — from RTX 2060 · BF16 — from RTX 2060

Massed Compute hourly prices, November 2026. The discounted price applies with the coupon at checkout.

Estimate: weights plus working memory. Long videos, high resolutions and long contexts need more.

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # inference4j/yolox-s
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download inference4j/yolox-s --local-dir ~/models/yolox-s
    # The model is in ~/models. How to run it is in the model card (link above).
    Add more LoRAs to yolox-s
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b40from November 18, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026new release

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

New posts about versions of yolox-s (quants, finetunes, LoRAs) will show up under the bell.

No known relatives of this model yet. All derivatives on Hugging Face

About the model

inference4j/yolox-s
Author
inference4j
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

00

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments