pixeltable-yolox is a lightweight, Apache-licensed object detection library built on PyTorch. It is a fork of the MegVii YOLOX package, modernized for recent versions of Python and refactored for easier use as a Python library. This library is designed for developers seeking a modern, accessible object detection solution for both academic and commercial projects.
Pixeltable YOLOX is still under development, and some features of the original YOLOX have not been ported yet. However, it offers a robust foundation for object detection tasks.
Developed by Pixeltable, Inc., a venture-backed AI infrastructure startup, this library aims to meet the vision community’s need for a lightweight object detection library with an untainted open source license. The Pixeltable team brings decades of collective experience in open source development from companies like Google, Cloudera, Twitter, Amazon, and Airbnb.
1
Install Dependencies
Copy
Ask AI
pip install pixeltable pixeltable-yolox
Define Your Detection Workflow
Create table.py:
Copy
Ask AI
import PILimport pixeltable as pxtfrom yolox.models import Yoloxfrom yolox.data.datasets import COCO_CLASSESt = pxt.create_table('image', {'image': pxt.Image}, if_exists='replace')@pxt.udfdef detect(image: PIL.Image.Image) -> list[str]: model = Yolox.from_pretrained("yolox_s") result = model([image]) coco_labels = [COCO_CLASSES[label] for label in result[0]["labels"]] return coco_labelst.add_computed_column(classification=detect(t.image), if_exists='replace')
Use Your App
Create app.py:
Copy
Ask AI
import pixeltable as pxtfrom yolox.data.datasets import COCO_CLASSES# Connect to your tablesimages = pxt.get_table("image")# Insert some imagesprefix = 'https://upload.wikimedia.org/wikipedia/commons'paths = [ '/1/15/Cat_August_2010-4.jpg', '/e/e1/Example_of_a_Dog.jpg', '/thumb/b/bf/Bird_Diversity_2013.png/300px-Bird_Diversity_2013.png']images.insert({'image': prefix + p} for p in paths)# Get detection resultsimage_results = images.select().collect()# Process and display detailed resultsfor idx, result in enumerate(image_results): print(f"Image {idx + 1} Detection Results:") detections = result['classification'] for label in detections: class_name = label print(f" - Detected: {class_name}")
Beyond basic object detection, pixeltable-yolox provides detailed output including bounding boxes, confidence scores, and class labels based on the COCO dataset categories.