浏览代码

Merge branch 'master' into add_imageLink_field

/add_imageLink_field
Mohsen Kamalzadeh 3 年前
当前提交
a42b3017
共有 12 个文件被更改,包括 105 次插入50 次删除
  1. 4
      README.md
  2. 14
      TestProjects/PerceptionHDRP/Packages/packages-lock.json
  3. 1
      TestProjects/PerceptionURP/Assets/Tests/Editor/PerceptionCameraEditorUrpTests.cs
  4. 14
      TestProjects/PerceptionURP/Packages/packages-lock.json
  5. 41
      com.unity.perception/CHANGELOG.md
  6. 2
      com.unity.perception/Documentation~/Tutorial/Phase1.md
  7. 34
      com.unity.perception/Documentation~/Tutorial/Phase2.md
  8. 12
      com.unity.perception/Editor/GroundTruth/IdLabelConfigEditor.cs
  9. 8
      com.unity.perception/Runtime/GroundTruth/Labelers/KeypointLabeler.cs
  10. 4
      com.unity.perception/Tests/Editor/PerceptionCameraEditorTests.cs
  11. 6
      com.unity.perception/package.json
  12. 15
      TestProjects/PerceptionURP/ProjectSettings/BurstAotSettings_StandaloneOSX.json

4
README.md


[![license badge](https://img.shields.io/badge/license-Apache--2.0-green.svg)](LICENSE.md)
<img src="https://img.shields.io/badge/unity-2019.4-green.svg?style=flat-square" alt="unity 2019.4">
<img src="https://img.shields.io/badge/unity-2020.3-green.svg?style=flat-square" alt="unity 2020.3">
<img src="https://img.shields.io/badge/unity-2020.2-green.svg?style=flat-square" alt="unity 2020.3">
> com.unity.perception is in active development. Its features and API are subject to significant change as development progresses.
> `com.unity.perception` is in active development. Its features and API are subject to significant change as development progresses.
# Perception Package ([Unity Computer Vision](https://unity.com/computer-vision))

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


"com.unity.collections": "0.9.0-preview.6",
"com.unity.nuget.newtonsoft-json": "1.1.2",
"com.unity.render-pipelines.core": "7.1.6",
"com.unity.simulation.capture": "0.0.10-preview.20",
"com.unity.simulation.capture": "0.0.10-preview.23",
"com.unity.simulation.client": "0.0.10-preview.10",
"com.unity.simulation.core": "0.0.10-preview.22"
}

"url": "https://packages.unity.com"
},
"com.unity.simulation.capture": {
"version": "0.0.10-preview.20",
"version": "0.0.10-preview.23",
"com.unity.simulation.core": "0.0.10-preview.22"
"com.unity.simulation.core": "0.0.10-preview.25"
},
"url": "https://packages.unity.com"
},

"url": "https://packages.unity.com"
},
"com.unity.simulation.core": {
"version": "0.0.10-preview.22",
"depth": 1,
"version": "0.0.10-preview.25",
"depth": 2,
"dependencies": {},
"dependencies": {
"com.unity.nuget.newtonsoft-json": "2.0.0-preview"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {

1
TestProjects/PerceptionURP/Assets/Tests/Editor/PerceptionCameraEditorUrpTests.cs


var gameObject = new GameObject();
gameObject.SetActive(false);
gameObject.AddComponent<Camera>();
gameObject.AddComponent<UniversalAdditionalCameraData>();
var perceptionCamera = gameObject.AddComponent<PerceptionCamera>();
gameObject.SetActive(true);
LogAssert.Expect(LogType.Error, "GroundTruthRendererFeature must be present on the ScriptableRenderer associated with the camera. The ScriptableRenderer can be accessed through Edit -> Project Settings... -> Graphics -> Scriptable Render Pipeline Settings -> Renderer List.");

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


"com.unity.collections": "0.9.0-preview.6",
"com.unity.nuget.newtonsoft-json": "1.1.2",
"com.unity.render-pipelines.core": "7.1.6",
"com.unity.simulation.capture": "0.0.10-preview.20",
"com.unity.simulation.capture": "0.0.10-preview.23",
"com.unity.simulation.client": "0.0.10-preview.10",
"com.unity.simulation.core": "0.0.10-preview.22"
}

"url": "https://packages.unity.com"
},
"com.unity.simulation.capture": {
"version": "0.0.10-preview.20",
"version": "0.0.10-preview.23",
"com.unity.simulation.core": "0.0.10-preview.22"
"com.unity.simulation.core": "0.0.10-preview.25"
},
"url": "https://packages.unity.com"
},

