Detect objects in images
Automatically identify and locate objects in images using YOLOX object detection models.
Run YOLOX object detection in Python on images and video frames, then query and draw the detected objects.
Images · Recipe · Updated
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.
pip install pixeltable pixeltable-yolox
yolox.yolox()vision.bboxes_draw()video.frame_iterator()video.make_video()pxt.create_table()@pxt.udfpxt.create_view()insert()add_computed_column()group_by()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.
Automatically identify and locate objects in images using YOLOX object detection models.
Understand when to use bounding boxes versus pixel-level masks for image analysis.
Draw bounding boxes on images to visualize object detection results.
Segment every object matching a concept (a short text phrase or a bounding box) using Meta's Segment Anything Model 3.