Documentation ¶
Index ¶
- func NewCensor() component.Base
- func NewDetector() component.Base
- type Censor
- func (d *Censor) Decode(in payload.Bytes, data payload.Data) (payload.DecodedImage, response.Response)
- func (d *Censor) DecodeStream(in payload.Stream, data payload.Data) (payload.DecodedImage, response.Response)
- func (d *Censor) Encode(in payload.DecodedImage, data payload.Data) (payload.Bytes, response.Response)
- func (d *Censor) Init(config cfg.Config, logger zap.SugaredLogger) error
- func (d *Censor) Process(in payload.DecodedImage, data payload.Data) (payload.DecodedImage, response.Response)
- func (d *Censor) Start() error
- func (d *Censor) Stop() error
- type Detector
- func (d *Detector) Decode(in payload.Bytes, data payload.Data) (payload.DecodedImage, response.Response)
- func (d *Detector) DecodeStream(in payload.Stream, data payload.Data) (payload.DecodedImage, response.Response)
- func (d *Detector) Init(config cfg.Config, logger zap.SugaredLogger) error
- func (d *Detector) Process(in payload.DecodedImage, data payload.Data) response.Response
- func (d *Detector) Start() error
- func (d *Detector) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
func (d *Censor) Decode(in payload.Bytes, data payload.Data) (payload.DecodedImage, response.Response)
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 ¶
func (d *Censor) Encode(in payload.DecodedImage, data payload.Data) (payload.Bytes, response.Response)
Encode will encode Image according to configuration, only supporting encoding into jpeg/png
func (*Censor) Process ¶
func (d *Censor) Process(in payload.DecodedImage, data payload.Data) (payload.DecodedImage, 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, OR censor the image by adding pixels over skin regions will also add "nude" boolean to payload.Data
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 ¶
func (d *Detector) Decode(in payload.Bytes, data payload.Data) (payload.DecodedImage, response.Response)
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