Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Demo ¶
func Demo(tr *TestResults, classifier *classifier.Classifier) echo.HandlerFunc
Demo creates and returns a new echo Handler that performs demonstration game screenshot verifications
func Index ¶
func Index(tr *TestResults) echo.HandlerFunc
Index is an echo Handler that renders the index template with the given data
Types ¶
type Results ¶
type Results struct { Filename string `json:"filename,omitempty"` Predictions []classifier.Prediction `json:"predictions,omitempty"` SpeedMS int64 `json:"speed_ms,omitempty"` }
Results is a struct containing the results of a classified image
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a struct that contains everything needed to perform image predictions
func (*Service) Classify ¶
Classify is an echo Handler that processes an image and returns its predicted classifications
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template contains pre-processed templates for rendering
type TestResult ¶
type TestResult struct { Filename string `json:"filename,omitempty"` Expected string `json:"expected,omitempty"` Correct bool `json:"correct,omitempty"` Predictions []classifier.Prediction `json:"predictions,omitempty"` SpeedMS int64 `json:"speed_ms,omitempty"` }
TestResult is a struct containing the results of a tested classified image
type TestResults ¶
type TestResults struct { Correct int Accuracy float64 Results []TestResult }
TestResults contains all test results and summary data
func ProcessTestData ¶
func ProcessTestData(classifier *classifier.Classifier, testDir string) (*TestResults, error)
ProcessTestData pre-processes all the test data in the passed testDir, returning the results for serving on the demos index