浏览代码

Merge branch 'master' into aisv647_visualizations

/aisv647_visualizations
GitHub 4 年前
当前提交
99fcb992
共有 12 个文件被更改,包括 35 次插入24 次删除
  1. 12
      TestProjects/PerceptionHDRP/Assets/Scenes/SampleScene.unity
  2. 8
      TestProjects/PerceptionURP/Assets/Scenes/SampleScene.unity
  3. 2
      com.unity.perception/Runtime/GroundTruth/Labelers/BoundingBoxLabeler.cs
  4. 2
      com.unity.perception/Runtime/GroundTruth/Labelers/ObjectCountLabeler.cs
  5. 2
      com.unity.perception/Runtime/GroundTruth/Labelers/RenderedObjectInfoLabeler.cs
  6. 17
      com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs
  7. 4
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
  8. 2
      com.unity.perception/Runtime/GroundTruth/Resources/SemanticSegmentation.shader
  9. 2
      com.unity.perception/Runtime/GroundTruth/SemanticSegmentationCrossPipelinePass.cs
  10. 2
      com.unity.perception/Tests/Editor/PerceptionCameraEditorTests.cs
  11. 2
      com.unity.perception/Tests/Runtime/GroundTruthTests/PerceptionCameraIntegrationTests.cs
  12. 4
      com.unity.perception/Tests/Runtime/GroundTruthTests/SegmentationGroundTruthTests.cs

12
TestProjects/PerceptionHDRP/Assets/Scenes/SampleScene.unity


asm: Unity.Perception.Runtime}
data:
enabled: 1
annotationId: F9F22E05-443F-4602-A422-EBE4EA9B55CB
foldout: 0
annotationId: f9f22e05-443f-4602-a422-ebe4ea9b55cb
idLabelConfig: {fileID: 11400000, guid: 034ffd4e09ffb7348b2fe6634259058a,
type: 2}
00000001:

enabled: 1
annotationId: 12F94D8D-5425-4DEB-9B21-5E53AD957D66
foldout: 0
annotationId: 12f94d8d-5425-4deb-9b21-5e53ad957d66
labelConfig: {fileID: 11400000, guid: c140c5aa05dd09e4fadaa26de31b1f39, type: 2}
m_TargetTextureOverride: {fileID: 0}
00000002:

objectCountMetricId: 51DA3C27-369D-4929-AEA6-D01614635CE2
foldout: 0
objectCountMetricId: 51da3c27-369d-4929-aea6-d01614635ce2
m_LabelConfig: {fileID: 11400000, guid: 034ffd4e09ffb7348b2fe6634259058a,
type: 2}
00000003:

enabled: 1
objectInfoMetricId: 5BA92024-B3B7-41A7-9D3F-C03A6A8DDD01
foldout: 0
objectInfoMetricId: 5ba92024-b3b7-41a7-9d3f-c03a6a8ddd01
idLabelConfig: {fileID: 11400000, guid: 034ffd4e09ffb7348b2fe6634259058a,
type: 2}
--- !u!1 &1640252278

8
TestProjects/PerceptionURP/Assets/Scenes/SampleScene.unity


type: {class: ObjectCountLabeler, ns: UnityEngine.Perception.GroundTruth, asm: Unity.Perception.Runtime}
data:
enabled: 1
objectCountMetricId: 51DA3C27-369D-4929-AEA6-D01614635CE2
objectCountMetricId: 51da3c27-369d-4929-aea6-d01614635ce2
m_LabelConfig: {fileID: 11400000, guid: cedcacfb1d9beb34fbbb231166c472fe,
type: 2}
00000001:

enabled: 1
annotationId: F9F22E05-443F-4602-A422-EBE4EA9B55CB
annotationId: f9f22e05-443f-4602-a422-ebe4ea9b55cb
idLabelConfig: {fileID: 11400000, guid: cedcacfb1d9beb34fbbb231166c472fe,
type: 2}
00000002:

