Skip to content

Object Detection in Videos

Detect objects in a video frame by frame: Pixeltable extracts the frames, runs YOLOX models on them and reassembles the frames into a video. Compare detection models and evaluate them against ground truth.

Video · Notebook · Updated

Colab runs it in your browser. If it calls a model provider, it asks for that provider's API key in a cell.

What it covers

  • automatic frame extraction
  • running complex functions against frames (in this case, the YOLOX object detection models)
  • reassembling frames back into videos

What it uses

Install
terminal
pip install pixeltable pixeltable-yolox
Pixeltable calls
video.frame_iterator()yolox.yolox()vision.eval_detections()vision.mean_ap()pxt.create_table()pxt.create_view()insert()add_computed_column()group_by()

A look at the code

object-detection-in-videos.ipynb
# Create a computed column to compute detections using the `yolox_tiny`
# model.
# We'll adjust the confidence threshold down a bit (the default is 0.5)
# to pick up even more bounding boxes.
frames_view.add_computed_column(
detections_tiny=yolox(
frames_view.frame, model_id='yolox_tiny', threshold=0.25
)
)

One cell of the notebook, copied as it is. Open it in Colab for the rest.

Browse all 103