Exemplo n.º 1
0
func main() {
	flag.Usage = func() {
		flag.PrintDefaults()
	}
	path := flag.String("path", "", "A path of image will be read")
	flag.Parse()

	if *path == "" {
		fmt.Println("Specify a path of image, please")
		return
	}

	img, err := nudely.DecodeImageByPath(*path)
	if err != nil {
		fmt.Println(err)
		return
	}

	detected, rating := nudely.Detect(img)
	fmt.Println(fmt.Sprintf("Rating : %f", rating))
	if detected {
		fmt.Println("I think this is nude.")
		return
	}

	fmt.Println("No nude.")
}
Exemplo n.º 2
0
func main() {
	flag.Usage = func() {
		flag.PrintDefaults()
	}
	path := flag.String("path", "", "A path of image will be read")
	flag.Parse()

	if *path == "" {
		fmt.Println("Specify a path of image, please")
		return
	}

	var src image.Image
	if src = nudely.DecodeImageByPath(*path); src == nil {
		return
	}
	nudely.Detect(src)
}