enabled: 1
objectInfoMetricId: 5BA92024-B3B7-41A7-9D3F-C03A6A8DDD01
objectInfoMetricId: 5ba92024-b3b7-41a7-9d3f-c03a6a8ddd01
idLabelConfig: {fileID: 11400000, guid: cedcacfb1d9beb34fbbb231166c472fe,
type: 2}
00000003:

enabled: 1
annotationId: 12F94D8D-5425-4DEB-9B21-5E53AD957D66
annotationId: 12f94d8d-5425-4deb-9b21-5e53ad957d66
labelConfig: {fileID: 11400000, guid: c140c5aa05dd09e4fadaa26de31b1f39, type: 2}
m_TargetTextureOverride: {fileID: 0}
--- !u!114 &963194231

2
com.unity.perception/Runtime/GroundTruth/Labelers/BoundingBoxLabeler.cs


/// <summary>
/// The GUID id to associate with the annotations produced by this labeler.
/// </summary>
public string annotationId = "F9F22E05-443F-4602-A422-EBE4EA9B55CB";
public string annotationId = "f9f22e05-443f-4602-a422-ebe4ea9b55cb";
/// <summary>
/// The <see cref="IdLabelConfig"/> which associates objects with labels.
/// </summary>

2
com.unity.perception/Runtime/GroundTruth/Labelers/ObjectCountLabeler.cs


/// <summary>
/// The ID to use for object count annotations in the resulting dataset
/// </summary>
public string objectCountMetricId = "51DA3C27-369D-4929-AEA6-D01614635CE2";
public string objectCountMetricId = "51da3c27-369d-4929-aea6-d01614635ce2";
/// <summary>
/// The <see cref="IdLabelConfig"/> which associates objects with labels.

2
com.unity.perception/Runtime/GroundTruth/Labelers/RenderedObjectInfoLabeler.cs


/// <summary>
/// The ID to use for visible pixels metrics in the resulting dataset
/// </summary>
public string objectInfoMetricId = "5BA92024-B3B7-41A7-9D3F-C03A6A8DDD01";
public string objectInfoMetricId = "5ba92024-b3b7-41a7-9d3f-c03a6a8ddd01";
/// <summary>
/// The <see cref="IdLabelConfig"/> which associates objects with labels.

17
com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs


/// The id to associate with semantic segmentation annotations in the dataset.
/// </summary>
[Tooltip("The id to associate with semantic segmentation annotations in the dataset.")]
public string annotationId = "12F94D8D-5425-4DEB-9B21-5E53AD957D66";
public string annotationId = "12f94d8d-5425-4deb-9b21-5e53ad957d66";
/// <summary>
/// The SemanticSegmentationLabelConfig which maps labels to pixel values.
/// </summary>

m_AsyncAnnotations = new Dictionary<int, AsyncAnnotation>();
var renderTextureDescriptor = new RenderTextureDescriptor(camWidth, camHeight, GraphicsFormat.R8G8B8A8_UNorm, 8);
{
if (targetTexture.sRGB)
{
Debug.LogError("targetTexture supplied to SemanticSegmentationLabeler must be in Linear mode. Disabling labeler.");
this.enabled = false;
}
var renderTextureDescriptor = new RenderTextureDescriptor(width, height, GraphicsFormat.R8G8B8A8_UNorm, 8);
}
m_TargetTextureOverride = new RenderTexture(renderTextureDescriptor);
m_TargetTextureOverride = new RenderTexture(width, height, 8, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);
targetTexture.Create();
targetTexture.name = "Labeling";

if (!m_AsyncAnnotations.TryGetValue(frameCount, out var annotation))
return;
var datasetRelativePath = Path.Combine(k_SemanticSegmentationDirectory, k_SegmentationFilePrefix) + frameCount + ".png";
var localPath = Path.Combine(Manager.Instance.GetDirectoryFor(k_SemanticSegmentationDirectory), k_SegmentationFilePrefix) + frameCount + ".png";
var datasetRelativePath = $"{k_SemanticSegmentationDirectory}/{k_SegmentationFilePrefix}{frameCount}.png";
var localPath = $"{Manager.Instance.GetDirectoryFor(k_SemanticSegmentationDirectory)}/{k_SegmentationFilePrefix}{frameCount}.png";
annotation.ReportFile(datasetRelativePath);