"url": "https://packages.unity.com"
},
"com.unity.simulation.core": {
"version": "0.0.10-preview.22",
"depth": 1,
"version": "0.0.10-preview.25",
"depth": 2,
"dependencies": {},
"dependencies": {
"com.unity.nuget.newtonsoft-json": "2.0.0-preview"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {

41
com.unity.perception/CHANGELOG.md


### Known Issues
### Added
Added support for 'step' button in editor.
The user can now choose the base folder location to store their generated datasets.
Added a `projection` field in the capture.sensor metadata. Values are either "perspective" or "orthographic".
### Changed
Changed the JSON serialization key of Normal Sampler's standard deviation property from "standardDeviation" to "stddev". Scneario JSON configurations that were generated using previous versions will need to be manually updated to reflect this change.
### Deprecated
### Removed
### Fixed
Fixed an indexing issue with the IdLabelConfig editor. When a new label was added to an empty Id Label Config with Auto Assign IDs enabled, the starting id (0 or 1) was ignored and the new label would always have an id of 0.
## [0.8.0-preview.4] - 2021-07-05
### Upgrade Notes
### Known Issues
Added random seed field to the Run in Unity Simulation Window
When using URP in OSX, having MSAA enabled on the camera while the post-processing option is disabled may cause the output RGB images to be blank. As a workaround, you can disable MSAA and use FXAA instead, until the issue is fixed.
User can now choose the base folder location to store their generated data.
### Added
Added support for 'step' button in editor.
Added 'projection' field in the capture.sensor metadata. Values are either "perspective" or "orthographic"
Added random seed field to the Run in Unity Simulation Window.
Increased color variety in instance segmentation images
Increased color variety in instance segmentation images.
Upgraded capture package dependency to 0.0.10-preview.22 to fix an issue with URP where post processing effects were not included when capturing images.
Changed the JSON serialization key of Normal Sampler's standard deviation property from "standardDeviation" to "stddev". Scneario JSON configurations that were generated using previous versions will need to be manually updated to reflect this change.
Upgraded capture package dependency to 0.0.10-preview.23 to fix two issues: (1) Post processing effects were not included when capturing images in URP (2) RGB images were upside-down when post processing effects were enabled and FXAA disabled.
### Deprecated

Fixed an issue where Simulation Delta Time values larger than 100 seconds (in Perception Camera) would cause incorrect capture scheduling behavior.
Fixed an issue where Simulation Delta Time values larger than 100 seconds in Perception Camera would cause incorrect capture scheduling behavior.
Fixed an issue where Categorical Parameters sometimes tried to fetch items at `i = categories.Count`, which caused an exception.

2
com.unity.perception/Documentation~/Tutorial/Phase1.md


The output dataset includes a variety of information about different aspects of the active sensors in the Scene (currently only one), as well as the ground-truth generated by all active Labelers. [This page](https://github.com/Unity-Technologies/com.unity.perception/blob/master/com.unity.perception/Documentation%7E/Schema/Synthetic_Dataset_Schema.md) provides a comprehensive explanation on the schema of this dataset. We strongly recommend having a look at the page once you have completed this tutorial.
> :information_source: Are the RGB images blank? This may be a bug. When using URP in OSX, having MSAA enabled on the camera may cause the output RGB images to be blank. As a workaround, you can disable MSAA and use FXAA instead, until the issue is fixed.
> :information_source: Are the RGB images blank? This may be a bug. When using URP in OSX, having MSAA enabled on the camera may cause the output RGB images to be blank. As a workaround, you can disable MSAA and use FXAA instead, until the issue is fixed. To do this, select `Main Camera`, and in the ***Inspector*** view of the Camera component, in the ***Output*** section, set MSAA to `Off`. If you would like to use FXAA, in the ***Rendering*** section, set the Anti-aliasing option to `Fast Approximate Anti-aliasing (FXAA)`.
* **:green_circle: Action**: To get a quick feel of how the data is stored, open the folder whose name starts with `Dataset`, then open the file named `captures_000.json`. This file contains the output from `BoundingBox2DLabeler`. The `captures` array contains the position and rotation of the sensor (camera), the position and rotation of the ego (sensor group, currently only one), and the annotations made by `BoundingBox2DLabeler` for all visible objects defined in its label configuration. For each visible object, the annotations include:
* `label_id`: The numerical id assigned to this object's label in the Labeler's label configuration

34
com.unity.perception/Documentation~/Tutorial/Phase2.md


The purpose of this piece of code is to obtain a random float Parameter and assign it to the light's `Intensity` field on the start of every Iteration. Let's go through the code above and understand each part. The `FloatParameter` field makes it possible for us to define a randomized float Parameter and modify its properties from the editor UI, similar to how we already modified the properties for the previous Randomizers we used.
> :information_source: If you look at the _**Console**_ tab of the editor now, you will see an error regarding `MyLightRandomizerTag` not being found. This is to be expected, since we have not yet created this class; the error will go away once we create the class later.
If you return to your list of Randomizers in the _**Inspector**_ view of `SimulationScenario`, you can now add this new Randomizer.
* **:green_circle: Action**: Add `MyLightRandomizer` to the list of Randomizers in `SimulationScenario`.
You will notice that the Randomizer's UI snippet contains one Parameter named `Light Intensity Parameter`. This is the same Parameter we added in the code block above. Here, you can set the sampling distribution (`Value`) and `Range` for this float Parameter:
<p align="center">
<img src="Images/light_rand_1.png" width="420"/>
</p>
* **:green_circle: Action**: In the UI snippet for `MyLightRandomzier`, set the minimum and maximum for range to **0.5** and **3**.
This range of intensities is arbitrary but will give us a typically nice lighting without excessive darkness or burnt-out highlights.
> :information_source: If you look at the _**Console**_ tab of the editor now, you will see an error regarding `MyLightRandomizerTag` not being found. This is normal, because we have not yet created this class; the error will go away once we create the class later.
The `MyLightRandomizer` class extends `Randomizer`, which is the base class for all Randomizers that can be added to a Scenario. This base class provides a plethora of useful functions and properties that can help catalyze the process of creating new Randomizers.

Yes, a RandomizerTag can be this simple if you just need it for helping Randomizers query for target objects. Later, you will learn how to add code here to encapsulate more data and logic within the randomized objects.
Notice there is a `RequireComponent(typeof(Light))` line at the top. This line makes it so that you can only add the `MyLightRandomizerTag` component to an object that already has a `Light` component attached. This way, the Randomizers that query for this tag can be confident that the found tags are attached to GameObjects that also have a `Light` component, and can thus be Randomized.
If you return to your list of Randomizers in the _**Inspector**_ view of `SimulationScenario`, you can now add the new Randomizer we created here.
* **:green_circle: Action**: Add `MyLightRandomizer` to the list of Randomizers in `SimulationScenario`.
You will notice that the Randomizer's UI snippet contains one Parameter named `Light Intensity Parameter`. This is the same Parameter we added in the code block above. Here, you can set the sampling distribution (`Value`) and `Range` for this float Parameter:
<p align="center">
<img src="Images/light_rand_1.png" width="420"/>
</p>
* **:green_circle: Action**: In the UI snippet for `MyLightRandomzier`, set the minimum and maximum for range to **0.5** and **3**.
This range of intensities is arbitrary but will give us a typically nice lighting without excessive darkness or burnt-out highlights.
It is now time to add the tag we created earlier to the light in our Scene, so that the Randomizer can find it.
* **:green_circle: Action**: Select `Directional Light` in the Scene's _**Hierarchy**_, and in the _**Inspector**_ tab, add a `My Light Randomizer Tag` component.
* **:green_circle: Action**: Run the simulation again and inspect how `Directional Light` now switches between different intensities. You can pause the simulation and then use the step button (to the right of the pause button) to move the simulation one frame forward and clearly see the varying light intensity

12
com.unity.perception/Editor/GroundTruth/IdLabelConfigEditor.cs


protected override IdLabelEntry CreateLabelEntryFromLabelString(SerializedProperty serializedArray,
string labelToAdd)
{
int maxLabel = Int32.MinValue;
var maxLabel = int.MinValue;
for (int i = 0; i < serializedArray.arraySize; i++)
for (var i = 0; i < serializedArray.arraySize; i++)
}
if (maxLabel == -1)
{
var startingLabelId =
(StartingLabelId) serializedObject.FindProperty(nameof(IdLabelConfig.startingLabelId)).enumValueIndex;
if (startingLabelId == StartingLabelId.One)
maxLabel = 0;
}
return new IdLabelEntry

8
com.unity.perception/Runtime/GroundTruth/Labelers/KeypointLabeler.cs


{
include = true;
break;
}
}
}
}
}
}
if (include)
m_KeypointEntriesToReport.Add(entry);
}

