# m-saad-k/cat-automatic-feeder architecture

> Architecture diagram of the GitHub repository m-saad-k/cat-automatic-feeder, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/m-saad-k/cat-automatic-feeder
- Repository: https://github.com/m-saad-k/cat-automatic-feeder

## Overview

This is an incomplete Raspberry Pi cat-feeder prototype: camera detection and notification helpers exist, while the README describes a broader user-approved feeding workflow. The entry point imports a symbol not defined by camera_op.py, and the sampled code does not connect detection to notifications or the documented GUI/feeding flow. Dashed edges indicate documented capabilities whose implementation or wiring is not present in the sampled source.

Main entry points: [`camera_op.py`](https://github.com/m-saad-k/cat-automatic-feeder/blob/main/camera_op.py) (Camera detection), [`detection-model-library/object-ident-3.py`](https://github.com/m-saad-k/cat-automatic-feeder/blob/main/detection-model-library/object-ident-3.py) (Object detector), [`main.py`](https://github.com/m-saad-k/cat-automatic-feeder/blob/main/main.py) (Application entry), [`detection-model-library/coco.names`](https://github.com/m-saad-k/cat-automatic-feeder/blob/main/detection-model-library/coco.names) (COCO labels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vision["Camera detection"]
  node_main["Application entry<br/>[main.py]"]
  node_camera["Camera detection<br/>[camera_op.py]"]
  node_model_names["COCO labels<br/>[coco.names]"]
  node_model_config["SSD config"]
  node_model_weights["SSD weights"]
  node_camera_hw["Pi camera"]
  node_opencv["OpenCV DNN"]
end

subgraph group_alerts["Alerts and user"]
  node_image_store[("Captured images")]
  node_ntfy["ntfy service"]
  node_phone["User phone"]
  node_gui["Raspcontroller GUI"]
end

subgraph group_feeding["Feeding device"]
  node_object_ident["Object detector<br/>[object-ident-3.py]"]
  node_servo["Servo motor"]
  node_feeder["Feeding box"]
  node_warning["LED and buzzer"]
end

node_user(("Feeder user"))

node_main -->|"imports"| node_camera
node_camera -->|"captures frames"| node_camera_hw
node_camera -->|"runs detection"| node_opencv
node_camera -->|"reads labels"| node_model_names
node_camera -->|"loads config"| node_model_config
node_camera -->|"loads weights"| node_model_weights
node_camera -->|"writes photos"| node_image_store
node_camera -->|"posts photo"| node_ntfy
node_ntfy -->|"notifies"| node_phone
node_object_ident -->|"runs detection"| node_opencv
node_object_ident -->|"moves on detection"| node_servo
node_servo -.->|"dispenses feed"| node_feeder
node_camera -.->|"live feed"| node_gui
node_gui -.->|"shows feed status"| node_user
node_user -.->|"approves feeding"| node_gui
node_gui -.->|"requests dispensing"| node_feeder
node_camera -.->|"signals bird detection"| node_warning

click node_main "https://github.com/m-saad-k/cat-automatic-feeder/blob/main/main.py"
click node_camera "https://github.com/m-saad-k/cat-automatic-feeder/blob/main/camera_op.py"
click node_model_names "https://github.com/m-saad-k/cat-automatic-feeder/blob/main/detection-model-library/coco.names"
click node_model_config "https://github.com/m-saad-k/cat-automatic-feeder/blob/main/detection-model-library/ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt"
click node_model_weights "https://github.com/m-saad-k/cat-automatic-feeder/blob/main/detection-model-library/frozen_inference_graph.pb"
click node_object_ident "https://github.com/m-saad-k/cat-automatic-feeder/blob/main/detection-model-library/object-ident-3.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_camera,node_model_names,node_model_config,node_model_weights,node_camera_hw,node_opencv,node_user toneBlue
class node_image_store,node_ntfy,node_phone,node_gui toneAmber
class node_object_ident,node_servo,node_feeder,node_warning toneMint
```

## Components

### Camera detection

- [Application entry](https://github.com/m-saad-k/cat-automatic-feeder/blob/main/main.py): `main.py`
- [Camera detection](https://github.com/m-saad-k/cat-automatic-feeder/blob/main/camera_op.py): `camera_op.py`
- [COCO labels](https://github.com/m-saad-k/cat-automatic-feeder/blob/main/detection-model-library/coco.names): `detection-model-library/coco.names`
- [SSD config](https://github.com/m-saad-k/cat-automatic-feeder/blob/main/detection-model-library/ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt): `detection-model-library/ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt`
- [SSD weights](https://github.com/m-saad-k/cat-automatic-feeder/blob/main/detection-model-library/frozen_inference_graph.pb): `detection-model-library/frozen_inference_graph.pb`
- **Pi camera**
- **OpenCV DNN**

### Alerts and user

- **Captured images**
- **ntfy service**
- **User phone**
- **Raspcontroller GUI**

### Feeding device

- [Object detector](https://github.com/m-saad-k/cat-automatic-feeder/blob/main/detection-model-library/object-ident-3.py): `detection-model-library/object-ident-3.py`
- **Servo motor**
- **Feeding box**
- **LED and buzzer**

### Other components

- **Feeder user**

## Connections

- Application entry → Camera detection: imports
- Camera detection → Pi camera: captures frames
- Camera detection → OpenCV DNN: runs detection
- Camera detection → COCO labels: reads labels
- Camera detection → SSD config: loads config
- Camera detection → SSD weights: loads weights
- Camera detection → Captured images: writes photos
- Camera detection → ntfy service: posts photo
- ntfy service → User phone: notifies
- Object detector → OpenCV DNN: runs detection
- Object detector → Servo motor: moves on detection
- Servo motor → Feeding box: dispenses feed
- Camera detection → Raspcontroller GUI: live feed
- Raspcontroller GUI → Feeder user: shows feed status
- Feeder user → Raspcontroller GUI: approves feeding
- Raspcontroller GUI → Feeding box: requests dispensing
- Camera detection → LED and buzzer: signals bird detection
