Skip to content

Commit e5eed6a

Browse files
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
1 parent 0671c57 commit e5eed6a

File tree

10 files changed

+27
-22
lines changed

10 files changed

+27
-22
lines changed

.yamato/upm-ci-testprojects.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
commands:
1515
- git submodule update --init --recursive
1616
- git clone [email protected]:unity/utr.git utr
17-
- pip install unity-downloader-cli --extra-index-url https://artifactory.internal.unity3d.com/api/pypi/common-python/simple
17+
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
1818
- unity-downloader-cli -u {{ editor.version }} -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
1919
{% if suite.name == "standalone" %}
2020
- utr/utr --testproject=./TestProjects/{{project.name}} --editor-location=./.Editor --artifacts_path=test-results --stdout-filter=minimal --extra-editor-arg="--force-d3d11" {{suite.args}}StandaloneWindows64
@@ -63,12 +63,13 @@ codecoverage_windows_{{suite.name}}_{{editor.version}}:
6363
type: Unity::VM::GPU
6464
image: cds-ops/ubuntu-18.04-base:latest
6565
flavor: b1.large
66+
variables:
67+
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
6668
commands:
6769
- git submodule update --init --recursive
68-
- sudo -H pip install --upgrade pip
69-
- sudo -H pip install unity-downloader-cli --extra-index-url https://artifactory.internal.unity3d.com/api/pypi/common-python/simple
70+
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade --user
7071
- git clone [email protected]:unity/utr.git utr
71-
- sudo unity-downloader-cli -u {{ editor.version }} -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
72+
- unity-downloader-cli -u {{ editor.version }} -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
7273
{% if suite.name == "standalone" %}
7374
- 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
7475
{% else %}

TestProjects/PerceptionHDRP/Assets/Scenes/SampleScene.unity

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -785,30 +785,34 @@ MonoBehaviour:
785785
asm: Unity.Perception.Runtime}
786786
data:
787787
enabled: 1
788-
annotationId: F9F22E05-443F-4602-A422-EBE4EA9B55CB
788+
foldout: 0
789+
annotationId: f9f22e05-443f-4602-a422-ebe4ea9b55cb
789790
idLabelConfig: {fileID: 11400000, guid: 034ffd4e09ffb7348b2fe6634259058a,
790791
type: 2}
791792
00000001:
792793
type: {class: SemanticSegmentationLabeler, ns: UnityEngine.Perception.GroundTruth,
793794
asm: Unity.Perception.Runtime}
794795
data:
795796
enabled: 1
796-
annotationId: 12F94D8D-5425-4DEB-9B21-5E53AD957D66
797+
foldout: 0
798+
annotationId: 12f94d8d-5425-4deb-9b21-5e53ad957d66
797799
labelConfig: {fileID: 11400000, guid: c140c5aa05dd09e4fadaa26de31b1f39, type: 2}
798800
m_TargetTextureOverride: {fileID: 0}
799801
00000002:
800802
type: {class: ObjectCountLabeler, ns: UnityEngine.Perception.GroundTruth, asm: Unity.Perception.Runtime}
801803
data:
802804
enabled: 1
803-
objectCountMetricId: 51DA3C27-369D-4929-AEA6-D01614635CE2
805+
foldout: 0
806+
objectCountMetricId: 51da3c27-369d-4929-aea6-d01614635ce2
804807
m_LabelConfig: {fileID: 11400000, guid: 034ffd4e09ffb7348b2fe6634259058a,
805808
type: 2}
806809
00000003:
807810
type: {class: RenderedObjectInfoLabeler, ns: UnityEngine.Perception.GroundTruth,
808811
asm: Unity.Perception.Runtime}
809812
data:
810813
enabled: 1
811-
objectInfoMetricId: 5BA92024-B3B7-41A7-9D3F-C03A6A8DDD01
814+
foldout: 0
815+
objectInfoMetricId: 5ba92024-b3b7-41a7-9d3f-c03a6a8ddd01
812816
idLabelConfig: {fileID: 11400000, guid: 034ffd4e09ffb7348b2fe6634259058a,
813817
type: 2}
814818
--- !u!1 &1640252278

