nsfw

package module
v0.0.0-...-d5b32f8 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 16 Imported by: 0

README

NSFW Image Classifier

A Go port of the GantMan's nsfw_model for nudity detection and classification using TensorFlow

Documentation

Index

Constants

View Source
const (
	DefaultCachePath = "./.models/"
)
View Source
const (
	ImageDimensions = 224
)

Variables

View Source
var (
	ErrNoneCached = errors.New("no cached models")
)

Functions

This section is empty.

Types

type Path

type Path string

func GetLatestModelPath

func GetLatestModelPath() (Path, error)

func GetLocalModelPath

func GetLocalModelPath() (Path, error)

func (Path) GetModel

func (p Path) GetModel() *tg.Model

func (Path) String

func (p Path) String() string

type Prediction

type Prediction struct {
	Drawings float32
	Hentai   float32
	Neutral  float32
	Porn     float32
	Sexy     float32
}

func (Prediction) Describe

func (p Prediction) Describe() string

type Predictor

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

func NewLatestPredictor

func NewLatestPredictor() (*Predictor, error)

func NewPredictor

func NewPredictor(model *tg.Model) *Predictor

func (*Predictor) NewImage

func (p *Predictor) NewImage(filepath string, channels int64) *image.Image

func (*Predictor) Predict

func (p *Predictor) Predict(img *image.Image) Prediction

func (*Predictor) UseScope

func (p *Predictor) UseScope(s *op.Scope)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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