浏览代码

Merge pull request #6 from Unity-Technologies/docs

Adding License and start to doc's and getting started
/main
GitHub 4 年前
当前提交
10e58e2b
共有 20 个文件被更改,包括 2278 次插入49 次删除
  1. 2
      .yamato/promotion.yml
  2. 6
      .yamato/upm-ci-full.yml
  3. 16
      .yamato/upm-ci-testprojects.yml
  4. 42
      README.md
  5. 202
      com.unity.perception/LICENSE.md
  6. 48
      com.unity.perception/Documentation~/GettingStarted.md
  7. 35
      com.unity.perception/Documentation~/SetupSteps.md
  8. 7
      com.unity.perception/LICENSE.meta
  9. 82
      com.unity.perception/Documentation~/images/CompletedScene.PNG
  10. 252
      com.unity.perception/Documentation~/images/LabeledObject.PNG
  11. 72
      com.unity.perception/Documentation~/images/LabelingConfigurationFinished.PNG
  12. 148
      com.unity.perception/Documentation~/images/MainCameraConfig.PNG
  13. 101
      com.unity.perception/Documentation~/images/rgb_2.png
  14. 10
      com.unity.perception/Documentation~/images/segmentation_2.png
  15. 19
      com.unity.perception/Documentation~/images/TestProjects.PNG
  16. 81
      com.unity.perception/Documentation~/images/banner.PNG
  17. 196
      com.unity.perception/Documentation~/images/unity-wide.png
  18. 1001
      com.unity.perception/Documentation~/images/banner2.PNG
  19. 7
      com.unity.perception/LICENSE.md.meta

2
.yamato/promotion.yml


# The Yamato build step `publish` will publish the com.unity.perception package to the `upm-candidates` registry. To see which versions of the package have been published, see
# The Yamato build step `publish` will publish the com.unity.perception package to the `upm-candidates` registry. To see which versions of the package have been published, see
# * https://artifactory.prd.cds.internal.unity3d.com/artifactory/webapp/#/artifacts/browse/tree/General/upm-candidates/com.unity.perception
# * https://bintray.com/unity
#test_editors:

6
.yamato/upm-ci-full.yml


commands:
- git submodule update --init --recursive
- npm install upm-ci-utils -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package pack --package-path ./com.unity.perception/
- upm-ci package pack --package-path ./com.unity.perception/
artifacts:
packages:
paths:

dependencies:
- .yamato/upm-ci-full.yml#pack_{{ variant.name }}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
test_trigger:
name: All Tests

16
.yamato/upm-ci-testprojects.yml


