Fix missing TextAsset + other panel use + double use of 'Slecht' sign

This commit is contained in:
Dries Van Schuylenbergh
2023-04-19 22:22:38 +02:00
parent 5ee7add6b9
commit 92c3101db8
9 changed files with 35 additions and 45 deletions

View File

@@ -20,27 +20,27 @@ MonoBehaviour:
- name: Tot ziens
image: {fileID: 21300000, guid: f2a020e24bfa24842bccecf6b36d5b79, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
thresholdPercentage: 0.7
clip: {fileID: 32900000, guid: 199075a9c3138354db43569bade8faaa, type: 3}
- name: Saluut
image: {fileID: 21300000, guid: 9736ebf7e194d954e8db0c651e72210e, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
thresholdPercentage: 0.65
clip: {fileID: 32900000, guid: b3ffa09a793bc8742b894a0d90945739, type: 3}
- name: Goedemorgen
image: {fileID: 21300000, guid: 3d2e3ec9ed08795429f60c10f335196b, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
thresholdPercentage: 0.95
clip: {fileID: 32900000, guid: 088520ac18815d249a627b939d919b87, type: 3}
- name: Goedemiddag
image: {fileID: 21300000, guid: bf52126d7537c894ca4b576c5eef699b, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
thresholdPercentage: 0.65
clip: {fileID: 32900000, guid: 07593101fbf5f5b48a6081618c359d43, type: 3}
- name: Goed
image: {fileID: 21300000, guid: df027cf65fb04bd408d4062aa9ec0b0f, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
thresholdPercentage: 0.95
clip: {fileID: 32900000, guid: f9af6f8ba451f9045bb13cb87b5b2945, type: 3}
- name: Slecht
image: {fileID: 21300000, guid: 42286591a195a7542a4f0922fbe161e2, type: 3}
@@ -50,7 +50,7 @@ MonoBehaviour:
- name: Ja
image: {fileID: 21300000, guid: 0b11c08cf900cd041afab0419594dac2, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
thresholdPercentage: 0.6
clip: {fileID: 32900000, guid: d514b6143c06749489a4a727a10913f0, type: 3}
- name: Links
image: {fileID: 21300000, guid: 1dbac4bae035dc84f8bb19045a290b3c, type: 3}
@@ -60,40 +60,35 @@ MonoBehaviour:
- name: Rechts
image: {fileID: 21300000, guid: 712e26ec9b082ad4bb926c4171815e47, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
thresholdPercentage: 0.6
clip: {fileID: 32900000, guid: 51936adbe64aee644b81a10958ceba9e, type: 3}
- name: Dank u
- name: Bedanken
image: {fileID: 21300000, guid: ae9e448e11485c54aa664b69833dce2f, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
thresholdPercentage: 0.6
clip: {fileID: 32900000, guid: ea0208d218c503b42ba7c0b819127344, type: 3}
- name: Sorry
image: {fileID: 21300000, guid: 4d265c68fdb4f644ba22e74523ba7f1b, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
thresholdPercentage: 0.95
clip: {fileID: 32900000, guid: d53e61ab6d142164c94776d4ea62edb7, type: 3}
- name: Goedenacht
image: {fileID: 21300000, guid: 77bad74134ac6cd439cc026dafffa3aa, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
thresholdPercentage: 0.6
clip: {fileID: 32900000, guid: 4d6c8346776deb7449acf087232e640a, type: 3}
- name: Smakelijk
image: {fileID: 21300000, guid: 650f938e5cacbc2409939ab73077b692, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
thresholdPercentage: 0.7
clip: {fileID: 32900000, guid: 436159822cb53bc4b8d1bcbf83d109ce, type: 3}
- name: Goedeavond
- name: Goedenavond
image: {fileID: 21300000, guid: 1df76d321ac1c984e8809e92a5ae6d5f, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
thresholdPercentage: 0.8
clip: {fileID: 32900000, guid: 5b201af7cea977c4c9bfac53553d4351, type: 3}
- name: Nee
image: {fileID: 21300000, guid: 9107fcdcf02ace74bae5b8dd77835434, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
thresholdPercentage: 0.6
clip: {fileID: 32900000, guid: c869292eee244624589e5bfbdd43bb09, type: 3}
- name: Slecht
image: {fileID: 21300000, guid: 42286591a195a7542a4f0922fbe161e2, type: 3}
handGuide: {fileID: 0}
thresholdPercentage: 0.9
clip: {fileID: 32900000, guid: e552e225d0f46964ea9ee79070e9f03c, type: 3}

View File

@@ -1624,6 +1624,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
modelList: {fileID: 11400000, guid: 39516e4e6e56f0f4f80647d9c4d8034c, type: 2}
modelInfoFile: {fileID: 4900000, guid: fb8b51022bdcd654a9f29c054832a1b5, type: 3}
modelInfoFileEmbedding: {fileID: 4900000, guid: 4e303164823194bc4be87f4c9550cfd0, type: 3}
configAsset: {fileID: 4900000, guid: 6288c43cdca97374782dac1ea87aa029, type: 3}
screen: {fileID: 0}
--- !u!4 &883853269

View File

@@ -402,7 +402,7 @@ public class CoursesController : AbstractFeedback
if (signPredictor != null && signPredictor.learnableProbabilities != null &&
currentSign != null && signPredictor.learnableProbabilities.ContainsKey(currentSign))
{
Debug.Log($"{signPredictor.learnableProbabilities.Aggregate("", (t, e) => $"{t}{e.Key}={e.Value}, ")}");
//Debug.Log($"{signPredictor.learnableProbabilities.Aggregate("", (t, e) => $"{t}{e.Key}={e.Value}, ")}");
float accCurrentSign = signPredictor.learnableProbabilities[currentSign];
// Get highest predicted sign
@@ -499,7 +499,8 @@ public class CoursesController : AbstractFeedback
if (current == predicted)
{
hasAnswered = true;
progress.UpdateLearnable(predicted, 1.5f);
var p = progress.learnables.Find((l) => l.name.ToUpper().Replace(" ", "-") == predicted);
progress.UpdateLearnable(p.name, 1.5f);
confettiAnimation.SetTrigger("Display Confetti");
StartCoroutine(WaitNextSign());
}

View File

@@ -8758,6 +8758,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
modelList: {fileID: 11400000, guid: 39516e4e6e56f0f4f80647d9c4d8034c, type: 2}
modelInfoFile: {fileID: 4900000, guid: fb8b51022bdcd654a9f29c054832a1b5, type: 3}
modelInfoFileEmbedding: {fileID: 4900000, guid: 4e303164823194bc4be87f4c9550cfd0, type: 3}
configAsset: {fileID: 4900000, guid: 6288c43cdca97374782dac1ea87aa029, type: 3}
screen: {fileID: 0}
--- !u!4 &1991376312

View File

@@ -1855,6 +1855,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
modelList: {fileID: 11400000, guid: 39516e4e6e56f0f4f80647d9c4d8034c, type: 2}
modelInfoFile: {fileID: 4900000, guid: fb8b51022bdcd654a9f29c054832a1b5, type: 3}
modelInfoFileEmbedding: {fileID: 4900000, guid: 4e303164823194bc4be87f4c9550cfd0, type: 3}
configAsset: {fileID: 4900000, guid: 6288c43cdca97374782dac1ea87aa029, type: 3}
screen: {fileID: 0}
--- !u!4 &1150323776

View File

@@ -12,7 +12,7 @@ using Random = UnityEngine.Random;
/// Contains all game logic for the JustSign game
/// </summary>
public class JustSignController : AbstractFeedback
{
{
/// <summary>
/// All of the words that can be used in this session
/// </summary>
@@ -73,7 +73,7 @@ public class JustSignController : AbstractFeedback
/// Reference to the webcam
/// </summary>
public RawImage webcamScreen;
/// <summary>
/// Score obtained when getting a perfect hit
/// </summary>
@@ -283,7 +283,7 @@ public class JustSignController : AbstractFeedback
/// Sprite shown when sign leaves screen
/// </summary>
public Sprite tooLateSprite;
/// <summary>
/// Reference to display the feedback image
/// </summary>
@@ -308,7 +308,7 @@ public class JustSignController : AbstractFeedback
signPredictor.SetModel(currentTheme.modelIndex);
signPredictor.SwapScreen(webcamScreen);
AddSelfAsListener();
StartController();
}
@@ -379,7 +379,7 @@ public class JustSignController : AbstractFeedback
// Spawn new symbol every spawn period
float currentTime = Time.time;
if (currentTime - lastSpawn > 2*currentSong.spawnPeriod && lastSymbolTime > currentTime)
if (currentTime - lastSpawn > 2 * currentSong.spawnPeriod && lastSymbolTime > currentTime)
{
lastSpawn = currentTime;
SpawnNewSymbol();
@@ -408,7 +408,7 @@ public class JustSignController : AbstractFeedback
/// <returns>The calculated score</returns>
public int CalculateScore()
{
return goodSigns*goodScore + perfectSigns*perfectScore + mehScore*mehSigns + terribleScore*terribleSigns + incorrectSigns*offscreenScore;
return goodSigns * goodScore + perfectSigns * perfectScore + mehScore * mehSigns + terribleScore * terribleSigns + incorrectSigns * offscreenScore;
}
/// <summary>
@@ -657,8 +657,8 @@ public class JustSignController : AbstractFeedback
accuracy = signPredictor.learnableProbabilities[predictedSign];
// ^^^ TEMPORARY STUFF ^^^
Learnable predSign = currentTheme.learnables.Find(l => l.name == predictedSign);
Learnable predSign = currentTheme.learnables.Find(l => l.name.ToUpper().Replace(" ", "-") == predictedSign);
if (feedbackText != null && feedbackProgressImage != null)
{
Color col;

View File

@@ -6,7 +6,6 @@ using NatML.Internal;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using UnityEngine;
@@ -199,6 +198,7 @@ public class SignPredictor : MonoBehaviour
/// Reference to the model info file
/// </summary>
public TextAsset modelInfoFile;
public TextAsset modelInfoFileEmbedding;
/// <summary>
/// Config file to set up the graph
@@ -389,20 +389,7 @@ public class SignPredictor : MonoBehaviour
keypointManagerEmbedding = new KeypointManagerEmbedding();
// read the embedding data
string filePath = Path.Combine(Application.dataPath, "Common/Models/BasicSigns", "embeddings.json");
if (File.Exists(filePath))
{
string jsonData = File.ReadAllText(filePath);
//UnityEngine.Debug.Log(jsonData);
embeddingDataList = JsonUtility.FromJson<EmbeddingDataList>("{\"dataList\":" + jsonData + "}");
}
else
{
UnityEngine.Debug.LogError("File not found: " + filePath);
}
embeddingDataList = JsonUtility.FromJson<EmbeddingDataList>($"{{\"dataList\":{modelInfoFileEmbedding}}}");
// Start the Coroutine
StartCoroutine(SignRecognitionCoroutineEmbed());
StartCoroutine(MediapipeCoroutineEmbed());

View File

@@ -4361,6 +4361,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
modelList: {fileID: 11400000, guid: 39516e4e6e56f0f4f80647d9c4d8034c, type: 2}
modelInfoFile: {fileID: 4900000, guid: fb8b51022bdcd654a9f29c054832a1b5, type: 3}
modelInfoFileEmbedding: {fileID: 4900000, guid: 4e303164823194bc4be87f4c9550cfd0, type: 3}
configAsset: {fileID: 4900000, guid: 6288c43cdca97374782dac1ea87aa029, type: 3}
screen: {fileID: 1743003084}
--- !u!4 &1592592445

View File

@@ -163,6 +163,9 @@ PlayerSettings:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 11400000, guid: 0ae0248e3ef962f4b8280ee4a7f1c4ec, type: 2}
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1