---
title: "Detect objects in images and videos with YOLOX"
description: "Run YOLOX object detection in Python on images and video frames, then query and draw the detected objects."
url: "https://www.pixeltable.com/notebooks/yolox-object-detection"
updated: "2026-10-13"
---

# Detect objects in images and videos with YOLOX

Run YOLOX object detection in Python on images and video frames, then query and draw the detected objects.

- **Type:** Recipe
- **Group:** Images

## How it works

You have images or videos and need to find objects such as people and cars. You want to query which images or frames contain those objects and inspect their bounding boxes.

You use YOLOX, an anchor-free object detector, to return a box around each detected object. pixeltable.functions.yolox.yolox() runs one of yolox_nano, yolox_tiny, yolox_s, yolox_m, yolox_l, or yolox_x on an image. On a video, frame_iterator() makes one row per frame, and the same function runs on frame.

## What it covers

- Preview YOLOX detections and save them for each image
- Query images and video frames by COCO class id
- Draw detections and assemble annotated frames into a video

## What it uses

- **Install:** `pip install pixeltable pixeltable-yolox`
- **Pixeltable calls:** `yolox.yolox()`, `vision.bboxes_draw()`, `video.frame_iterator()`, `video.make_video()`, `pxt.create_table()`, `@pxt.udf`, `pxt.create_view()`, `insert()`, `add_computed_column()`, `group_by()`

## A look at the code

```python
images.add_computed_column(detections=image_detections)
images.add_computed_column(classes=class_names(images.detections))
images.add_computed_column(
    annotated=bboxes_draw(
        images.image,
        images.detections.bboxes,
        labels=images.classes,
    )
)
```

## Open it

- **Docs page:** https://docs.pixeltable.com/howto/cookbooks/images/yolox-object-detection
- **Source on GitHub:** https://github.com/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/images/yolox-object-detection.mdx
