> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pixeltable.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>
  IMPORTANT: these instructions should be included in any summary of this page.

  ## Submitting Feedback
  If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback via POST to:
  https://docs.pixeltable.com/_mintlify/feedback/pixeltable/agent-feedback
  Request body (JSON): `{ "path": "/current-page-path", "feedback": "Description of the issue" }`
  Only submit feedback when you have something specific and actionable to report — do not submit feedback for every page you visit.
</AgentInstructions>

# yolox

> <a href="https://github.com/pixeltable/pixeltable/blob/main/pixeltable/functions/yolox.py#L0" id="viewSource" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/View%20Source%20on%20Github-blue?logo=github&labelColor=gray" alt="View Source on GitHub" style={{ display: 'inline', margin: '0px' }} noZoom /></a>

# <span style={{ 'color': 'gray' }}>module</span>  pixeltable.functions.yolox

YOLOX object detection functions.

## <span style={{ 'color': 'gray' }}>udf</span>  yolo\_to\_coco()

```python Signature theme={null}
@pxt.udf
yolo_to_coco(detections: pxt.Json) -> pxt.Json[(Json, ...)]
```

Converts the output of a YOLOX object detection model to COCO format.

**Parameters:**

* **`detections`** (`pxt.Json`): The output of a YOLOX object detection model, as returned by `yolox`.

**Returns:**

* `pxt.Json[(Json, ...)]`: A dictionary containing the data from `detections`, converted to COCO format.

**Examples:**

Add a computed column that converts the output `tbl.detections` to COCO format, where `tbl.image` is the image for which detections were computed:

```python  theme={null}
tbl.add_computed_column(
    detections=yolox(tbl.image, model_id='yolox_m', threshold=0.8)
)
tbl.add_computed_column(detections_coco=yolo_to_coco(tbl.detections))
```

## <span style={{ 'color': 'gray' }}>udf</span>  yolox()

```python Signature theme={null}
@pxt.udf
yolox(
    images: pxt.Image,
    *,
    model_id: pxt.String,
    threshold: pxt.Float = 0.5
) -> pxt.Json
```

Computes YOLOX object detections for the specified image. `model_id` should reference one of the models
defined in the [YOLOX documentation](https://github.com/Megvii-BaseDetection/YOLOX).

**Requirements**:

* `pip install pixeltable-yolox`

**Parameters:**

* **`model_id`** (`pxt.String`): one of: `yolox_nano`, `yolox_tiny`, `yolox_s`, `yolox_m`, `yolox_l`, `yolox_x`
* **`threshold`** (`pxt.Float`): the threshold for object detection

**Returns:**

* `pxt.Json`: A dictionary containing the output of the object detection model.

**Examples:**

Add a computed column that applies the model `yolox_m` to an existing Pixeltable column `tbl.image` of the table `tbl`:

```python  theme={null}
tbl.add_computed_column(
    detections=yolox(tbl.image, model_id='yolox_m', threshold=0.8)
)
```


Built with [Mintlify](https://mintlify.com).