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.

Images · Recipe · Updated

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
terminal
pip install pixeltable pixeltable-yolox
Pixeltable calls
yolox.yolox()vision.bboxes_draw()video.frame_iterator()video.make_video()pxt.create_table()@pxt.udfpxt.create_view()insert()add_computed_column()group_by()

A look at the code

yolox-object-detection.mdx
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,
)
)

One block of the recipe, copied as it is. The rest is on the docs page.

Browse all 103