How saiadarsh16/home_take_assessment works
This repository is a multi-model computer-vision inference API plus a model preparation and validation workflow. The main runtime flow accepts authenticated image requests, runs classification, detection, or embedding inference, and returns results; similarity additionally indexes or searches a caller-scoped gallery, while batch requests are queued and processed asynchronously. The graph includes the documented model lifecycle as a separate capability. Several router, queue, and model-authoring implementations were not sampled, so their internal wiring is shown only where the README or sampled code supports it.
Main entry points: inference_service.py Inference service · main.py FastAPI app · similarity.py Similarity routes · image_processing.py Image validation
Components 22
API and Access
- FastAPI app
api/main.py - Authentication
api/middleware/auth.py - Classification route
api/routers/classification.py - Detection route
api/routers/detection.py - Similarity routes
api/routers/similarity.py - Batch routes
api/routers/batch.py
Inference and Models
- Image validation
api/utils/image_processing.py - Inference service
api/services/inference_service.py - Model serving
api/services/model_service.py - Model artifacts
models
Batch Processing
- Job dispatch
api/dispatcher.py - Batch worker
api/worker.py - Job execution
api/services/jobs.py
State and Operations
- Similarity gallery
api/services/database.py - Cache and quotas
api/services/cache_service.py - Job and audit store
api/services/database.py - Telemetry
api/services/telemetry.py
Model Lifecycle
- Data preparation
models/prepare.py - Model training
models/train.py - Backend export
models/export.py - Model evaluation
models/validate.py
Other components
- API client
Connections 29
- API client → FastAPI app: sends requests
- FastAPI app → Authentication: authenticates
- FastAPI app → Classification route: dispatches
- FastAPI app → Detection route: dispatches
- FastAPI app → Similarity routes: dispatches
- FastAPI app → Batch routes: dispatches
- Classification route → Image validation: reads upload
- Classification route → Inference service: runs task
- Detection route → Image validation: reads upload
- Detection route → Inference service: runs task
- Similarity routes → Image validation: reads upload
- Similarity routes → Inference service: runs task
- Similarity routes → Similarity gallery: reads and writes
- Inference service → Image validation: decodes image
- Inference service → Model serving: predicts
- Inference service → Cache and quotas: reads and writes
- Inference service → Job and audit store: audits inference
- Inference service → Telemetry: records metrics
- Model serving → Model artifacts: loads weights
- Batch routes → Job dispatch: submits jobs
- Job dispatch → Job and audit store: stores job
- Job dispatch → Batch worker: queues job
- Batch worker → Job execution: executes job
- Job execution → Inference service: runs items
- Job execution → Job and audit store: updates job
- Data preparation → Model training: supplies data
- Model training → Backend export: produces weights
- Backend export → Model evaluation: exports for checks
- Backend export → Model artifacts: writes artifacts