> For the complete documentation index, see [llms.txt](https://docs.augelab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.augelab.com/function-blocks/blocks-reference/ai-blocks/safety-equipment-detection.md).

# Safety Equipment Detection

This function block checks for common safety equipments on an input image and returns an annotated image plus per-class counts. It is intended for visual inspection workflows where helmets, vests, goggles and gloves must be detected and counted.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

`Image` Provide the image you want analyzed (single image frames, stream frames, or loaded images).

## 📤 Outputs <a href="#outputs" id="outputs"></a>

`Output Image` Annotated image with detections drawn for visualization.\
`Helmet Count` Number of detected helmets.\
`Safety Vest Count` Number of detected safety vests.\
`Safety Goggle Count` Number of detected safety goggles.\
`Safety Glove Count` Number of detected safety gloves.\
`No Helmet Count` Number of detected people without helmets.\
`No Safety Vest Count` Number of detected people without vests.\
`No Safety Goggle Count` Number of detected people without goggles.\
`No Safety Glove Count` Number of detected people without gloves.

## 🕹️ Controls <a href="#controls" id="controls"></a>

`Confidence Ratio` Adjust detection confidence threshold. Higher values make detections stricter (fewer false positives); lower values increase sensitivity (more detections, possibly more false positives).

Tip: start around 0.7–0.9 and fine-tune based on your scene.

## 🎯 Features <a href="#features" id="features"></a>

* Real-time visual feedback with annotated detections on `Output Image`.
* Per-class counting for both presence and absence of required safety items.
* Adjustable detection confidence using `Confidence Ratio` to suit varying lighting and scene conditions.
* Designed to work with live camera frames or pre-recorded images.

## ⚙️ How it runs <a href="#running-mechanism" id="running-mechanism"></a>

When an image is provided on the `Image` input, the block analyzes the image, marks detected safety items on a visual output image and returns numeric counts for each class. The block may require a short loading time on first run (model preparation), after which it processes images continuously as they arrive.

## 📝 Usage Instructions <a href="#usage" id="usage"></a>

1. Provide an image source to the `Image` input (live camera feed or loaded image).
2. Adjust `Confidence Ratio` to suit your scene (lighting, scale, occlusions).
3. Use the annotated `Output Image` to visually confirm detections and read numeric outputs for automation or logging.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* Combine with live camera inputs for continuous monitoring: e.g., `Camera USB`, `Camera IP`, or `Stream Reader` to feed frames into this block.
* To visualize and inspect frames interactively, connect the visual output to `Show Image` and use the `See Image` viewer.
* Improve detection focus and reduce false positives by cropping to the area of interest using `Image ROI Select` before feeding images to this block.
* Speed up processing when full resolution is unnecessary by inserting `Image Resizer` before this block.
* Overlay or emphasize detection boxes using `Draw Detections` for clearer on-screen presentation.
* For multi-frame workflows, combine with tracking: feed detection outputs (rectangles / classes) into `Object_Detection_Tracker` to maintain IDs over time and count unique persons.
* Log and export results: use `Image Logger` or `Image Write` to save frames, and `CSV Export` or `Data to JSON` to store counts. For real-time alerts integrate with `MQTT Publish` or `Send Mail` for notifications.
* For crowd or distancing analysis, use together with `Social Distance Detector` or `Pose Estimation` to correlate PPE usage with person location or posture.

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* No detections or too many false positives: adjust `Confidence Ratio` and re-evaluate. Try values between 0.6 and 0.9.
* Poor results in low-light or low-contrast scenes: improve lighting, use `Contrast Optimization` or `Denoising` prior to this block.
* Detections outside the area of interest: add `Image ROI Select` to limit the search area.
* Slow performance: reduce input image size with `Image Resizer` or lower frame rate upstream. Performance also depends on available hardware.
* If the block is not ready on first use, allow a short time for model preparation (loading) before expecting outputs.
