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
737 B

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. package main
  2. import (
  3. "fmt"
  4. "log"
  5. "net/http"
  6. "strconv"
  7. "time"
  8. )
  9. //array of datasets
  10. var datasets []Dataset
  11. func main() {
  12. readConfig("./config.json")
  13. c.Cyan("reading images datasets")
  14. tStart := time.Now()
  15. datasets = readDataset("./dataset")
  16. fmt.Print("time spend reading images: ")
  17. fmt.Println(time.Since(tStart))
  18. fmt.Println("total folders scanned: " + strconv.Itoa(len(datasets[0])))
  19. numImages := 0
  20. for _, v := range datasets[0] {
  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. }