比较提交

...
此合并请求有变更与目标分支冲突。
/.yamato/promote.yml
/.yamato/publish.yml
/TestProjects/PerceptionHDRP/Packages/manifest.json
/TestProjects/PerceptionHDRP/Packages/packages-lock.json
/TestProjects/PerceptionHDRP/Assets/IdLabelConfig.asset
/TestProjects/PerceptionHDRP/Assets/Scenes/SampleScene.unity
/TestProjects/PerceptionURP/Packages/manifest.json
/TestProjects/PerceptionURP/Packages/packages-lock.json
/com.unity.perception/Tests/Runtime/GroundTruthTests/SegmentationGroundTruthTests.cs
/com.unity.perception/package.json
/com.unity.perception/CHANGELOG.md
/com.unity.perception/Documentation~/DatasetCapture.md
/com.unity.perception/Documentation~/images/PerceptionCameraFinished.png
/com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
/com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs
/TestProjects/PerceptionURP/Assets/csc.rsp
/TestProjects/PerceptionURP/Assets/csc.rsp
/TestProjects/PerceptionHDRP/Assets/csc.rsp
/com.unity.perception/Documentation~/GettingStarted.md

9 次代码提交

作者 SHA1 备注 提交日期
GitHub e8f1bc9f Fix warnings 0.2.0 (#39) 4 年前
GitHub 523b6651 Upgrading dependencies on capture and core packages (#36) 4 年前
GitHub 33a18d6c updated code to use capture camera flipy and removed perception flip … (#35) 4 年前
Wesley Mareovich Smith f22645c2 fixing changelog version 4 年前
Wesley Mareovich Smith d4831de0 changelog fix 4 年前
Wesley Mareovich Smith f5a2ff00 fixing file name 4 年前
Wesley Mareovich Smith a69963ee updating changelog 4 年前
Wesley Mareovich Smith 44f13919 pub fix 4 年前
Wesley Mareovich Smith 7c7a0a48 updating tests for publish 4 年前
共有 29 个文件被更改,包括 494 次插入395 次删除
  1. 21
      .yamato/publish.yml
  2. 4
      .yamato/promote.yml
  3. 4
      TestProjects/PerceptionURP/Packages/manifest.json
  4. 10
      TestProjects/PerceptionURP/Packages/packages-lock.json
  5. 4
      TestProjects/PerceptionURP/Assets/ExampleScripts/CustomAnnotationAndMetricReporter.cs
  6. 4
      TestProjects/PerceptionHDRP/Packages/manifest.json
  7. 10
      TestProjects/PerceptionHDRP/Packages/packages-lock.json
  8. 4
      TestProjects/PerceptionHDRP/Assets/IdLabelConfig.asset
  9. 11
      TestProjects/PerceptionHDRP/Assets/Scenes/SampleScene.unity
  10. 6
      com.unity.perception/package.json
  11. 25
      com.unity.perception/CHANGELOG.md
  12. 125
      com.unity.perception/Documentation~/images/IDLabelingConfigurationFinished.PNG
  13. 366
      com.unity.perception/Documentation~/images/MainCameraLabelConfig.PNG
  14. 204
      com.unity.perception/Documentation~/images/PerceptionCameraFinished.png
  15. 28
      com.unity.perception/Documentation~/GettingStarted.md
  16. 4
      com.unity.perception/Documentation~/DatasetCapture.md
  17. 3
      com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs
  18. 29
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
  19. 6
      com.unity.perception/Runtime/GroundTruth/SimulationState_Json.cs
  20. 5
      com.unity.perception/Tests/Runtime/GroundTruthTests/SegmentationGroundTruthTests.cs
  21. 1
      TestProjects/PerceptionURP/Assets/csc.rsp
  22. 7
      TestProjects/PerceptionURP/Assets/csc.rsp.meta
  23. 1
      TestProjects/PerceptionHDRP/Assets/csc.rsp
  24. 7
      TestProjects/PerceptionHDRP/Assets/csc.rsp.meta
  25. 0
      .gitmodules
  26. 0
      /.yamato/promote.yml
  27. 0
      /com.unity.perception/Documentation~/images/IDLabelingConfigurationFinished.PNG
  28. 0
      /com.unity.perception/Documentation~/images/MainCameraLabelConfig.PNG
  29. 0
      /com.unity.perception/Documentation~/images/PerceptionCameraFinished.png

21
.yamato/publish.yml


{% metadata_file .yamato/environments.yml %}
---
{% for variant in package_variants %}
name: Publish {{ variant.name }} package to internal registry
name: Publish Perception package to internal registry
agent:
type: Unity::VM
image: package-ci/win10:stable

triggers:
tags:
only:
- "/^(r|R)(c|C)-+(-preview(+)?)?$/"
- /^(r|R)(c|C)-\d+\.\d+\.\d+(-preview(\.\d+)?)?$/
- .yamato/upm-ci-full.yml#pack_{{ variant.name }}
{% for editor in test_editors %}
{% for platform in test_platforms %}
- .yamato/upm-ci-full.yml#pkg_test_{{variant.name}}_{{platform.name}}_{{editor.version}}
- .yamato/upm-ci-full.yml#pack_Perception
{% for editor in publish_editors %}
{% for platform in publish_platforms %}
{% for suite in suites %}
{% for project in projects %}
- .yamato/upm-ci-full.yml#pkg_test_Perception_{{platform.name}}_{{editor.version}}
- .yamato/upm-ci-testprojects.yml#{{project.name}}_windows_{{suite.name}}_{{editor.version}}
{% endfor %}
{% endfor %}
{% endfor %}

4
.yamato/promote.yml


{% for platform in publish_platforms %}
{% for suite in suites %}
{% for project in projects %}
{% for variant in package_variants %}
- .yamato/upm-ci-full.yml#pkg_test_{{variant.name}}_{{platform.name}}_{{editor.version}}
- .yamato/upm-ci-full.yml#pkg_test_Perception_{{platform.name}}_{{editor.version}}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}

4
TestProjects/PerceptionURP/Packages/manifest.json


"com.unity.package-validation-suite": "0.9.1-preview",
"com.unity.perception": "file:../../../com.unity.perception",
"com.unity.render-pipelines.universal": "7.3.1",
"com.unity.simulation.capture": "0.0.10-preview.6",
"com.unity.simulation.core": "0.0.10-preview.8",
"com.unity.simulation.capture": "0.0.10-preview.8",
"com.unity.simulation.core": "0.0.10-preview.14",
"com.unity.test-framework": "1.1.14",
"com.unity.textmeshpro": "2.0.1",
"com.unity.timeline": "1.2.12",

10
TestProjects/PerceptionURP/Packages/packages-lock.json


"com.unity.nuget.newtonsoft-json": "1.1.2",
"com.unity.render-pipelines.core": "7.1.6",
"com.unity.entities": "0.8.0-preview.8",
"com.unity.simulation.capture": "0.0.10-preview.6",
"com.unity.simulation.core": "0.0.10-preview.8"
"com.unity.simulation.capture": "0.0.10-preview.8",
"com.unity.simulation.core": "0.0.10-preview.14"
}
},
"com.unity.platforms": {

"url": "https://packages.unity.com"
},
"com.unity.simulation.capture": {
"version": "0.0.10-preview.6",
"version": "0.0.10-preview.8",
"com.unity.simulation.core": "0.0.10-preview.8"
"com.unity.simulation.core": "0.0.10-preview.12"
"version": "0.0.10-preview.8",
"version": "0.0.10-preview.14",
"depth": 0,
"source": "registry",
"dependencies": {},

4
TestProjects/PerceptionURP/Assets/ExampleScripts/CustomAnnotationAndMetricReporter.cs


[RequireComponent(typeof(PerceptionCamera))]
public class CustomAnnotationAndMetricReporter : MonoBehaviour
{
public GameObject light;
public GameObject targetLight;
public GameObject target;
MetricDefinition lightMetricDefinition;

public void Update()
{
//Report the light's position by manually creating the json array string.
var lightPos = light.transform.position;
var lightPos = targetLight.transform.position;
DatasetCapture.ReportMetric(lightMetricDefinition,
$@"[{{ ""x"": {lightPos.x}, ""y"": {lightPos.y}, ""z"": {lightPos.z} }}]");
//compute the location of the object in the camera's local space

4
TestProjects/PerceptionHDRP/Packages/manifest.json


"com.unity.perception": "file:../../../com.unity.perception",
"com.unity.render-pipelines.core": "7.3.1",
"com.unity.render-pipelines.high-definition": "7.3.1",
"com.unity.simulation.capture": "0.0.10-preview.6",
"com.unity.simulation.core": "0.0.10-preview.8",
"com.unity.simulation.capture": "0.0.10-preview.8",
"com.unity.simulation.core": "0.0.10-preview.14",
"com.unity.test-framework": "1.1.14",
"com.unity.testtools.codecoverage": "0.2.2-preview",
"com.unity.textmeshpro": "2.0.1",

10
TestProjects/PerceptionHDRP/Packages/packages-lock.json


"com.unity.nuget.newtonsoft-json": "1.1.2",
"com.unity.render-pipelines.core": "7.1.6",
"com.unity.entities": "0.8.0-preview.8",
"com.unity.simulation.capture": "0.0.10-preview.6",
"com.unity.simulation.core": "0.0.10-preview.8"
"com.unity.simulation.capture": "0.0.10-preview.8",
"com.unity.simulation.core": "0.0.10-preview.14"
}
},
"com.unity.platforms": {

"url": "https://packages.unity.com"
},
"com.unity.simulation.capture": {
"version": "0.0.10-preview.6",
"version": "0.0.10-preview.8",
"com.unity.simulation.core": "0.0.10-preview.8"
"com.unity.simulation.core": "0.0.10-preview.12"
"version": "0.0.10-preview.8",
"version": "0.0.10-preview.14",
"depth": 0,
"source": "registry",
"dependencies": {},

4
TestProjects/PerceptionHDRP/Assets/IdLabelConfig.asset


m_Name: IdLabelConfig
m_EditorClassIdentifier: Unity.Perception.Runtime:UnityEngine.Perception.GroundTruth:IdLabelConfig
m_LabelEntries:
- label: Box
- label: Crate
- label: Crate
- label: Box
id: 3
autoAssignIds: 1
startingLabelId: 1

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


asm: Unity.Perception.Runtime}
data:
enabled: 1
foldout: 0
labelingConfiguration: {fileID: 11400000, guid: be3971a848968144e8d07d9136a5bf49,
idLabelConfig: {fileID: 11400000, guid: 034ffd4e09ffb7348b2fe6634259058a,
type: 2}
00000001:
type: {class: SemanticSegmentationLabeler, ns: UnityEngine.Perception.GroundTruth,

foldout: 0
m_TargetTextureOverride: {fileID: 0}
foldout: 0
m_LabelingConfiguration: {fileID: 11400000, guid: be3971a848968144e8d07d9136a5bf49,
m_LabelConfig: {fileID: 11400000, guid: 034ffd4e09ffb7348b2fe6634259058a,
type: 2}
00000003:
type: {class: RenderedObjectInfoLabeler, ns: UnityEngine.Perception.GroundTruth,

foldout: 0
labelingConfiguration: {fileID: 11400000, guid: be3971a848968144e8d07d9136a5bf49,
idLabelConfig: {fileID: 11400000, guid: 034ffd4e09ffb7348b2fe6634259058a,
type: 2}
--- !u!1 &1640252278
GameObject:

6
com.unity.perception/package.json


"com.unity.nuget.newtonsoft-json": "1.1.2",
"com.unity.render-pipelines.core": "7.1.6",
"com.unity.entities": "0.8.0-preview.8",
"com.unity.simulation.capture": "0.0.10-preview.6",
"com.unity.simulation.core": "0.0.10-preview.8"
"com.unity.simulation.capture": "0.0.10-preview.8",
"com.unity.simulation.core": "0.0.10-preview.14"
"version": "0.1.0-preview.4"
"version": "0.2.0-preview.2"
}

25
com.unity.perception/CHANGELOG.md


The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [Unreleased]
Added CameraLabeler, an extensible base type for all forms of dataset output from a camera.
Added LabelConfig\<T\>, a base class for mapping labels to data used by a labeler. There are two new derived types - ID label config and semantic segmentation label config.
Moved the various forms of ground truth from PerceptionCamera into various subclasses of CameraLabeler.
Renamed SimulationManager to DatasetCapture.
Changed Semantic Segmentation to take a SemanticSegmentationLabelConfig, which maps labels to color pixel values.
Fixed compilation warnings with latest com.unity.simulation.core package.
## [0.2.0-preview.2] - 2020-07-15
### Fixed
Fixed bug that prevented RGB captures to be written out to disk
Fixed compatibility with com.unity.simulation.capture@0.0.10-preview.8
## [0.2.0-preview.1] - 2020-07-02
### Added
Added CameraLabeler, an extensible base type for all forms of dataset output from a camera.
Added LabelConfig\<T\>, a base class for mapping labels to data used by a labeler. There are two new derived types - ID label config and semantic segmentation label config.
### Changed
Moved the various forms of ground truth from PerceptionCamera into various subclasses of CameraLabeler.
Renamed SimulationManager to DatasetCapture.
Changed Semantic Segmentation to take a SemanticSegmentationLabelConfig, which maps labels to color pixel values.
## [0.1.0] - 2020-06-24
### This is the first release of the _Perception_ package

125
com.unity.perception/Documentation~/images/IDLabelingConfigurationFinished.PNG

之前 之后
宽度: 704  |  高度: 280  |  大小: 12 KiB

366
com.unity.perception/Documentation~/images/MainCameraLabelConfig.PNG

之前 之后
宽度: 701  |  高度: 830  |  大小: 76 KiB

204
com.unity.perception/Documentation~/images/PerceptionCameraFinished.png

之前 之后
宽度: 701  |  高度: 415  |  大小: 45 KiB

28
com.unity.perception/Documentation~/GettingStarted.md


1. Select your project's `ScriptableRenderer` asset and open the inspector window. In most projects it is located at `Assets/Settings/ForwardRenderer.asset`.
2. Click `Add Renderer Feature` and select `Ground Truth Renderer Feature`
<img src="images/ScriptableRendererStep.PNG" align="middle"/>
<img src="images/ScriptableRendererStep.png" align="middle"/>
## Step 3: Create a new scene and camera
1. Create a new scene using File -> New Scene

1. In the inspector panel of the main camera select Add Component
2. Add a **Perception Camera** component
<img src="images/MainCameraConfig.PNG" align="middle"/>
<img src="images/PerceptionCameraFinished.png" align="middle"/>
1. Create 2 more cubes this way
1. Change the names of the cubes to Cube, Box, and Crate
1. Position the Cubes in front of the main Camera
2. Create 2 more cubes this way
3. Change the names of the cubes to Cube, Box, and Crate
4. Position the Cubes in front of the main Camera
1. On each cube, from the inspector panel add a **Labeling** component
5. On each cube, from the inspector panel add a **Labeling** component
1. In the Project panel right click -> Perception -> Labeling Configuration
1. Select the new **Labeling Configuration**
6. In the Project panel right click -> Perception -> Labeling Configuration
7. Select the new **ID Label Config**
3. Add a numerical value to the value field
Make sure the labels all have different values, for this example use increments of 10,000 to ensure they show up as very distinct colors in the segmentation images
<img src="images/LabelingConfigurationFinished.PNG" align="middle"/>
<img src="images/IDLabelingConfigurationFinished.PNG" align="middle"/>
1. Select the Main Camera in the Hierarchy panel
1. In the Perception Camera attach the Labeling Configuration created in previous step
8. Select the Main Camera in the Hierarchy panel
9. In the Perception Camera attach the ID Label Config created in previous step for each ID Label config
<img src="images/MainCameraConfig.PNG" align="middle"/>
<img src="images/MainCameraLabelConfig.PNG" align="middle"/>
## Step 5: Run simulation and generate dataset
1. Press play in the editor, allow the scene to run for a few seconds, and then exit playmode

4
com.unity.perception/Documentation~/DatasetCapture.md


[RequireComponent(typeof(PerceptionCamera))]
public class CustomAnnotationAndMetricReporter : MonoBehaviour
{
public GameObject light;
public GameObject targetLight;
public GameObject target;
MetricDefinition lightMetricDefinition;

public void Update()
{
//Report the light's position by manually creating the json array string.
var lightPos = light.transform.position;
var lightPos = targetLight.transform.position;
DatasetCapture.ReportMetric(lightMetricDefinition,
$@"[{{ ""x"": {lightPos.x}, ""y"": {lightPos.y}, ""z"": {lightPos.z} }}]");
//compute the location of the object in the camera's local space

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


height = targetTexture.height,
path = localPath
};
asyncRequest.Start((r) =>
asyncRequest.Enqueue((r) =>
{
Profiler.BeginSample("Encode");
var pngBytes = ImageConversion.EncodeArrayToPNG(r.data.data.ToArray(), GraphicsFormat.R8G8B8A8_UNorm, (uint)r.data.width, (uint)r.data.height);

r.data.data.Dispose();
return AsyncRequest.Result.Completed;
});
asyncRequest.Execute();
}
/// <inheritdoc/>

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


bool m_CapturedLastFrame;
Ego m_EgoMarker;
#pragma warning disable 414
#pragma warning restore 414
/// <summary>
/// The <see cref="SensorHandle"/> associated with this camera. Use this to report additional annotations and metrics at runtime.

using (s_WriteFrame.Auto())
{
var dataColorBuffer = (byte[])r.data.colorBuffer;
if (flipY)
FlipImageY(dataColorBuffer, height);
byte[] encodedData;
using (s_EncodeAndSave.Auto())

}
};
CaptureCamera.Capture(cam, colorFunctor);
CaptureCamera.Capture(cam, colorFunctor, flipY: flipY);
Profiler.EndSample();
}

#else
return false;
#endif
}
static unsafe void FlipImageY(byte[] dataColorBuffer, int height)
{
using (s_FlipY.Auto())
{
var stride = dataColorBuffer.Length / height;
var buffer = new NativeArray<byte>(stride, Allocator.TempJob, NativeArrayOptions.UninitializedMemory);
fixed(byte* colorBufferPtr = &dataColorBuffer[0])
{
var unsafePtr = (byte*)buffer.GetUnsafePtr();
for (var row = 0; row < height / 2; row++)
{
var nearRowStartPtr = colorBufferPtr + stride * row;
var oppositeRowStartPtr = colorBufferPtr + stride * (height - row - 1);
UnsafeUtility.MemCpy(unsafePtr, oppositeRowStartPtr, stride);
UnsafeUtility.MemCpy(oppositeRowStartPtr, nearRowStartPtr, stride);
UnsafeUtility.MemCpy(nearRowStartPtr, unsafePtr, stride);
}
}
buffer.Dispose();
}
}
void OnSimulationEnding()

6
com.unity.perception/Runtime/GroundTruth/SimulationState_Json.cs


PendingCaptures = pendingCapturesToWrite,
SimulationState = this
};
req.Start(r =>
req.Enqueue(r =>
req.Execute(AsyncRequest.ExecutionContext.JobSystem);
}
m_SerializeCapturesSampler.End();

MetricFileIndex = m_MetricsFileIndex,
PendingMetrics = pendingMetricsToWrite
};
req.Start(r =>
req.Enqueue(r =>
req.Execute();
}
m_MetricsFileIndex++;

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


using NUnit.Framework;
using Unity.Collections;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.Experimental.Rendering;
using UnityEngine.UIElements;
using Object = UnityEngine.Object;
namespace GroundTruthTests

[UnityTest]
public IEnumerator SemanticSegmentationPass_WithTextureOverride_RendersToOverride()
{
int timesSegmentationImageReceived = 0;
var expectedPixelValue = new Color32(0, 0, 255, 255);
var targetTextureOverride = new RenderTexture(2, 2, 1, RenderTextureFormat.R8);

1
TestProjects/PerceptionURP/Assets/csc.rsp


-warnaserror+

7
TestProjects/PerceptionURP/Assets/csc.rsp.meta


fileFormatVersion: 2
guid: 1800f44b598c0b647bf3fad2f5c9b957
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1
TestProjects/PerceptionHDRP/Assets/csc.rsp


-warnaserror+

7
TestProjects/PerceptionHDRP/Assets/csc.rsp.meta


fileFormatVersion: 2
guid: b590f0b421136b44098ad7e92fc45f3e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

0
.gitmodules

/.yamato/promotion.yml → /.yamato/promote.yml

/com.unity.perception/Documentation~/images/LabelingConfigurationFinished.PNG → /com.unity.perception/Documentation~/images/IDLabelingConfigurationFinished.PNG

/com.unity.perception/Documentation~/images/MainCameraConfig.PNG → /com.unity.perception/Documentation~/images/MainCameraLabelConfig.PNG

/com.unity.perception/Documentation~/images/PerceptionCamera.png → /com.unity.perception/Documentation~/images/PerceptionCameraFinished.png

正在加载...
取消
保存