{% 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
{% else %}
- utr/utr --testproject=./TestProjects/{{project.name}} --editor-location=./.Editor --artifacts_path=test-results --stdout-filter=minimal --extra-editor-arg="--force-d3d11" {{suite.args}}
- utr/utr --testproject=./TestProjects/{{project.name}} --editor-location=./.Editor --artifacts_path=test-results --stdout-filter=minimal --extra-editor-arg="--force-d3d11" {{suite.args}}
{% endif %}
artifacts:
logs:

{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
{% for editor in test_editors %}

commands:
- git submodule update --init --recursive
- unity-downloader-cli -u {{ editor.version }} -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
- .\.Editor\Unity.exe -projectPath ./TestProjects/PerceptionHDRP -testPlatform editmode -runTests -automated -testResults test-results -debugCodeOptimization -enableCodeCoverage -coverageResultsPath test-results -coverageOptions enableCyclomaticComplexity;generateHtmlReport;generateBadgeReport; assemblyFilters:Unity.Perception.Editor;Unity.Perception.Runtime;Unity.Perception.Sensors;
- .\.Editor\Unity.exe -projectPath ./TestProjects/PerceptionHDRP -testPlatform editmode -runTests -automated -testResults test-results -debugCodeOptimization -enableCodeCoverage -coverageResultsPath test-results -coverageOptions enableCyclomaticComplexity;generateHtmlReport;generateBadgeReport; assemblyFilters:Unity.Perception.Editor;Unity.Perception.Runtime;Unity.Perception.Sensors;
- .\.Editor\Unity.exe -projectPath ./TestProjects/PerceptionHDRP -testPlatform playmode -runTests -automated -testResults test-results -debugCodeOptimization -enableCodeCoverage -coverageResultsPath test-results -coverageOptions enableCyclomaticComplexity;generateHtmlReport;generateBadgeReport; assemblyFilters:Unity.Perception.Editor;Unity.Perception.Runtime;Unity.Perception.Sensors;
# - .\.Editor\Unity.exe -projectPath ./TestProjects/PerceptionHDRP -debugCodeOptimization -enableCodeCoverage -coverageResultsPath test-results -coverageOptions enableCyclomaticComplexity;generateHtmlReport;generateBadgeReport;
artifacts:

- "TestProjects/PerceptionHDRP/test-results/**/*"
dependencies:
- .yamato/upm-ci-full.yml#pack_Perception
{% endfor %}
{% endfor %}
{% endfor %}
{% for editor in test_editors %}

logs:
paths:
- "test-results/**/*"
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
# Not including OSX because the only OSX platform on Bokken with a GPU is a Mac Mini, of which there are only a few and setting up Yamato jobs is very complicated.

# dependencies:
# - .yamato/upm-ci-full.yml#pack_{{ variant.name }}
# {% endfor %}
# {% endfor %}
# {% endfor %}

42
README.md


# Perception
<img src="com.unity.perception/Documentation~/images/unity-wide.png" align="middle" width="3000"/>
The Perception package contains tools for authoring and executing autonomous vehicle simulations. They are organized into two categories: Scenarios and Sensors.
<img src="com.unity.perception/Documentation~/images/banner2.PNG" align="middle"/>
## Scenarios
# Perception
The Perception package provides a toolkit for generating large-scale datasets for perception-based machine learning training and validation. It is focused on a handful of camera-based use cases for now and will ultimately expand to other forms of sensors and machine learning tasks.
TODO
[![license badge](https://img.shields.io/badge/license-Apache--2.0-green.svg)](LICENSE)
# Setup for local development
* Clone the perception repository into an arbirary directory on disk
* Install and use Unity 2019.3.0b7
## Documenation
**Click [here](Documentation~/SetupSteps.md) to setup a Perception project**
## Option 1: PerceptionHDRP/PerceptionURP
The repository includes two projects for local development in `TestProjects`, one set up for HDRP and the other for URP.
**Click [here](Documentation~/GettingStarted.md) to get the started with Perception**
## Option 2: Set up a project from scratch
*The following instructions reference the Unity doc's page on [installing a local package](https://docs.unity3d.com/Manual/upm-ui-local.html)*
* Create a new HDRP project or open an existing one
* Open your project's `<project root>/Packages/manifest.json` in a text editor
* At the end of the file, add `"registry": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"`
* _Note: This step will be removed once the dependency `com.unity.entities-0.2.0-preview.*` is published publically._
* Back in Unity, open the Package Manager window
* Add the High Definition RP package, version 7.1.2 or later
* Click the ***+*** button in the upper lefthand corner of the window
* Click the ***add package from disk*** option
* Select to the package.json file under the com.unity.perception folder in your cloned perception repository
* To allow the compilation and running of tests, add `"testables": [ "com.unity.perception" ]`
* For an example `manifest.json`, see `TestProjects/PerceptionTest/Packages/manifest.json`
* For more on the `manifest.json` schema, see the [Package Manager documentation](https://docs.unity3d.com/Packages/com.unity.package-manager-ui@1.7/manual/index.html#advanced-package-topics)
* [Overview](Documentation~/GroundTruth-Overview.md)
* [Labeling](Documentation~/GroundTruth-Labeling.md)
* [Ground Truth Custom](Documentation~/GroundTruth-Custom.md)
* [Scenario Manager](Documentation~/ScenarioManager.md)
## Suggested IDE Setup
For closest standards conformity and best experience overall, JetBrains Rider or Visual Studio w/ JetBrains Resharper are suggested. For optimal experience, perform the following additional steps:
* To allow navigating to code in all packages included in your project, in your Unity Editor, navigate to `Edit -> Preferences... -> External Tools` and check `Generate all .csproj files.`
* To get automatic feedback and fixups on formatting and naming convention violations, set up Rider/JetBrains with our Unity standard .dotsettings file by following [these instructions](https://github.cds.internal.unity3d.com/unity/com.unity.coding/tree/master/UnityCoding/Packages/com.unity.coding/Coding~/Configs/JetBrains).
* If you use VS Code, install the Editorconfig extension to get automatic code formatting according to our conventions.
## License
* [License](com.unity.perception/LICENSE)

202
com.unity.perception/LICENSE.md


Perception copyright © 2020 Unity Technologies ApS
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2017 Unity Technologies
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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


# Getting Started with SynthDet
This will provide a step by step instructions on creating a new scene using the Perception features to create semantic data and image captures. These steps should work with both options for setup steps of using a existing project or creating a new project. The goal is to have a working scene by the end of these instructions that will provide you with a dataset, rgb images captures, and segmentic data.
If you have not already done the setup steps for the project, click [here](Documentation~/SetupSteps.md) to start project setup.
## Step 1: Create a new scene and camera
1. Create a new scene File-> New Scene
2. Save the Scene File-> Save and give it a name, i.e created scene name is PerceptionScene
3. Select the Main Camera and reset the Position transform to 0
4. In the Hierarchy window select the main camera
1. In the inspector panel of the main camera select Add Component
2. Add a **Perception Camera** component
<img src="docs/images/MainCameraConfig.PNG" align="middle"/>
## Step 2: Create labeled objects
1. In the Hierarchy window right click -> Go to 3D Object -> Select Cube
1. Create 3 Cubes
2. Change the names of the cubes to have 3 seperate names Cube, Box, Crate
3. Position the Cubes in front of the FOV of the main Camera, example image of the completed scene for reference down below
<img src="docs/images/CompletedScene.PNG" align="middle"/>
2. For each object in the scene that was created, from the inspector panel add the script called **Labeling**
1. Click the **+**
2. In the text field add the name of the object i.e Crate
<img src="docs/images/LabeledObject.PNG" align="middle"/>
3. In the Project panel right click -> Perception -> Labeling Configuration
4. Select the **Labeling Configuration** created in the project panel
1. Click the **+**
2. In the label text field add the same text that the Label script contains on the objects created in the scene (i.e Cube, Box, Crate)
3. Add a numerical value to the value field
1. Make sure the labels all have different values, for this example use values of 10,000
<img src="docs/images/LabelingConfigurationFinished.PNG" align="middle"/>
9. Select the Main Camera in the Hierarchy panel
1. In the Perception Camera script in the Labeling Configuration field add the Labeling Configuration script created in previous step
<img src="docs/images/MainCameraConfig.PNG" align="middle"/>
## Step 3: Checking local files
1. Press play in the editor and allow the scene to run for 10 seconds before ending playmode
2. In the console log you will see a Shutdown in Progress message that will show a file path to the location of the generated dataset
3. The file path is the Application Persistent Path + /Defaultcompany/UnityTestFramework/<Hash Key>
1. Example file path on a Windows PC : *C:/Users/<User Name>/AppData/LocalLow/DefaultCompany/UnityTestFramework\2e10ec21-9d97-4cee-b5a2-7e95e299afa4\RGB18f61842-ef8d-4b31-acb5-cb1da36fb7b1*
4. In the output path for the Labeling content you can verify the following data is present:
1. RGB captures
2. Semantic segmentation images
3. Logs
4. JSON Dataset
<img src="docs/images/rgb_2.png" align="middle"/>
<img src="docs/images/segmentation_2.png" align="middle"/>

35
com.unity.perception/Documentation~/SetupSteps.md


# Setup for local development
* Clone the [Perception](https://github.com/Unity-Technologies/com.unity.perception) repository into an arbirary directory on disk
* Install and use Unity latest [2019.3 Unity editor](https://unity3d.com/unity/beta/2019.3#downloads)
## Setting up a Project
Down below are 2 options for getting started using the Perception SDK, Option 1 is opening existing test projects in the repository. Option 2 a guide on how to create a new
Unity project and intergrate the Perception
### Option 1: PerceptionHDRP & PerceptionURP Projects
The repository includes two projects for local development in `TestProjects` folder, one set up for HDRP and the other for URP. You can open these with the Unity
editor you installed in Setup instructions.
<img src="docs/images/TestProjects.PNG" align="middle"/>
### Option 2: Create a new Project
These option is walkthrough in creating a new project, then adding the Perception SDK package to the project for development use.
*The following instructions reference the Unity doc's page on [installing a local package](https://docs.unity3d.com/Manual/upm-ui-local.html)*
#### Create a new project
1. Create a new HDRP project or open an existing project
1. Creating anew HDRP project can be done by creating a new project using the HDRP template
2. Back in Unity editor, got Window -> Package Manager
1. Add the High Definition RP package, version 7.1.2 or later from the packages list
2. In the Package Manager window find and click the ***+*** button in the upper lefthand corner of the window
3. Select the ***add package from disk*** option
4. Navigate to the com.unity.perception folder in your cloned repository and select the package.json file
3. Once you have a project with Perception SDK installed you can move forward to the Getting Started walkthrough
Once completed you can move on to the getting started steps, click [here](Documentation~/GettingStarted.md) to start project setup.
## Suggested IDE Setup
For closest standards conformity and best experience overall, JetBrains Rider or Visual Studio w/ JetBrains Resharper are suggested. For optimal experience, perform the following additional steps:
* To allow navigating to code in all packages included in your project, in your Unity Editor, navigate to `Edit -> Preferences... -> External Tools` and check `Generate all .csproj files.`
* To get automatic feedback and fixups on formatting and naming convention violations, set up Rider/JetBrains with our Unity standard .dotsettings file by following [these instructions](https://github.cds.internal.unity3d.com/unity/com.unity.coding/tree/master/UnityCoding/Packages/com.unity.coding/Coding~/Configs/JetBrains).
* If you use VS Code, install the Editorconfig extension to get automatic code formatting according to our convention

7
com.unity.perception/LICENSE.meta


fileFormatVersion: 2
guid: 1011799e246cfca4085ea04ca29c9ab0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

82
com.unity.perception/Documentation~/images/CompletedScene.PNG

之前 之后
宽度: 713  |  高度: 897  |  大小: 56 KiB

252
com.unity.perception/Documentation~/images/LabeledObject.PNG

之前 之后
宽度: 702  |  高度: 869  |  大小: 61 KiB

72
com.unity.perception/Documentation~/images/LabelingConfigurationFinished.PNG

之前 之后
宽度: 702  |  高度: 249  |  大小: 15 KiB

148
com.unity.perception/Documentation~/images/MainCameraConfig.PNG

之前 之后
宽度: 707  |  高度: 589  |  大小: 56 KiB

101
com.unity.perception/Documentation~/images/rgb_2.png
文件差异内容过多而无法显示
查看文件

10
com.unity.perception/Documentation~/images/segmentation_2.png
文件差异内容过多而无法显示
查看文件

19
com.unity.perception/Documentation~/images/TestProjects.PNG

之前 之后
宽度: 499  |  高度: 139  |  大小: 6.2 KiB

81
com.unity.perception/Documentation~/images/banner.PNG

之前 之后
宽度: 959  |  高度: 210  |  大小: 21 KiB

196
com.unity.perception/Documentation~/images/unity-wide.png

之前 之后
宽度: 3000  |  高度: 500  |  大小: 27 KiB

1001
com.unity.perception/Documentation~/images/banner2.PNG
文件差异内容过多而无法显示
查看文件

7
com.unity.perception/LICENSE.md.meta


fileFormatVersion: 2
guid: e03bbcfdc78278d4eba1293b50f01197
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存