PrimoDev/ apps

Anti-Antitrampo

A webcam attention monitor that plays a video when you get distracted

  • macOS
  • Windows
  • Linux
  • Free
  • Open source
View on GitHub

What is Anti-Antitrampo?

Anti-Antitrampo (Attention Monitor) is a desktop app that uses your webcam to notice when you look away from the screen or pick up your phone. When that happens it plays an MP4 video you chose, and pauses it on its own when you pay attention again.

The README says it's MIT licensed. There's no installer or published release: clone the repository, install the dependencies with pip install -r requirements.txt and run python main.py. The interface is in Portuguese.

What it does

  1. 01Gaze detection with MediaPipe Face Mesh and iris tracking
  2. 02Phone detection in the camera feed with YOLOv8
  3. 03Plays the MP4 video of your choice when your attention drops
  4. 04Pauses the video when you look back and resumes where it left off
  5. 05Turn each detection on or off separately
  6. 06Adjustable gaze tolerance and phone detection confidence
  7. 07Runs at ~15 FPS, tuned for CPU
  8. 08PyQt6 interface with a dark theme

FAQ

Is Anti-Antitrampo free?
Yes. The code is on GitHub and the README states the MIT license.
Does my webcam feed go anywhere?
No. Gaze and phone detection run locally with MediaPipe and YOLOv8, and the code doesn't send camera frames to any server. The only network access is downloading the detection model if it's not already in the folder.
Which operating systems does it run on?
macOS, Windows and Linux, with Python 3.10 or later and a working webcam. On macOS you need to grant camera permission to Terminal or Python.
How do I install it?
Clone the repository, create a virtual environment, run pip install -r requirements.txt and then python main.py. In the app, pick the MP4 video, adjust the detections and start monitoring.
Detection is inaccurate. What can I do?
Adjust the sensitivity sliders, improve the lighting and face the camera. If it's slow, close other apps that use the camera.
How do I stop the video?
Just look back at the screen and it pauses on its own. You can also press ESC to close the video.

Documentation

README from the lucianodiisouza/anti-antitrampo repository, refreshed on every deploy.

Uma aplicação desktop que monitora sua atenção através da webcam e reproduz um vídeo quando detecta que você não está olhando para a tela ou está usando o celular.

Funcionalidades

  • Detecção de olhar: Usa MediaPipe Face Mesh para rastrear a direção do seu olhar
  • Detecção de celular: Usa YOLOv8 para identificar celulares no campo de visão da câmera
  • Reprodução automática: Toca um vídeo MP4 quando a atenção é perdida
  • Pausa inteligente: Pausa o vídeo quando você volta a prestar atenção (continua de onde parou)
  • Interface moderna: GUI em PyQt6 com tema escuro

Requisitos

  • Python 3.10 ou superior
  • Webcam funcional
  • macOS, Windows ou Linux

Instalação

  1. Clone ou baixe este projeto

  2. Crie um ambiente virtual (recomendado):

python -m venv venv
source venv/bin/activate  # Linux/macOS
# ou
venv\Scripts\activate  # Windows
  1. Instale as dependências:
pip install -r requirements.txt

Nota: Na primeira execução, o YOLOv8 vai baixar automaticamente o modelo (~6MB).

Uso

  1. Execute a aplicação:
python main.py
  1. Na interface:

    • Clique em "Select Video (MP4)" para escolher o vídeo que será reproduzido
    • Ajuste as opções de detecção se necessário
    • Clique em "Start Monitoring" para iniciar
  2. O vídeo será reproduzido automaticamente quando:

    • Você desviar o olhar da tela, OU
    • Um celular for detectado na imagem
  3. Pressione ESC para fechar o vídeo manualmente, ou simplesmente olhe de volta para a tela.

Configurações

Opções de Detecção

  • Detect gaze direction: Ativa/desativa a detecção de olhar
  • Detect phone usage: Ativa/desativa a detecção de celular

Sensibilidade

  • Gaze tolerance: Quanto você pode desviar o olhar antes de ser considerado "não olhando"
  • Phone detection confidence: Nível de confiança mínimo para considerar que há um celular

Estrutura do Projeto

attwhore/
├── main.py              # Ponto de entrada
├── requirements.txt     # Dependências
├── README.md            # Este arquivo
├── src/
│   ├── __init__.py
│   ├── app.py           # Interface principal
│   ├── camera.py        # Worker de câmera
│   ├── player.py        # Player de vídeo
│   └── detectors/
│       ├── __init__.py
│       ├── gaze.py      # Detector de olhar
│       └── phone.py     # Detector de celular
└── videos/              # Coloque seus vídeos aqui

Troubleshooting

Câmera não detectada

  • Verifique se a webcam está conectada e funcionando
  • Em macOS, conceda permissão de câmera para o Terminal/Python

Detecção imprecisa

  • Ajuste os sliders de sensibilidade
  • Certifique-se de ter boa iluminação
  • Posicione-se de frente para a câmera

Performance lenta

  • O app processa ~15 FPS por padrão, otimizado para CPU
  • Feche outros aplicativos que usam a câmera

Tecnologias Utilizadas

  • OpenCV: Captura de vídeo
  • MediaPipe: Detecção facial e rastreamento de íris
  • YOLOv8: Detecção de objetos (celular)
  • PyQt6: Interface gráfica

Licença

MIT License