nude

package
v0.0.1-0...-a0864a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCensor

func NewCensor() component.Base

NewCensor Return a new Censor Base

func NewDetector

func NewDetector() component.Base

NewDetector Return a new Detector Base

Types

type Censor

type Censor struct {
	// contains filtered or unexported fields
}

Censor plugin will read an image and comes-up with the likely hood that this image contains nudity, and will censor the image with configured color pixels. It can be configured to send a NoAck when it detects nudity and will a boolean flag "nude" to payload.Data

func (*Censor) Decode

Decode return a decoded header(config) and image format from input bytes

func (*Censor) DecodeStream

func (d *Censor) DecodeStream(in payload.Stream, data payload.Data) (payload.DecodedImage, response.Response)

DecodeStream return a decoded header(config) and image format from input stream

func (*Censor) Encode

Encode will encode Image according to configuration, only supporting encoding into jpeg/png

func (*Censor) Init

func (d *Censor) Init(config cfg.Config, logger zap.SugaredLogger) error

Init file validator

func (*Censor) Process

process process will process the image and calculate skin regions and the likelihood it's a nude image, according to configuration, process will either send a NoAck to Drop the image, OR censor the image by adding pixels over skin regions will also add "nude" boolean to payload.Data

func (*Censor) Start

func (d *Censor) Start() error

Start validator plugin

func (*Censor) Stop

func (d *Censor) Stop() error

Stop validator plugin

type Detector

type Detector struct {
	// contains filtered or unexported fields
}

Detector plugin will read an image and comes-up with the likely hood that this image contains nudity, Detector is a read-only plugin with no output. it can be configured to send a NoAck when it detects nudity or just add a flag to payload.Data

func (*Detector) Decode

Decode return a decoded header(config) and image format from input bytes

func (*Detector) DecodeStream

func (d *Detector) DecodeStream(in payload.Stream, data payload.Data) (payload.DecodedImage, response.Response)

DecodeStream return a decoded header(config) and image format from input stream

func (*Detector) Init

func (d *Detector) Init(config cfg.Config, logger zap.SugaredLogger) error

Init file validator

func (*Detector) Process

func (d *Detector) Process(in payload.DecodedImage, data payload.Data) response.Response

process process will process the image and calculate skin regions and the likelihood it's a nude image, according to configuration, process will either send a NoAck to Drop the image according to configuration, otherwise will add "nude" boolean to payload.Data

func (*Detector) Start

func (d *Detector) Start() error

Start validator plugin

func (*Detector) Stop

func (d *Detector) Stop() error

Stop validator plugin

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL