Metadata-Version: 2.4
Name: shsk_suspiciousness
Version: 1.0.7
Summary: Local YOLO video analysis desktop application
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: Flask<4,>=3.0
Requires-Dist: opencv-python<5,>=4.8
Requires-Dist: ultralytics<9,>=8.2
Requires-Dist: ensemble_boxes<2,>=1
Requires-Dist: customtkinter<6,>=5.2
Requires-Dist: Pillow<12,>=10.0

# Sentinel Vision: YOLO Video Detector

This project includes a native desktop application for Windows. It runs video
inference locally with a modern CustomTkinter interface and does not require a
browser or a local web server.

This application supports exactly three processing modes:

- **Model 1**: uses `models/best1.pt` | ` best_aug_cv_2.pt `  only.
- **Model 2**: uses `models/best2.pt` |  `best_cv_5`  only.
- **Ensemble**: runs `best1.pt` and `best2.pt` on the same frame and combines their predictions with Weighted Box Fusion.

The ensemble is **logic**, not a third model file.

## Dataset classes

The supplied `data.yaml` defines:

- 0 = mask
- 1 = spectacle
- 2 = helmet
- 3 = balaclava

These classes are allowed to overlap in the initial configuration. No global cross-class suppression is applied because, for example, a helmet and spectacle can legitimately appear in the same region.

## Run the desktop application

1. Put the trained weights in `models/`:

```text
models/best1.pt
models/best2.pt
```

2. Create a virtual environment and install packages:

```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```

3. Start the desktop application:

```bash
python app.py
```

Select a video, choose Model 1, Model 2, or Ensemble, and press **Analyze
video**. The result is previewed inside the application and saved in
`outputs/`.

## Run the legacy web application

The original browser interface remains available when needed:

```text
python app.py --web
```

Then open `http://127.0.0.1:5000`.

On a Raspberry Pi, access it from another device using the Pi's LAN IP, for example:

```text
http://192.168.1.50:5000
```

## Raspberry Pi tuning

`config.py` contains the main tuning controls.

Start with:

```python
FRAME_SKIP = 1
```

If inference is too slow on the Pi, try 2, 3, or 5. Skipped frames reuse the last detection result, so the output video remains annotated while the detector runs less frequently.

The current statistics count **detection occurrences across analyzed frames**, not unique physical objects. Unique-object counting requires an object tracker and should be added separately.
