Automatic Mafia

  1. Home
  2. Automatic Mafia

Automatic Mafia

A desktop application that registers participants of a mafia game from a local camera, keeps a stable player number and face identity for each of them, and gives the host a control flow for the game. A second window works as a public board.

The vision part runs in worker processes and never writes game actions. The game state lives in a single store, and the public board only receives filtered public data.

  • Category :Desktop App / Computer Vision
  • Stack :Python, PySide6, OpenCV, face_recognition, dlib
  • Windows :Host control window + public board
  • Identity :Stable numbers + face database
  • Data :Local files only
  • Source :GitHub repository
  • Status :Prototype complete

Core Features

The prototype turns a physical party game into a managed session: the camera handles who is who, the host handles the game.

  • Registration of participants from a local camera.
  • Stable player numbers and face identities for the whole session.
  • Position-based track holding when a face is briefly lost.
  • A manual host flow for roles, phases and night actions.
  • A separate public board that shows only public data.
  • Elimination reasons stored per participant.

“Vision must not write game actions: the game store is the only source of truth.”

Design Note - Separated Responsibilities

Architecture

Two Qt windows run in one process. A camera worker handles capture and face registration with OpenCV and face_recognition, and feeds the session store with participants, photos and stable numbers. A game store owns roles, phases and night rules. A controller connects them to the host window and to the public board, filtering what the board may show. All data stays in local files.

Session Flow

  • The camera worker detects and registers faces.
  • The session store assigns stable player numbers.
  • The host starts the game and assigns roles in the control window.
  • Night and day phases are handled by the game store.
  • The public board shows only filtered public data.
  • Eliminations and reasons are recorded per participant.

What It Shows

  • Computer vision in a real interactive application.
  • Clean separation between vision, session state and game rules.
  • Desktop UI with two windows in one process.
  • Privacy by design: local data and a filtered public view.

Related Projects

SplitBill

SplitBill

Next.js / TypeScript / Supabase
Voice Generator Workspace

Voice Generator Workspace

Python / Text-to-Speech / Voice ML
NASA Exoplanet AI

NASA Exoplanet AI

Neural Network / Kepler, K2, TESS / C++

Project Summary

Send a direct message about this project and it will be delivered to my email.