You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

31 lines
654 B

package main
import (
"fmt"
"strconv"
"time"
)
func main() {
readConfig("./config.json")
c.Cyan("reading images datasets")
tStart := time.Now()
dataset := readDataset("./dataset")
fmt.Print("time spend reading images: ")
fmt.Println(time.Since(tStart))
fmt.Println("total folders scanned: " + strconv.Itoa(len(dataset)))
numImages := 0
for _, v := range dataset {
numImages = numImages + len(v)
}
c.Cyan("total images in dataset: " + strconv.Itoa(numImages))
//we have the images in the dataset variable
//now, can take images
testFile := readImage("./test.jpg")
r := knn(dataset, testFile)
fmt.Println("seems to be a " + r)
}