Iterators
Learn about iterators for processing documents, videos, audio, and images
What are Iterators?
Iterators in Pixeltable are specialized tools for processing and transforming media content. They efficiently break down large files into manageable chunks, enabling analysis at different granularities. Iterators work seamlessly with views to create virtual derived tables without duplicating storage.
In Pixeltable, iterators:
- Process media files incrementally to manage memory efficiently
- Transform single records into multiple output records
- Support various media types including documents, videos, images, and audio
- Integrate with the view system for automated processing pipelines
- Provide configurable parameters for fine-tuning output
Iterators are particularly useful when:
- Working with large media files that can’t be processed at once
- Building retrieval systems that require chunked content
- Creating analysis pipelines for multimedia data
- Implementing feature extraction workflows
Core Concepts
Document Splitting
Split documents into chunks by headings, paragraphs, or sentences
Video Processing
Extract frames at specified intervals or counts
Image Tiling
Divide images into overlapping or non-overlapping tiles
Audio Chunking
Split audio files into time-based chunks with configurable overlap
Iterators are powerful tools for processing large media files. They work seamlessly with Pixeltable’s computed columns and versioning system.
Available Iterators
Parameters
separators
: Choose from ‘heading’, ‘paragraph’, ‘sentence’, ‘token_limit’, ‘char_limit’, ‘page’limit
: Maximum tokens/characters per chunkmetadata
: Optional fields like ‘title’, ‘heading’, ‘sourceline’, ‘page’, ‘bounding_box’overlap
: Optional overlap between chunks
Common Use Cases
Document Processing
Split documents for:
- RAG systems
- Text analysis
- Content extraction
Video Analysis
Extract frames for:
- Object detection
- Scene classification
- Activity recognition
Image Processing
Create tiles for:
- High-resolution analysis
- Object detection
- Segmentation tasks
Audio Analysis
Split audio for:
- Speech recognition
- Sound classification
- Audio feature extraction
Example Workflows
Best Practices
Memory Management
- Use appropriate chunk sizes
- Consider overlap requirements
- Monitor memory usage with large files
Performance
- Balance chunk size vs. processing time
- Use batch processing when possible
- Cache intermediate results
Tips & Tricks
When using token_limit
with DocumentSplitter, ensure the limit accounts for any model context windows in your pipeline.
Additional Resources
Was this page helpful?