# chitra123-hub/sackbag-counting architecture

> Architecture diagram of the GitHub repository chitra123-hub/sackbag-counting, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chitra123-hub/sackbag-counting
- Repository: https://github.com/chitra123-hub/sackbag-counting

## Overview

This repository is a collection of standalone computer-vision scripts, not a shared application. The main workflow tracks sackbags in a video, counts each tracked object crossing a line, and saves and displays the annotated video. Separate scripts inspect video metadata, run image detection and save/display annotations, or load a model and print its class names. The tree and excerpts show no shared internal runtime layer; the empty file and trivial greeting script do not represent product capabilities.

Main entry points: [`counting item.py`](https://github.com/chitra123-hub/sackbag-counting/blob/main/counting%20item.py) (Video Counter), [`testimage.py.py`](https://github.com/chitra123-hub/sackbag-counting/blob/main/testimage.py.py) (Image Detector), [`check count.py`](https://github.com/chitra123-hub/sackbag-counting/blob/main/check%20count.py) (Video Probe), [`from ultralytics import YOLO.py`](https://github.com/chitra123-hub/sackbag-counting/blob/main/from%20ultralytics%20import%20YOLO.py) (Model Inspector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_video["Video Processing"]
  node_counting["Video Counter<br/>[counting item.py]"]
  node_probe["Video Probe<br/>[check count.py]"]
end

subgraph group_image["Image Detection"]
  node_image_detect["Image Detector<br/>[testimage.py.py]"]
  node_inspect["Model Inspector"]
end

node_input_video["Input Video"]
node_input_image["Input Image"]
node_model_file["Model Weights"]
node_ultralytics["Ultralytics YOLO"]
node_opencv["OpenCV"]
node_output_video["Annotated Video"]
node_output_image["Annotated Image"]
node_display["Display Window"]

node_counting -->|"reads frames"| node_input_video
node_counting -->|"loads weights"| node_model_file
node_counting -->|"tracks objects"| node_ultralytics
node_counting -->|"processes frames"| node_opencv
node_counting -->|"writes video"| node_output_video
node_counting -->|"shows frames"| node_display
node_probe -->|"reads metadata"| node_input_video
node_probe -->|"opens video"| node_opencv
node_image_detect -->|"loads image"| node_input_image
node_image_detect -->|"loads weights"| node_model_file
node_image_detect -->|"predicts objects"| node_ultralytics
node_image_detect -->|"saves and displays"| node_opencv
node_image_detect -->|"writes annotation"| node_output_image
node_image_detect -->|"shows annotation"| node_display
node_inspect -->|"loads weights"| node_model_file
node_inspect -->|"reads class names"| node_ultralytics

click node_counting "https://github.com/chitra123-hub/sackbag-counting/blob/main/counting%20item.py"
click node_probe "https://github.com/chitra123-hub/sackbag-counting/blob/main/check%20count.py"
click node_image_detect "https://github.com/chitra123-hub/sackbag-counting/blob/main/testimage.py.py"
click node_inspect "https://github.com/chitra123-hub/sackbag-counting/blob/main/from%20ultralytics%20import%20YOLO.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_counting,node_probe toneBlue
class node_image_detect,node_inspect toneAmber
class node_input_video,node_input_image,node_model_file,node_ultralytics,node_opencv,node_output_video,node_output_image,node_display toneIndigo
```

## Components

### Video Processing

- [Video Counter](https://github.com/chitra123-hub/sackbag-counting/blob/main/counting%20item.py): `counting item.py`
- [Video Probe](https://github.com/chitra123-hub/sackbag-counting/blob/main/check%20count.py): `check count.py`

### Image Detection

- [Image Detector](https://github.com/chitra123-hub/sackbag-counting/blob/main/testimage.py.py): `testimage.py.py`
- [Model Inspector](https://github.com/chitra123-hub/sackbag-counting/blob/main/from%20ultralytics%20import%20YOLO.py): `from ultralytics import YOLO.py`

### Other components

- **Input Video**
- **Input Image**
- **Model Weights**
- **Ultralytics YOLO**
- **OpenCV**
- **Annotated Video**
- **Annotated Image**
- **Display Window**

## Connections

- Video Counter → Input Video: reads frames (evidence: `counting item.py`)
- Video Counter → Model Weights: loads weights (evidence: `counting item.py`)
- Video Counter → Ultralytics YOLO: tracks objects (evidence: `counting item.py`)
- Video Counter → OpenCV: processes frames (evidence: `counting item.py`)
- Video Counter → Annotated Video: writes video (evidence: `counting item.py`)
- Video Counter → Display Window: shows frames (evidence: `counting item.py`)
- Video Probe → Input Video: reads metadata (evidence: `check count.py`)
- Video Probe → OpenCV: opens video (evidence: `check count.py`)
- Image Detector → Input Image: loads image (evidence: `testimage.py.py`)
- Image Detector → Model Weights: loads weights (evidence: `testimage.py.py`)
- Image Detector → Ultralytics YOLO: predicts objects (evidence: `testimage.py.py`)
- Image Detector → OpenCV: saves and displays (evidence: `testimage.py.py`)
- Image Detector → Annotated Image: writes annotation (evidence: `testimage.py.py`)
- Image Detector → Display Window: shows annotation (evidence: `testimage.py.py`)
- Model Inspector → Model Weights: loads weights (evidence: `from ultralytics import YOLO.py`)
- Model Inspector → Ultralytics YOLO: reads class names (evidence: `from ultralytics import YOLO.py`)
