Skip to main content

FireDetection

Detects and returns a bounding rectangle around the fire.

This module provides an pipeline element to detect fire in a given frame using OpenCV library.

Examples:

REST API:

WIP

Configuration File:

short-from : fire-detection:<i-maxROF>:<i-dim1>:<i-dim2>

source:
- address: videos/fire-detection.mp4
- type: file
pipeline:
- fire-detection:1:640:480

FireDetection Objects

class FireDetection(Element)

Detects and returns a bounding rectangle around the fire.

Attributes:

  • name str - The name of the element.
  • maxROF int - The number of fire regions to be detected per frame.
  • dim1 int - The width to which the input frame is reduced to.
  • dim2 int - The height to which the input frame is reduced to.

Examples:

ele = FireDetection("1", "640", "480")

extract_params

 | @staticmethod
| def extract_params(model_params)

Extract the parameters for this element.

Arguments:

  • model_params List[str] - The parameters for this element.

Returns:

  • item str - The item to blur.
  • maxROF int - The number of fire regions to be detected per frame.
  • dim1 int - The width to which the input frame is reduced to.
  • dim2 int - The height to which the input frame is reduced to.

Raises:

  • ExtractParameterException - If the parameters are not valid.

Examples:

params = FireDetection.extract_params(["1", "640", "480"])
ele = FireDetection(*params)

process

 | def process(meta)

Process the bounding boxes.

This is the main function for this element. It will detect fire in the given frame and draw a bounding box around the detected fire.

Arguments:

  • meta dict - The metadata to process.

Returns:

  • meta dict - The processed metadata.

Examples:

ele = FireDetection("1", "640", "480")
meta = ele.process(meta)