TestProjects/PerceptionURP/Assets/Scenes/SampleScene.unity

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,31 +614,31 @@ MonoBehaviour:
614614
type: {class: ObjectCountLabeler, ns: UnityEngine.Perception.GroundTruth, asm: Unity.Perception.Runtime}
615615
data:
616616
enabled: 1
617-
objectCountMetricId: 51DA3C27-369D-4929-AEA6-D01614635CE2
617+
objectCountMetricId: 51da3c27-369d-4929-aea6-d01614635ce2
618618
m_LabelConfig: {fileID: 11400000, guid: cedcacfb1d9beb34fbbb231166c472fe,
619619
type: 2}
620620
00000001:
621621
type: {class: BoundingBox2DLabeler, ns: UnityEngine.Perception.GroundTruth,
622622
asm: Unity.Perception.Runtime}
623623
data:
624624
enabled: 1
625-
annotationId: F9F22E05-443F-4602-A422-EBE4EA9B55CB
625+
annotationId: f9f22e05-443f-4602-a422-ebe4ea9b55cb
626626
idLabelConfig: {fileID: 11400000, guid: cedcacfb1d9beb34fbbb231166c472fe,
627627
type: 2}
628628
00000002:
629629
type: {class: RenderedObjectInfoLabeler, ns: UnityEngine.Perception.GroundTruth,
630630
asm: Unity.Perception.Runtime}
631631
data:
632632
enabled: 1
633-
objectInfoMetricId: 5BA92024-B3B7-41A7-9D3F-C03A6A8DDD01
633+
objectInfoMetricId: 5ba92024-b3b7-41a7-9d3f-c03a6a8ddd01
634634
idLabelConfig: {fileID: 11400000, guid: cedcacfb1d9beb34fbbb231166c472fe,
635635
type: 2}
636636
00000003:
637637
type: {class: SemanticSegmentationLabeler, ns: UnityEngine.Perception.GroundTruth,
638638
asm: Unity.Perception.Runtime}
639639
data:
640640
enabled: 1
641-
annotationId: 12F94D8D-5425-4DEB-9B21-5E53AD957D66
641+
annotationId: 12f94d8d-5425-4deb-9b21-5e53ad957d66
642642
labelConfig: {fileID: 11400000, guid: c140c5aa05dd09e4fadaa26de31b1f39, type: 2}
643643
m_TargetTextureOverride: {fileID: 0}
644644
--- !u!114 &963194231

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct BoundingBoxValue
3131
/// <summary>
3232
/// The GUID id to associate with the annotations produced by this labeler.
3333
/// </summary>
34-
public string annotationId = "F9F22E05-443F-4602-A422-EBE4EA9B55CB";
34+
public string annotationId = "f9f22e05-443f-4602-a422-ebe4ea9b55cb";
3535
/// <summary>
3636
/// The <see cref="IdLabelConfig"/> which associates objects with labels.
3737
/// </summary>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public sealed class ObjectCountLabeler : CameraLabeler
1515
/// <summary>
1616
/// The ID to use for object count annotations in the resulting dataset
1717
/// </summary>
18-
public string objectCountMetricId = "51DA3C27-369D-4929-AEA6-D01614635CE2";
18+
public string objectCountMetricId = "51da3c27-369d-4929-aea6-d01614635ce2";
1919

2020
/// <summary>
2121
/// The <see cref="IdLabelConfig"/> which associates objects with labels.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct RenderedObjectInfoValue
3131
/// <summary>
3232
/// The ID to use for visible pixels metrics in the resulting dataset
3333
/// </summary>
34-
public string objectInfoMetricId = "5BA92024-B3B7-41A7-9D3F-C03A6A8DDD01";
34+
public string objectInfoMetricId = "5ba92024-b3b7-41a7-9d3f-c03a6a8ddd01";
3535

