Neodroid  0.2.0
Machine Learning Environment Prototyping Tool
SegmentationCameraSensor.cs
Go to the documentation of this file.
1 using System.Linq;
3 using UnityEngine;
4 
5 namespace droid.Runtime.Prototyping.Sensors.Camera.Deprecated.Segmentation {
9  [AddComponentMenu(SensorComponentMenuPath._ComponentMenuPath
10  + "SegmentationCamera"
11  + SensorComponentMenuPath._Postfix)]
12  [ExecuteInEditMode]
13  [RequireComponent(typeof(UnityEngine.Camera), typeof(Segmenter))]
17  [SerializeField]
18  Segmenter _segmenter = null;
19 
23  public override void UpdateObservation() {
24  base.UpdateObservation();
25 
26  Debug.LogWarning(JsonUtility.ToJson(this._segmenter.ColorsDict));
27  this.serialisedString = this._segmenter != null
28  ? this._segmenter.ColorsDict.Select(c => $"{c.Key}: {c.Value.ToString()}")
29  .Aggregate("", (current, next) => $"{current}, {next}")
30  : "Nothing";
31  }
32  }
33 }