nude

package
v0.0.0-...-8375e82 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

README

go-nude

Nudity detection with Go.

(Go porting from https://github.com/pa7/nude.js)

Example

package main

import (
	"fmt"
	"log"
    "github.com/koyachi/go-nude"
)

func main() {
	imagePath := "images/test2.jpg"

	isNude, err := nude.IsNude(imagePath)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("isNude = %v\n", isNude)
}

Other implementations

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

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 IsFileNude

func IsFileNude(imageFilePath string) (bool, error)

func IsImageNude

func IsImageNude(img image.Image) (bool, error)

func IsNude

func IsNude(imageFilePath string) (bool, error)

Types

type Detector

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

func NewDetector

func NewDetector(img image.Image) *Detector

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)

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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