3636
/// <summary>
3737
/// The <see cref="IdLabelConfig"/> which associates objects with labels.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public sealed class SemanticSegmentationLabeler : CameraLabeler
3232
/// The id to associate with semantic segmentation annotations in the dataset.
3333
/// </summary>
3434
[Tooltip("The id to associate with semantic segmentation annotations in the dataset.")]
35-
public string annotationId = "12F94D8D-5425-4DEB-9B21-5E53AD957D66";
35+
public string annotationId = "12f94d8d-5425-4deb-9b21-5e53ad957d66";
3636
/// <summary>
3737
/// The SemanticSegmentationLabelConfig which maps labels to pixel values.
3838
/// </summary>
@@ -174,8 +174,8 @@ void OnSemanticSegmentationImageRead(int frameCount, NativeArray<Color32> data)
174174
if (!m_AsyncAnnotations.TryGetValue(frameCount, out var annotation))
175175
return;
176176

177-
var datasetRelativePath = Path.Combine(k_SemanticSegmentationDirectory, k_SegmentationFilePrefix) + frameCount + ".png";
178-
var localPath = Path.Combine(Manager.Instance.GetDirectoryFor(k_SemanticSegmentationDirectory), k_SegmentationFilePrefix) + frameCount + ".png";
177+
var datasetRelativePath = $"{k_SemanticSegmentationDirectory}/{k_SegmentationFilePrefix}{frameCount}.png";
178+
var localPath = $"{Manager.Instance.GetDirectoryFor(k_SemanticSegmentationDirectory)}/{k_SegmentationFilePrefix}{frameCount}.png";
179179

180180
annotation.ReportFile(datasetRelativePath);
181181

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ void CaptureRgbData(Camera cam)
160160
if (!captureRgbImages)
161161
return;
162162

163-
var captureFilename = Path.Combine(Manager.Instance.GetDirectoryFor(RgbDirectory), $"{s_RgbFilePrefix}{Time.frameCount}.png");
164-
var dxRootPath = Path.Combine(RgbDirectory, $"{s_RgbFilePrefix}{Time.frameCount}.png");
163+
var captureFilename = $"{Manager.Instance.GetDirectoryFor(RgbDirectory)}/{s_RgbFilePrefix}{Time.frameCount}.png";
164+
var dxRootPath = $"{RgbDirectory}/{s_RgbFilePrefix}{Time.frameCount}.png";
165165
SensorHandle.ReportCapture(dxRootPath, SensorSpatialData.FromGameObjects(m_EgoMarker == null ? null : m_EgoMarker.gameObject, gameObject), m_PersistentSensorData.Select(kvp => (kvp.Key, kvp.Value)).ToArray());
166166

167167
Func<AsyncRequest<CaptureCamera.CaptureState>, AsyncRequest.Result> colorFunctor;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public IEnumerator EditorPause_DoesNotLogErrors()
4848
var capturesJson = File.ReadAllText(capturesPath);
4949
for (int iFrameCount = expectedFirstFrame; iFrameCount <= expectedLastFrame; iFrameCount++)
5050
{
51-
var imagePath = Path.Combine(PerceptionCamera.RgbDirectory, $"rgb_{iFrameCount}").Replace(@"\", @"\\");
51+
var imagePath = $"{PerceptionCamera.RgbDirectory}/rgb_{iFrameCount}";
5252
StringAssert.Contains(imagePath, capturesJson);
5353
}
5454

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public IEnumerator EnableSemanticSegmentation_GeneratesCorrectDataset()
7070

7171
var capturesPath = Path.Combine(DatasetCapture.OutputDirectory, "captures_000.json");
7272
var capturesJson = File.ReadAllText(capturesPath);
73-
var imagePath = Path.Combine("SemanticSegmentation", expectedImageFilename).Replace(@"\", @"\\");
73+
var imagePath = $"SemanticSegmentation/{expectedImageFilename}";
7474
StringAssert.Contains(imagePath, capturesJson);
7575
}
7676

0 commit comments

Comments
 (0)