Back to projects
AI & MLSource available

Case study

People density analysis

A resilient Python microservice pipeline that queues image analysis, runs YOLO inference, and stores results asynchronously.

Project overview

Category
AI & ML

Technology

  • Python
  • FastAPI
  • PostgreSQL
  • RabbitMQ
  • YOLO
  • Docker

Project links

Inside the project

Context

This university project explores how an AI inference task can be delivered as a reliable distributed system rather than a single blocking endpoint. Clients submit an image URL, processing happens asynchronously, and the final people count is made available through a separate results service.

Role

I designed and implemented the service boundaries, APIs, RabbitMQ topology, processing workers, delivery workflow, persistence layer, and safeguards around remote image downloads.

Constraints

Image inference can be slow or fail for reasons outside the application. The architecture therefore needed durable queues, controlled retries, isolated responsibilities, and protection against server-side request forgery when workers download user-provided URLs.

Approach

A FastAPI queueing service accepts jobs and publishes them to RabbitMQ. A processing worker securely downloads each image, runs Ultralytics YOLO inference, and publishes the result to a separate queue. A delivery worker forwards completed results to a FastAPI service backed by PostgreSQL. Dead-letter exchanges and exponential backoff provide reliable retry paths without coupling inference to API response time.

Outcome

The result is a modular, container-ready pipeline in which ingestion, AI processing, result delivery, and storage can scale independently. Failures are visible and recoverable, while the public-facing API remains responsive even when inference takes longer.

Lessons

The project showed that production-minded AI work is largely systems engineering. Clear message contracts, idempotent delivery, retry policies, and defensive networking are what turn a model invocation into a dependable service.

A resilient Python microservice pipeline that queues image analysis, runs YOLO inference, and stores results asynchronously.

Explore all projects