Skip to main content

CollisionDetection

Detects collisions and near-miss scenarios between vehicles.

This module provides a pipeline element to return two boolean flags per detection for the same, along with an aggregated collision and near miss count.

Notes:

  • This algorithm takes in detections of the following object classes - 'person', 'car' and 'bicycle'
  • The algorithm only detects the occurrence of collision between vehicles, it does not perform any prediction.
  • This algorithm uses change in acceleration of vehicles as a primary threshold for collision, hence it will not work in scenarios where collisions occur without acceleration.
  • A near-miss indicates that the vehicle's change in acceleration is above a certain threshold. This condition is checked for all vehicles, independent of other vehicles.

Examples:

REST API:

WIP

Configuration File:

```yaml
source:
- address: videos/collision_demo.mp4
type: file
elements:
- name: infer
args:
model: person-vehicle-bike-detection-crossroad-0078
score_threshold: 0.6
iou_threshold: 0.4
- name: collision-detection
```

CollisionDetection Objects

class CollisionDetection(Element)

Detects collisions and near-miss scenarios between vehicles.

Attributes:

  • name str - The name of the element.

Examples:

```python
ele = CollisionDetection()
```

process

def process(meta: PipelineMetadata)

Process the bounding boxes.

This is the main function for this element. It returns two boolean flags per detection for the same, along with an aggregated collision and near miss count.

Arguments:

  • meta PipelineMetadata - The metadata to process.

Returns:

  • meta PipelineMetadata - The processed metadata.

Examples:

```python
ele = CollisionDetection()
meta = ele.process(meta)
```