return json;
}
}
}
}

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


using Moq;
using Moq.Protected;
using UnityEngine.Rendering;
#endif
namespace EditorTests

var camera = cameraObject.AddComponent<Camera>();
camera.orthographic = true;
camera.orthographicSize = 1;
#elif URP_PRESENT
cameraObject.AddComponent<UnityEngine.Rendering.Universal.UniversalAdditionalCameraData>();
#endif
var perceptionCamera = cameraObject.AddComponent<PerceptionCamera>();

6
com.unity.perception/package.json


"com.unity.collections": "0.9.0-preview.6",
"com.unity.nuget.newtonsoft-json": "1.1.2",
"com.unity.render-pipelines.core": "7.1.6",
"com.unity.simulation.capture": "0.0.10-preview.22",
"com.unity.simulation.capture": "0.0.10-preview.23",
"com.unity.simulation.client": "0.0.10-preview.10",
"com.unity.simulation.core": "0.0.10-preview.22"
},

"unity": "2019.4",
"version": "0.8.0-preview.3",
"version": "0.8.0-preview.4",
"samples": [
{
"displayName": "Tutorial Files",

"path": "Samples~/Human Pose Labeling and Randomization"
}
]
}
}

15
TestProjects/PerceptionURP/ProjectSettings/BurstAotSettings_StandaloneOSX.json


{
"MonoBehaviour": {
"Version": 3,
"EnableBurstCompilation": true,
"EnableOptimisations": true,
"EnableSafetyChecks": false,
"EnableDebugInAllBuilds": false,
"UsePlatformSDKLinker": false,
"CpuMinTargetX32": 0,
"CpuMaxTargetX32": 0,
"CpuMinTargetX64": 0,
"CpuMaxTargetX64": 0,
"CpuTargetsX64": 72
}
}
正在加载...
取消
保存