Skip to content

Commit 6b70aea

Browse files
committed
Merge branch 'master' into add_imageLink_field
2 parents 1d13828 + fa5af90 commit 6b70aea

File tree

12 files changed

+105
-50
lines changed

12 files changed

+105
-50
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
[![license badge](https://img.shields.io/badge/license-Apache--2.0-green.svg)](LICENSE.md)
88

99
<img src="https://img.shields.io/badge/unity-2019.4-green.svg?style=flat-square" alt="unity 2019.4">
10-
<img src="https://img.shields.io/badge/unity-2020.3-green.svg?style=flat-square" alt="unity 2020.3">
10+
<img src="https://img.shields.io/badge/unity-2020.2-green.svg?style=flat-square" alt="unity 2020.3">
1111

12-
> com.unity.perception is in active development. Its features and API are subject to significant change as development progresses.
12+
> `com.unity.perception` is in active development. Its features and API are subject to significant change as development progresses.
1313
1414

1515
# Perception Package ([Unity Computer Vision](https://unity.com/computer-vision))

TestProjects/PerceptionHDRP/Packages/packages-lock.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"com.unity.collections": "0.9.0-preview.6",
8282
"com.unity.nuget.newtonsoft-json": "1.1.2",
8383
"com.unity.render-pipelines.core": "7.1.6",
84-
"com.unity.simulation.capture": "0.0.10-preview.20",
84+
"com.unity.simulation.capture": "0.0.10-preview.23",
8585
"com.unity.simulation.client": "0.0.10-preview.10",
8686
"com.unity.simulation.core": "0.0.10-preview.22"
8787
}
@@ -126,11 +126,11 @@
126126
"url": "https://packages.unity.com"
127127
},
128128
"com.unity.simulation.capture": {
129-
"version": "0.0.10-preview.20",
129+
"version": "0.0.10-preview.23",
130130
"depth": 1,
131131
"source": "registry",
132132
"dependencies": {
133-
"com.unity.simulation.core": "0.0.10-preview.22"
133+
"com.unity.simulation.core": "0.0.10-preview.25"
134134
},
135135
"url": "https://packages.unity.com"
136136
},
@@ -142,10 +142,12 @@
142142
"url": "https://packages.unity.com"
143143
},
144144
"com.unity.simulation.core": {
145-
"version": "0.0.10-preview.22",
146-
"depth": 1,
145+
"version": "0.0.10-preview.25",
146+
"depth": 2,
147147
"source": "registry",
148-
"dependencies": {},
148+
"dependencies": {
149+
"com.unity.nuget.newtonsoft-json": "2.0.0-preview"
150+
},
149151
"url": "https://packages.unity.com"
150152
},
151153
"com.unity.test-framework": {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public IEnumerator MissingRendererFeature_ProducesLogError()
4141
var gameObject = new GameObject();
4242
gameObject.SetActive(false);
4343
gameObject.AddComponent<Camera>();
44+
gameObject.AddComponent<UniversalAdditionalCameraData>();
4445
var perceptionCamera = gameObject.AddComponent<PerceptionCamera>();
4546
gameObject.SetActive(true);
4647
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.");

TestProjects/PerceptionURP/Packages/packages-lock.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"com.unity.collections": "0.9.0-preview.6",
8282
"com.unity.nuget.newtonsoft-json": "1.1.2",
8383
"com.unity.render-pipelines.core": "7.1.6",
84-
"com.unity.simulation.capture": "0.0.10-preview.20",
84+
"com.unity.simulation.capture": "0.0.10-preview.23",
8585
"com.unity.simulation.client": "0.0.10-preview.10",
8686
"com.unity.simulation.core": "0.0.10-preview.22"
8787
}
@@ -115,11 +115,11 @@
115115
"url": "https://packages.unity.com"
116116
},
117117
"com.unity.simulation.capture": {
118-
"version": "0.0.10-preview.20",
118+
"version": "0.0.10-preview.23",
119119
"depth": 1,
120120
"source": "registry",
121121
"dependencies": {
122-
"com.unity.simulation.core": "0.0.10-preview.22"
122+
"com.unity.simulation.core": "0.0.10-preview.25"
123123
},
124124
"url": "https://packages.unity.com"
125125
},
@@ -131,10 +131,12 @@
131131
"url": "https://packages.unity.com"
132132
},
133133
"com.unity.simulation.core": {
134-
"version": "0.0.10-preview.22",
135-
"depth": 1,
134+
"version": "0.0.10-preview.25",
135+
"depth": 2,
136136
"source": "registry",
137-
"dependencies": {},
137+
"dependencies": {
138+
"com.unity.nuget.newtonsoft-json": "2.0.0-preview"
139+
},
138140
"url": "https://packages.unity.com"
139141
},
140142
"com.unity.test-framework": {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"MonoBehaviour": {
3+
"Version": 3,
4+
"EnableBurstCompilation": true,
5+
"EnableOptimisations": true,
6+
"EnableSafetyChecks": false,
7+
"EnableDebugInAllBuilds": false,
8+
"UsePlatformSDKLinker": false,
9+
"CpuMinTargetX32": 0,
10+
"CpuMaxTargetX32": 0,
11+
"CpuMinTargetX64": 0,
12+
"CpuMaxTargetX64": 0,
13+
"CpuTargetsX64": 72
14+
}
15+
}

com.unity.perception/CHANGELOG.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,54 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1212
### Known Issues
1313

1414
### Added
15-
Added support for 'step' button in editor.
1615

17-
Added random seed field to the Run in Unity Simulation Window
16+
The user can now choose the base folder location to store their generated datasets.
17+
18+
Added a `projection` field in the capture.sensor metadata. Values are either "perspective" or "orthographic".
19+
20+
### Changed
21+
22+
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.
23+
24+
### Deprecated
25+
26+
### Removed
1827

