A Fullstack NAS Image Indexing & AI Search System
PetaVision is a high-performance, scalable fullstack application which efficiently index massive image collections (tested with 100TB+ datasets) and provides semantic search capabilities using AI embeddings to Network Attached Storage (NAS).
Built for Textile Manufacturers: PetaVision is specifically designed to help textile manufacturers manage their petabyte-scale image libraries. Whether you're a designer creating new patterns, a sales person presenting to clients, or any stakeholder in the textile industry - find the right design instantly without remembering where files are stored.
Our Mission: To provide visual intelligence that empowers all stakeholders - designers, sales teams, and decision makers - to find design assets instantly, so they can focus on what matters most - their core work. No more wasting hours searching through folders; let AI understand your visual needs.
Built with Go, Python, and Next.js, PetaVision delivers enterprise-grade performance for petabyte-scale image management.
π Semantic Search: Find images using natural language descriptions
π Massive Scale: Tested on 100TB+ NAS storage with millions of images
π High Performance: Multi-threaded Go backend for fast file system scanning
π¨ AI-Powered: CLIP embeddings for understanding image content
π Modern Web UI: Next.js interface with image browsing and AI generation
π Vector Search: Milvus integration for lightning-fast similarity queries
π Incremental Sync: Smart synchronization with change detection
The system consists of three main components:
- Go Backend (SyncEngine): Handles file system scanning, thumbnail generation, and orchestration
- Python AI Pipeline: Generates CLIP embeddings and handles ML processing
- Next.js Frontend: Provides web interface for search and image management
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β NAS/FS βββββΆβ Go Backend βββββΆβ AI Pipeline β
β 100TB+ β β File Scan β β CLIP/ML β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β β
βΌ βΌ
βββββββββββββββ βββββββββββββββ
β SQLite β β Milvus β
β Metadata β β Vectors β
βββββββββββββββ βββββββββββββββ
β β
βββββββββ¬ββββββββββββ
βΌ
βββββββββββββββ
β Next.js UI β
β Search/View β
βββββββββββββββ
- Go 1.21+
- Python 3.11+ with Conda
- Node.js 16+
- Milvus vector database
- Access to NAS or large image directory
# Clone repository
git clone <repository-url>
cd local-sync-go
# Setup Python environment and Go dependencies
make allCreate config.ini:
[milvus]
uri=http://localhost:19530
user=root
password=Milvus
collection=image_collection# Full initial sync (replace with your NAS path)
go run main.go -rootFilePath="/mnt/nas/images" -force
# Scheduled incremental sync (runs only if >6 hours since last sync)
go run main.go -rootFilePath="/mnt/nas/images" -sync# Terminal 1: Start Next.js frontend
cd web/
npm run dev
# Terminal 2: Start Python API server
conda activate sync_engine
python scripts/api.pyVisit http://localhost:3000 to access the web interface.
go run main.go [flags]Flags:
-rootFilePath: Path to your image directory (required)-force: Force full re-scan of all files-sync: Incremental sync mode (skips if recently synced or already running)
- Browse Images: Grid view of all indexed images with thumbnails
- Semantic Search: Search images using natural language descriptions
- AI Generation: Generate new images using various AI models
- Admin Panel: View sync status, manage collections
- Upscaling: AI-powered image upscaling tools
Once indexed, you can search for images using descriptions like:
- "sunset over mountains"
- "cat sleeping on a couch"
- "people at a wedding"
- "red car in parking lot"
- "food on a plate"
- Storage: 100TB+ NAS with 10+ million images
- Indexing Speed: ~500-1000 images/minute (depends on hardware)
- Search Speed: <100ms for semantic queries
- Memory Usage: ~2GB RAM for Go process, ~4GB for Python ML models
- Use SSD storage for thumbnail cache (
.local/thumbnails3/) - Configure adequate swap space for large ML models
- Use dedicated Milvus instance for production workloads
- Monitor disk I/O during initial indexing
βββ main.go # Entry point and CLI
βββ engine/ # Core Go processing logic
βββ models/ # Database models (files, dirs, syncs)
βββ utils/ # Shared utilities
βββ scripts/ # Python AI/ML scripts
βββ web/ # Next.js frontend
βββ Makefile # Build and environment setup
βββ environment.yml # Conda dependencies
βββ config.ini # Milvus configuration
# Build Go binary
go build -o sync-engine main.go
# Build web frontend
cd web/
npm run build# Run Go tests
go test ./...
# Run web tests
cd web/
npm test
# Python linting
conda activate sync_engine
flake8 scripts/SYNC_LOG_LEVEL: Set logging level (debug, info, warn, error)MILVUS_URI: Override Milvus connection URLCACHE_DIR: Override embedding cache directory
- Thumbnails: ~100MB per 10,000 images
- Embeddings: ~5KB per image
- Metadata: ~1KB per image
- Logs: Configurable, rotated daily
# Build containers
docker-compose build
# Start services
docker-compose up -d- Use external Milvus cluster for high availability
- Configure proper backup strategies for metadata
- Set up monitoring for sync processes
- Use reverse proxy for web interface
- Configure file system permissions for NAS access
Slow indexing performance:
- Check disk I/O utilization
- Verify network speed to NAS
- Increase concurrent processing workers
Out of memory errors:
- Reduce batch size for embedding generation
- Add swap space for ML model loading
- Use smaller CLIP model variants
Search not working:
- Verify Milvus connection in
config.ini - Check if embeddings were generated successfully
- Restart API server to reload models
- Go logs:
.local/logs/[timestamp].log - Python logs: Check console output
- Web logs: Browser developer console
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
[Your License Here]
For issues and questions:
- Create an issue in the repository
- Check existing documentation
- Review log files for error details
