nude

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 10 Imported by: 0

README

nude

图片裸体检测

原项目地址 https://github.com/koyachi/go-nude

start

package main

import "github.com/xzyan/nude"

func main() {
    data, _ := ioutil.ReadFile("demo.png")
    has, e := nude.IsImageNude(&data)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeImage

func DecodeImage(filePath string) (img image.Image, err error)

experimental

func IsImageNude

func IsImageNude(data *[]byte) (r bool, e error)

检测图片是否包含人类裸体

Types

type Detector

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

func (*Detector) Parse

func (d *Detector) Parse() (result bool, err error)

func (*Detector) String

func (d *Detector) String() string

type Pixel

type Pixel struct {
	X int
	Y int

	V float64 // intesitiy(Value) of HSV
	// contains filtered or unexported fields
}

type Region

type Region []*Pixel

TODO: cache caluculated leftMost, rightMost, upperMost, lowerMost.

type Regions

type Regions []Region

func (Regions) Len

func (r Regions) Len() int

func (Regions) Less

func (r Regions) Less(i, j int) bool

func (Regions) Swap

func (r Regions) Swap(i, j int)

Jump to

Keyboard shortcuts

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