BlurItem
Blur a particular item in the image.
This module provides a pipeline element to blur a particular item in the image. There are arguments to specify the item to blur and the shape of the blur. Note that blurring the item will only apply to images extracted by JPEG.
shape
values supported:
circle
box
Examples:
REST API:
WIP
Configuration File:
Blur all faces (circle):
```yaml
source:
- address: videos/sd_london_station_sd.mp4
type: file
elements:
- name: infer
args:
model: yolov5s-face
- name: blur-item
args:
label: face
shape: circle
- name: image-encoder
```
BlurItem Objects
class BlurItem(Element)
Blur a particular item in the image.
Attributes:
name
str - The name of the element.label
str - The item label to blur.shape
str - The shape of the blur.
Examples:
Face (circle):
```python
ele = BlurItem(label="face", shape="circle")
```
Person (box):
```python
ele = BlurItem(label="person", shape="box")
```
process
def process(meta: PipelineMetadata)
Blur the item in the image with a particular shape.
This is the main function for this element. It will take the image and blur the item in the image with a particular shape.
Arguments:
meta
PipelineMetadata - The metadata to process.
Returns:
meta
PipelineMetadata - The processed metadata.
Examples:
```python
meta = BlurItem().process(meta)
```