4
com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs


if (!captureRgbImages)
return;
var captureFilename = Path.Combine(Manager.Instance.GetDirectoryFor(RgbDirectory), $"{s_RgbFilePrefix}{Time.frameCount}.png");
var dxRootPath = Path.Combine(RgbDirectory, $"{s_RgbFilePrefix}{Time.frameCount}.png");
var captureFilename = $"{Manager.Instance.GetDirectoryFor(RgbDirectory)}/{s_RgbFilePrefix}{Time.frameCount}.png";
var dxRootPath = $"{RgbDirectory}/{s_RgbFilePrefix}{Time.frameCount}.png";
SensorHandle.ReportCapture(dxRootPath, SensorSpatialData.FromGameObjects(m_EgoMarker == null ? null : m_EgoMarker.gameObject, gameObject), m_PersistentSensorData.Select(kvp => (kvp.Key, kvp.Value)).ToArray());
Func<AsyncRequest<CaptureCamera.CaptureState>, AsyncRequest.Result> colorFunctor;

2
com.unity.perception/Runtime/GroundTruth/Resources/SemanticSegmentation.shader


{
Properties
{
[PerObjectData] LabelingId("Labeling Id", Color) = (0,0,0,1)
[PerObjectData] LabelingId("Labeling Id", Vector) = (0,0,0,1)
}
HLSLINCLUDE

2
com.unity.perception/Runtime/GroundTruth/SemanticSegmentationCrossPipelinePass.cs


//Set the labeling ID so that it can be accessed in ClassSemanticSegmentationPass.shader
if (found)
mpb.SetColor(k_LabelingId, entry.color);
mpb.SetVector(k_LabelingId, entry.color);
}
}
}

2
com.unity.perception/Tests/Editor/PerceptionCameraEditorTests.cs


var capturesJson = File.ReadAllText(capturesPath);
for (int iFrameCount = expectedFirstFrame; iFrameCount <= expectedLastFrame; iFrameCount++)
{
var imagePath = Path.Combine(PerceptionCamera.RgbDirectory, $"rgb_{iFrameCount}").Replace(@"\", @"\\");
var imagePath = $"{PerceptionCamera.RgbDirectory}/rgb_{iFrameCount}";
StringAssert.Contains(imagePath, capturesJson);
}

2
com.unity.perception/Tests/Runtime/GroundTruthTests/PerceptionCameraIntegrationTests.cs


var capturesPath = Path.Combine(DatasetCapture.OutputDirectory, "captures_000.json");
var capturesJson = File.ReadAllText(capturesPath);
var imagePath = Path.Combine("SemanticSegmentation", expectedImageFilename).Replace(@"\", @"\\");
var imagePath = $"SemanticSegmentation/{expectedImageFilename}";
StringAssert.Contains(imagePath, capturesJson);
}

4
com.unity.perception/Tests/Runtime/GroundTruthTests/SegmentationGroundTruthTests.cs


[UnityPlatform(exclude = new[] {RuntimePlatform.LinuxEditor, RuntimePlatform.LinuxPlayer})]
public class SegmentationPassTests : GroundTruthTestBase
{
static readonly Color32 k_SemanticPixelValue = Color.blue;
static readonly Color32 k_SemanticPixelValue = new Color32(10, 20, 30, Byte.MaxValue);
public enum SegmentationKind
{

catch (Exception)
{
//uncomment to get RenderDoc captures while this check is failing
//RenderDoc.EndCaptureRenderDoc(gameView);
//UnityEditorInternal.RenderDoc.EndCaptureRenderDoc(gameView);
throw;
}
}

正在加载...
取消
保存