Resolve WES-143 "Feedback courses"

This commit is contained in:
Helena Van Breugel
2023-04-04 18:24:17 +00:00
committed by Jerome Coudron
parent c20cd89c3a
commit c358ac59e4
115 changed files with 11331 additions and 1116 deletions

View File

@@ -6,11 +6,11 @@ using UnityEngine;
/// </summary>
public abstract class AbstractFeedback : MonoBehaviour, Listener
{
/// <summary>
/// Reference to the sign predictor
/// </summary>
public SignPredictor signPredictor;
/// <summary>
/// The function that is called by the publisher on all its listeners
/// </summary>
@@ -19,6 +19,7 @@ public abstract class AbstractFeedback : MonoBehaviour, Listener
{
yield return StartCoroutine(UpdateFeedback());
}
/// <summary>
/// A function to add yourself as listener to the signPredictor you are holding
/// </summary>
@@ -26,6 +27,7 @@ public abstract class AbstractFeedback : MonoBehaviour, Listener
{
signPredictor.listeners.Add(this);
}
/// <summary>
/// The function that holds the logic to process the new probabilities of the signPredictor
/// </summary>

View File

@@ -123,12 +123,6 @@ public class SignPredictor : MonoBehaviour
[SerializeField]
private RawImage screen;
/// <summary>
/// A secondary optional screen object on which the video is displayed
/// </summary>
[SerializeField]
private RawImage screen2;
/// <summary>
/// MediaPipe graph
/// </summary>
@@ -230,10 +224,6 @@ public class SignPredictor : MonoBehaviour
float webcamAspect = (float)webcamTexture.width / (float)webcamTexture.height;
screen.rectTransform.sizeDelta = new Vector2(screen.rectTransform.sizeDelta.y * webcamAspect, (screen.rectTransform.sizeDelta.y));
screen.texture = webcamTexture;
if (screen2 != null)
{
screen2.rectTransform.sizeDelta = new Vector2(screen2.rectTransform.sizeDelta.y * webcamAspect, (screen2.rectTransform.sizeDelta.y));
}
// TODO this method is kinda meh you should use
inputTexture = new Texture2D(width, height, TextureFormat.RGBA32, false);
@@ -426,7 +416,7 @@ public class SignPredictor : MonoBehaviour
webcamTexture.Play();
}
}
/*
/// <summary>
/// Swaps the display screens
/// </summary>
@@ -443,9 +433,19 @@ public class SignPredictor : MonoBehaviour
screen2.texture = null;
}
}
public void ChangeModel(ModelIndex index)
*/
public void SetModel(ModelIndex index)
{
this.modelList.SetCurrentModel(index);
}
/// <summary>
/// Swaps the display screens
/// </summary>
public void SwapScreen(RawImage screen)
{
this.screen = screen;
this.screen.texture = webcamTexture;
}
}