Pixeltable provides seamless integration with Hugging Face’s transformers library through built-in UDFs. These functions allow you to use state-of-the-art models directly in your data workflows.
Requirements: Install required dependencies with pip install transformers. Some models may require additional packages like sentence-transformers or torch.
from pixeltable.functions.huggingface import clip# For text embeddingt.add_computed_column( text_embedding=clip( t.text_column, model_id='openai/clip-vit-base-patch32' ))# For image embeddingt.add_computed_column( image_embedding=clip( t.image_column, model_id='openai/clip-vit-base-patch32' ))
Perfect for multimodal applications combining text and image understanding.
from pixeltable.functions.huggingface import detr_for_object_detectiont.add_computed_column( detections=detr_for_object_detection( t.image, model_id='facebook/detr-resnet-50', threshold=0.8 ))# Convert to COCO format if neededt.add_computed_column( coco_format=detr_to_coco(t.image, t.detections))
Powerful object detection with end-to-end transformer architecture.