예제 #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.")
}
예제 #2
0
파일: main.go 프로젝트: kaneshin/go-nudely
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)
}