Distributed image analysis pipeline built with React, C++, Redis, Python, PyTorch, OpenCV, and Docker.
The system uses a queue-based architecture to separate HTTP request handling from ML and image-processing workloads.
| Layer | Technology |
|---|---|
| Frontend | React, Vite, CSS |
| API / Orchestration | C++, Crow |
| Queue | Redis, redis-plus-plus |
| ML Worker | Python, PyTorch, TorchVision |
| Image Processing | OpenCV, Pillow, ImageHash |
| Model | Pretrained ResNet18 |
| Containerization | Docker, Docker Compose |
| Build System | CMake |
┌──────────────┐
│ React / Vite │
│ :5173 │
└──────┬───────┘
│ POST /analyze
▼
┌──────────────┐
│ C++ API │
│ Crow :8080 │
└──────┬───────┘
│ LPUSH image_jobs
▼
┌──────────────┐
│ Redis │
│ image_jobs │
└──────┬───────┘
│ BLPOP
▼
┌──────────────┐
│ Python Worker│
│ Docker │
└──────┬───────┘
│ ResNet18 + OpenCV
▼
┌──────────────┐
│ Redis │
│ image_results│
└──────┬───────┘
│ BLPOP
▼
┌──────────────┐
│ C++ API │
└──────┬───────┘
│ JSON
▼
┌──────────────┐
│ React │
└──────────────┘
-
React sends
POST /analyzeto the C++ API. -
The C++ API pushes the image path to the Redis
image_jobsqueue. -
The Python worker blocks on
image_jobs. -
The worker runs:
- ResNet18 classification
- OpenCV image quality analysis
-
The worker serializes the result as JSON.
-
The result is pushed to
image_results. -
The C++ API retrieves the result and returns it to React.
| Queue | Producer | Consumer | Purpose |
|---|---|---|---|
image_jobs |
C++ API | Python Worker | Image analysis jobs |
image_results |
Python Worker | C++ API | Completed analysis results |
C++ API
│
├── LPUSH image_jobs
▼
Redis
│
├── BLPOP image_jobs
▼
Python Worker
│
├── ML + Image Processing
│
└── LPUSH image_results
▼
Redis
│
└── BLPOP image_results
▼
C++ API
image-file-intelligence/
├── backend/
│ ├── main.cpp
│ ├── ImageScanner.cpp
│ ├── ImageMetadata.cpp
│ └── ImageClassifier.cpp
│
├── ml/
│ ├── worker.py
│ ├── image_classifier.py
│ ├── image_quality.py
│ ├── duplicate_detector.py
│ ├── requirements.txt
│ └── Dockerfile
│
├── src/
│ ├── App.jsx
│ └── App.css
│
├── test_images/
├── docker-compose.yml
└── CMakeLists.txt
Install:
- CMake 3.20+
- C++17 compiler
- OpenCV
- Redis++
- Crow
- Docker + Docker Compose
- Node.js + npm
Clone the repository:
git clone <repository-url>
cd image-file-intelligenceInstall frontend dependencies:
npm installdocker compose up -d --buildVerify:
docker compose psExpected services:
image-redis
image-worker
mkdir -p build
cd build
cmake ..
cmake --build ../image_intelligenceAPI:
http://localhost:8080
From the project root:
npm run devFrontend:
http://localhost:5173
Submits an image analysis job and returns the completed worker result.
Request
/app/test_images/<image-name>
Response
{
"image": "/app/test_images/example.png",
"predictions": [
{
"label": "example_label",
"confidence": 0.95
}
],
"quality": "Good"
}cd build
cmake --build .
./image_intelligencecd build
cmake ..
cmake --build .
./image_intelligencedocker compose up -d --build workerVite reloads automatically while running:
npm run devdocker compose up -ddocker compose downdocker compose logs -f worker- React image selection interface
- C++ HTTP API
- Redis-backed job queue
- Dockerized Python worker
- ResNet18 image classification
- Top prediction confidence scores
- OpenCV image quality analysis
- Redis results queue
- End-to-end JSON response to frontend
Full browser file uploads and persistent object storage are future extensions.