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.

36 lines
732 B

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. package main
  2. import (
  3. "fmt"
  4. "log"
  5. "net/http"
  6. "strconv"
  7. "time"
  8. )
  9. //dataset := make(Dataset)
  10. var dataset Dataset
  11. func main() {
  12. readConfig("./config.json")
  13. c.Cyan("reading images datasets")
  14. tStart := time.Now()
  15. dataset = readDataset("./dataset")
  16. fmt.Print("time spend reading images: ")
  17. fmt.Println(time.Since(tStart))
  18. fmt.Println("total folders scanned: " + strconv.Itoa(len(dataset)))
  19. numImages := 0
  20. for _, v := range dataset {
  21. numImages = numImages + len(v)
  22. }
  23. c.Cyan("total images in dataset: " + strconv.Itoa(numImages))
  24. //we have the images in the dataset variable
  25. //now, can take images
  26. c.Green("server running")
  27. router := NewRouter()
  28. log.Fatal(http.ListenAndServe(":"+config.ServerPort, router))
  29. }