Skip to main content

Lightweight, open-source, high-performance Yolo implementation

Project description

YoloX

pixeltable-yolox is a lightweight, Apache-licensed object detection library built on pytorch. It is a fork of the MegVii YOLOX package originally authored by Zheng Ge et al, modernized for recent versions of Python and refactored to be more easily usable as a Python library.

pixeltable-yolox is still a work in progress! Some features of YoloX have not been ported yet.

Usage

Installation

pip install pixeltable-yolox

Inference

import requests
from PIL import Image
from yolox.models import Yolox, YoloxProcessor

url = "https://raw.githubusercontent.com/pixeltable/pixeltable-yolox/main/tests/data/000000000001.jpg"
image = Image.open(requests.get(url, stream=True).raw)

model = Yolox.from_pretrained("yolox_s")
processor = YoloxProcessor("yolox_s")
tensor = processor([image])
output = model(tensor)
result = processor.postprocess([image], output)

This yields the following output:

[{'bboxes': [
   (272.36126708984375, 3.5648040771484375, 640.4871826171875, 223.2653350830078),
   (26.643890380859375, 118.68254089355469, 459.80706787109375, 315.089111328125),
   (259.41485595703125, 152.3223114013672, 295.37054443359375, 230.41783142089844)],
  'scores': [0.9417160943584335, 0.8170979975670818, 0.8095869439224117],
  'labels': [7, 2, 12]}]

The labels are COCO category indices.

from yolox.data.datasets import COCO_CLASSES

COCO_CLASSES[7]
'truck'

Training

First unpack a COCO dataset into ./datasets/COCO:

COCO/
  annotations/
    instances_train2017.json
    instances_val2017.json
  train2017/
    # image files
  val2017/
    # image files

Then on the command line:

yolox train -c yolox-s -d 8 -b 64 --fp16 -o

For help:

yolox train -h

Background

The original YOLOX implementation, while powerful, has been updated only sporadically since 2022 and now faces compatibility issues with current Python environments, dependencies, and platforms like Google Colab. This fork aims to provide a reliable, up-to-date, and easy-to-use version of YOLOX that maintains its Apache license, ensuring it remains accessible for academic and commercial use.

Status

pixeltable-yolox is a work in progress. So far, it contains the following changes to the base YOLOX repo:

  • pip installable with all versions of Python (3.9+)
  • New YoloxProcessor class to simplify inference
  • Refactored CLI for training and evaluation
  • Improved test coverage

The following are planned:

  • CI with regular testing and updates
  • Typed for use with mypy

Scope

Further improvements such as model enhancements, training tooling beyond what already exists, etc., are not planned; our goal is to take the existing feature set and make it more easily usable. However, we are happy to shepherd community contributions in those areas and provide engineering infrastructure such as CI and regular releases. We intend to publish a contributors’ guide once the initial release is available.

Thanks for your interest! For any questions or feedback, please contact us at contact@pixeltable.com.

Who are we and why are we doing this?

Pixeltable, Inc. is a venture-backed AI infrastructure startup. Our core product is pixeltable, a database and orchestration system purpose-built for multimodal AI workloads.

Pixeltable integrates with numerous AI services and open source technologies. In the course of integrating with YOLOX, it became clear that there is a strong need in the vision community for a lightweight object detection library with an untainted open source license. It also became clear that while YOLOX is an excellent foundation, it would benefit greatly from code modernization and more regular updates.

We chose to build upon YOLOX both to simplify our own integration, and also to give something back to the community that will (hopefully) prove useful. The Pixeltable team has decades of collective experience in open source development. Our backgrounds include companies such as Google, Cloudera, Twitter, Amazon, and Airbnb, that have a strong commitment to open source development and collaboration.

Contributing

We welcome contributions from the community! If you're interested in helping maintain and improve pixeltable-yolox, please stay tuned for our contributor's guide which will be published after the initial release.

In memory of Dr. Jian Sun

Without the guidance of Dr. Jian Sun, YOLOX would not have been released and open sourced to the community. The passing away of Dr. Sun is a huge loss to the Computer Vision field. We add this section here to express our remembrance and condolences to Dr. Sun. It is hoped that every AI practitioner in the world will stick to the belief of "continuous innovation to expand cognitive boundaries, and extraordinary technology to achieve product value" and move forward all the way.

Dr. Jian Sun

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pixeltable_yolox-0.4.0.tar.gz (88.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pixeltable_yolox-0.4.0-py3-none-any.whl (113.5 kB view details)

Uploaded Python 3

File details

Details for the file pixeltable_yolox-0.4.0.tar.gz.

File metadata

  • Download URL: pixeltable_yolox-0.4.0.tar.gz
  • Upload date:
  • Size: 88.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.9.20 Darwin/24.3.0

File hashes

Hashes for pixeltable_yolox-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e5d3f2f7af5c6e94ba5844d41d25e90f6b0ed1ae6c76b6d98c8df1da20fd5c59
MD5 c3b452bc640c724a54717b8d048782f0
BLAKE2b-256 bdf97094adeb376cb979e8c48de3164ecc62437a2752bc8c60c8c6d6663edb54

See more details on using hashes here.

File details

Details for the file pixeltable_yolox-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: pixeltable_yolox-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 113.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.9.20 Darwin/24.3.0

File hashes

Hashes for pixeltable_yolox-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25d80adb84f7778a4c17201e10129fc4e4578867c9662050d17aee5df1965ee3
MD5 8bb4bd3e2fc2c618355509dd058319d6
BLAKE2b-256 875aebf127b04812023ec713bed15403e3e4add5eefb5c3e7c2cd26b2bdefd15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page