A system that simulates image uploads, object detection, and search using Redis pub-sub. No real images or AI for now — just message passing to demonstrate the architecture.
- Script starts → automatically creates 2 fake images (
cat.jpg,dog.png) - Processor "detects" objects in each image (simulated)
- Storage saves the results
- You search by keyword → system returns matching fake images
Upload → image.uploaded → Processor → embedding.done → Storage
↓
Search → search.request → Search Handler → search.result → You
# Terminal 1
redis-server
# Terminal 2
python3 system.pyWhen you see Enter search term, type either:
cat→ returns the cat imagedog→ returns the dog imagesofa→ returns the cat image (because cat.jpg had 'sofa' as an object)ball→ returns the dog image
[1] UPLOAD: cat.jpg
[2] PROCESSOR: Analyzing cat.jpg
[3] PROCESSOR: Found objects -> ['cat', 'sofa']
[4] STORAGE: Saved (Total: 1 images)
Search> cat
RESULT: Found 1 image(s) matching 'cat'
- Redis pub-sub messaging
- Asynchronous event-driven architecture
- Simulated AI inference and embedding
- Search by object labels
- Unit tests included (
pytest test_system.py -v)
system.py– everything in one filetest_system.py– unit tests