Work
OwnOwn product · Computer vision
UPC

Carnet UPC

Photo processing for university ID cards with face detection and automatic adjustment.

Screenshot of Carnet UPC (1/2)
Screenshot of Carnet UPC (2/2)
SYSTEM.md

The problem

Adapting a photo by hand to the size, background and weight an ID card requires is repetitive.

What I built

A computer vision pipeline in FastAPI: MediaPipe detects the face, rembg removes the background, and OpenCV and Pillow fit the image to 240 × 288 pixels. The interface is in Next.js.

Outcome

It automates preparing photos for ID cards. No public demo yet.

Decisions that mattered

  1. 01

    Specialized processing

    MediaPipe frames the face, rembg (ONNX) separates the figure, and OpenCV and Pillow handle size, DPI and weight.

  2. 02

    Validate from the start

    The TypeScript interface validates the input before sending it to the decoupled backend.

Technologies

  • Next.js
  • FastAPI
  • MediaPipe
  • rembg
  • OpenCV
  • Cloudinary

C4 model. The pulsing line is the main path of a request.

Level 1 · who uses the system and what it connects to

HTTPS1HTTPS2StudentUploads their photoCarnet UPCPhoto in the officialformatCloudinary[Cloudinary]Stores the images

Level 2 · the applications and data stores it is made of

Browser1REST ·multipart2HTTPS3StudentUploads their photoInterface[Next.js · Vercel]Validates and sends thephotoImage API[FastAPI · Python · PaaS]Detects, segments andcompressesCloudinary[Cloudinary]Stores the images

Level 3 · the components inside the API

image1crop2figure3240×288 · 300 DPI4Process endpoint[FastAPI · /process]Receives the photoFace detection[MediaPipe]Frames the headSegmentation[rembg · ONNX]Removes the backgroundFit and compression[OpenCV · Pillow]240 × 288 px, 4–50 KBCloudinary[Cloudinary]Stores the images
  • Person
  • System
  • Container
  • External
  • Main path
  1. 01Photo
  2. 02Detection
  3. 03Segmentation
  4. 04Fitting
  5. 05Download

CV

Get my CV

Leave your email and I will send the CV there. First I check the address is yours with a code.