Steve Borkman
3 年前
当前提交
95e08150
共有 15 个文件被更改,包括 929 次插入 和 598 次删除
-
2com.unity.perception/Runtime/GroundTruth/Consumers/SoloConsumer.cs
-
35com.unity.perception/Runtime/GroundTruth/DataModel.cs
-
154com.unity.perception/Runtime/GroundTruth/DatasetCapture.cs
-
1com.unity.perception/Runtime/GroundTruth/Labelers/ObjectCountLabeler.cs
-
4com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
-
153com.unity.perception/Runtime/GroundTruth/SimulationState.cs
-
1com.unity.perception/Tests/Runtime/GroundTruthTests/BoundingBox3dTests.cs
-
2com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetCaptureSensorSchedulingTests.cs
-
976com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetCaptureTests.cs
-
5com.unity.perception/Tests/Runtime/GroundTruthTests/GroundTruthTestBase.cs
-
105com.unity.perception/Tests/Runtime/GroundTruthTests/PerceptionCameraIntegrationTests.cs
-
5com.unity.perception/Tests/Runtime/GroundTruthTests/RenderedObjectInfoTests.cs
-
2com.unity.perception/Tests/Runtime/GroundTruthTests/VisualizationTests.cs
-
71com.unity.perception/Tests/Runtime/GroundTruthTests/CollectEndpoint.cs
-
11com.unity.perception/Tests/Runtime/GroundTruthTests/CollectEndpoint.cs.meta
976
com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetCaptureTests.cs
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEngine.Perception.GroundTruth; |
|||
using UnityEngine.Perception.GroundTruth.DataModel; |
|||
|
|||
namespace GroundTruthTests |
|||
{ |
|||
public class CollectEndpoint : ConsumerEndpoint |
|||
{ |
|||
public List<SensorDefinition> sensors = new List<SensorDefinition>(); |
|||
public List<AnnotationDefinition> annotationDefinitions = new List<AnnotationDefinition>(); |
|||
public List<MetricDefinition> metricDefinitions = new List<MetricDefinition>(); |
|||
|
|||
public struct SimulationRun |
|||
{ |
|||
public int TotalFrames => frames.Count; |
|||
public List<Frame> frames; |
|||
public SimulationMetadata metadata; |
|||
} |
|||
|
|||
public List<SimulationRun> collectedRuns = new List<SimulationRun>(); |
|||
public SimulationRun currentRun; |
|||
|
|||
public override void OnSensorRegistered(SensorDefinition sensor) |
|||
{ |
|||
sensors.Add(sensor); |
|||
} |
|||
|
|||
public override void OnAnnotationRegistered(AnnotationDefinition annotationDefinition) |
|||
{ |
|||
annotationDefinitions.Add(annotationDefinition); |
|||
} |
|||
|
|||
public override void OnMetricRegistered(MetricDefinition metricDefinition) |
|||
{ |
|||
metricDefinitions.Add(metricDefinition); |
|||
} |
|||
|
|||
protected override bool IsComplete() |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
public override void OnSimulationStarted(SimulationMetadata metadata) |
|||
{ |
|||
currentRun = new SimulationRun |
|||
{ |
|||
frames = new List<Frame>() |
|||
}; |
|||
Debug.Log("Collect Enpoint OnSimulationStarted"); |
|||
} |
|||
|
|||
public override void OnFrameGenerated(Frame frame) |
|||
{ |
|||
if (currentRun.frames == null) |
|||
{ |
|||
Debug.LogError("Current run frames is null, probably means that OnSimulationStarted was never called"); |
|||
} |
|||
|
|||
currentRun.frames.Add(frame); |
|||
Debug.Log("Collect Enpoint OnFrameGenerted"); |
|||
} |
|||
|
|||
public override void OnSimulationCompleted(CompletionMetadata metadata) |
|||
{ |
|||
currentRun.metadata = metadata; |
|||
collectedRuns.Add(currentRun); |
|||
Debug.Log("Collect Enpoint OnSimulationCompleted"); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: a8f768cefda95fe4a9a52e35cc744d4d |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue