浏览代码

Making default annotation/metric ids lower case (#45)

* Making default annotation/metric ids lower case. Address security issues with pip install in yamato scripts. Fix paths in dataset to make them Linux-compatible.

* Fixing tests

* Attempt #2 to fix linux
/main
GitHub 4 年前
当前提交
32419d3d
共有 10 个文件被更改,包括 27 次插入22 次删除
  1. 9
      .yamato/upm-ci-testprojects.yml
  2. 12
      TestProjects/PerceptionHDRP/Assets/Scenes/SampleScene.unity
  3. 8
      TestProjects/PerceptionURP/Assets/Scenes/SampleScene.unity
  4. 2
      com.unity.perception/Runtime/GroundTruth/Labelers/BoundingBoxLabeler.cs
  5. 2
      com.unity.perception/Runtime/GroundTruth/Labelers/ObjectCountLabeler.cs
  6. 2
      com.unity.perception/Runtime/GroundTruth/Labelers/RenderedObjectInfoLabeler.cs
  7. 6
      com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs
  8. 4
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
  9. 2
      com.unity.perception/Tests/Editor/PerceptionCameraEditorTests.cs
  10. 2
      com.unity.perception/Tests/Runtime/GroundTruthTests/PerceptionCameraIntegrationTests.cs

9
.yamato/upm-ci-testprojects.yml


commands:
- git submodule update --init --recursive
- git clone git@github.cds.internal.unity3d.com:unity/utr.git utr
- pip install unity-downloader-cli --extra-index-url https://artifactory.internal.unity3d.com/api/pypi/common-python/simple
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
- unity-downloader-cli -u {{ editor.version }} -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
{% if suite.name == "standalone" %}
- utr/utr --testproject=./TestProjects/{{project.name}} --editor-location=./.Editor --artifacts_path=test-results --stdout-filter=minimal --extra-editor-arg="--force-d3d11" {{suite.args}}StandaloneWindows64

type: Unity::VM::GPU
image: cds-ops/ubuntu-18.04-base:latest
flavor: b1.large
variables:
PATH: /root/.local/bin:/home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
- sudo -H pip install --upgrade pip
- sudo -H pip install unity-downloader-cli --extra-index-url https://artifactory.internal.unity3d.com/api/pypi/common-python/simple
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade --user
- sudo unity-downloader-cli -u {{ editor.version }} -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
- unity-downloader-cli -u {{ editor.version }} -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
{% if suite.name == "standalone" %}
- DISPLAY=:0.0 utr/utr --testproject=./TestProjects/{{project.name}} --editor-location=.Editor --artifacts_path=test-results --stdout-filter=minimal --extra-editor-arg="--force-vulkan" {{suite.args}}StandaloneLinux64
{% else %}

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.

6
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>

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/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);
}

正在加载...
取消
保存