Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        emoNet.Invoke(webcamTexture);
        var results = emoNet.GetResults();

        emotionName.text = EmotionResultsMapper.map(results);
    }
        public void MapSuccess()
        {
            float[] neuralNetworkResults =
            {
                0.1f,
                0.2f,
                0.3f,
                0.4f,
                0.5f,
                0.6f,
                0.7f
            };

            var    result = EmotionResultsMapper.map(neuralNetworkResults);
            string expectedHumanResult = "ANGRY: 0.1 \nDISGUST: 0.2 \nSCARED: 0.3 \nHAPPY: 0.4 \nNEUTRAL: 0.5\nSAD: 0.6 \nSURPRISED:0.7:\n\nCURRENT EMOTION:SURPRISED\n ";

            Assert.AreEqual(expectedHumanResult, result);
        }
        public void MapFailResultDoesNotHaveCorrectDimensions()
        {
            var result = EmotionResultsMapper.map(new float[6]);

            Assert.IsTrue(result == "Error: NN output has incorrect dimensions");
        }