19-
User can now choose the base folder location to store their generated data.
28+
### Fixed
2029

21-
Added 'projection' field in the capture.sensor metadata. Values are either "perspective" or "orthographic"
30+
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.
31+
32+
## [0.8.0-preview.4] - 2021-07-05
33+
34+
### Upgrade Notes
35+
36+
### Known Issues
37+
38+
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.
39+
40+
### Added
41+
42+
Added support for 'step' button in editor.
43+
44+
Added random seed field to the Run in Unity Simulation Window.
2245

2346
### Changed
24-
Increased color variety in instance segmentation images
2547

26-
The PoissonDiskSampling utility now samples a larger region of points to then crop to size of the intended region to prevent edge case bias.
48+
Increased color variety in instance segmentation images.
2749

28-
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.
50+
The PoissonDiskSampling utility now samples a larger region of points to then crop to size of the intended region to prevent edge case bias.
2951

30-
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.
52+
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.
3153

3254
### Deprecated
3355

3456
### Removed
3557

3658
### Fixed
59+
3760
Fixed keypoint labeling bug when visualizations are disabled.
3861

39-
Fixed an issue where Simulation Delta Time values larger than 100 seconds (in Perception Camera) would cause incorrect capture scheduling behavior.
62+
Fixed an issue where Simulation Delta Time values larger than 100 seconds in Perception Camera would cause incorrect capture scheduling behavior.
4063

4164
Fixed an issue where Categorical Parameters sometimes tried to fetch items at `i = categories.Count`, which caused an exception.
4265

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ In this folder, you will find a few types of data, depending on your `Perception
391391

392392
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.
393393

394-
> :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.
394+
> :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)`.
395395
396396
* **: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:
397397
* `label_id`: The numerical id assigned to this object's label in the Labeler's label configuration

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

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,7 @@ public class MyLightRandomizer : Randomizer
4646

4747
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.
4848

49-
> :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.
50-
51-
If you return to your list of Randomizers in the _**Inspector**_ view of `SimulationScenario`, you can now add this new Randomizer.
52-
53-
* **:green_circle: Action**: Add `MyLightRandomizer` to the list of Randomizers in `SimulationScenario`.
54-
55-
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:
56-
57-
<p align="center">
58-
<img src="Images/light_rand_1.png" width="420"/>
59-
</p>
60-
61-
62-
* **:green_circle: Action**: In the UI snippet for `MyLightRandomzier`, set the minimum and maximum for range to **0.5** and **3**.
63-
64-
This range of intensities is arbitrary but will give us a typically nice lighting without excessive darkness or burnt-out highlights.
49+
> :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.
6550
6651
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.
6752

@@ -85,6 +70,23 @@ Yes, a RandomizerTag can be this simple if you just need it for helping Randomiz
8570

8671
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.
8772

73+
If you return to your list of Randomizers in the _**Inspector**_ view of `SimulationScenario`, you can now add the new Randomizer we created here.
74+
75+
* **:green_circle: Action**: Add `MyLightRandomizer` to the list of Randomizers in `SimulationScenario`.
76+
77+
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:
78+
79+
<p align="center">
80+
<img src="Images/light_rand_1.png" width="420"/>
81+
</p>
82+
83+
84+
* **:green_circle: Action**: In the UI snippet for `MyLightRandomzier`, set the minimum and maximum for range to **0.5** and **3**.
85+
86+
This range of intensities is arbitrary but will give us a typically nice lighting without excessive darkness or burnt-out highlights.
87+
88+
It is now time to add the tag we created earlier to the light in our Scene, so that the Randomizer can find it.
89+
8890
* **:green_circle: Action**: Select `Directional Light` in the Scene's _**Hierarchy**_, and in the _**Inspector**_ tab, add a `My Light Randomizer Tag` component.
8991
* **: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
9092

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,24 @@ void BindItem(VisualElement e, int i)
149149
protected override IdLabelEntry CreateLabelEntryFromLabelString(SerializedProperty serializedArray,
150150
string labelToAdd)
151151
{
152-
int maxLabel = Int32.MinValue;
152+
var maxLabel = int.MinValue;
153153
if (serializedArray.arraySize == 0)
154154
maxLabel = -1;
155155

156-
for (int i = 0; i < serializedArray.arraySize; i++)
156+
for (var i = 0; i < serializedArray.arraySize; i++)
157157
{
158158
var item = serializedArray.GetArrayElementAtIndex(i);
159159
maxLabel = math.max(maxLabel, item.FindPropertyRelative(nameof(IdLabelEntry.id)).intValue);
160160
}
161161

162+
if (maxLabel == -1)
163+
{
164+
var startingLabelId =
165+
(StartingLabelId) serializedObject.FindProperty(nameof(IdLabelConfig.startingLabelId)).enumValueIndex;
166+
if (startingLabelId == StartingLabelId.One)
167+
maxLabel = 0;
168+
}
169+
162170
return new IdLabelEntry
163171
{
164172
id = maxLabel + 1,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,12 @@ private void OnRenderedObjectInfoReadback(int frameCount, NativeArray<RenderedOb
224224
{
225225
include = true;
226226
break;
227-
}
228-
}
227+
}
228+
}
229229

230230
if (!include && objectFilter == KeypointObjectFilter.VisibleAndOccluded)
231231
include = keypointSet.Value.keypoints.Any(k => k.state == 1);
232-
}
232+
}
233233
if (include)
234234
m_KeypointEntriesToReport.Add(entry);
235235
}
@@ -617,4 +617,4 @@ KeypointJson TemplateToJson(KeypointTemplate input)
617617
return json;
618618
}
619619
}
620-
}
620+
}

0 commit comments

Comments
 (0)