浏览代码

Merge branch 'master' into generic-asset-sources

/generic-asset-sources
sleal-unity 3 年前
当前提交
4da33e39
共有 7 个文件被更改,包括 87 次插入14 次删除
  1. 12
      README.md
  2. 4
      com.unity.perception/CHANGELOG.md
  3. 9
      com.unity.perception/Documentation~/HPTutorial/TUTORIAL.md
  4. 3
      com.unity.perception/Documentation~/Tutorial/Phase1.md
  5. 43
      com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs
  6. 20
      com.unity.perception/Runtime/GroundTruth/SimulationState.cs
  7. 10
      com.unity.perception/Runtime/Randomization/Parameters/CategoricalParameter.cs

12
README.md


|[Dataset Capture](com.unity.perception/Documentation~/DatasetCapture.md)|Ensures sensors are triggered at proper rates and accepts data for the JSON dataset.|
|[Randomization](com.unity.perception/Documentation~/Randomization/Index.md)|The Randomization tool set lets you integrate domain randomization principles into your simulation.|
## Community and Support
For setup problems or discussions about leveraging the Perception package in your project, please create a new thread on the **[Unity Computer Vision forum](https://forum.unity.com/forums/computer-vision.626/)** and make sure to include as much detail as possible. If you run into any other problems with the Perception package or have a specific feature request, please submit a **[GitHub issue](https://github.com/Unity-Technologies/com.unity.perception/issues)**.
For any other questions or feedback, connect directly with the Computer Vision team at [computer-vision@unity3d.com](mailto:computer-vision@unity3d.com).
## Example Projects
### SynthDet

## License
* [License](com.unity.perception/LICENSE.md)
## Community and Feedback
For setup problems or discussions about leveraging the Perception package in your project, please create a new thread on the [Unity Computer Vision forum](https://forum.unity.com/forums/computer-vision.626/) and make sure to include as much detail as possible. If you run into any other problems with the Perception package or have a specific feature request, please submit a [GitHub issue](https://github.com/Unity-Technologies/com.unity.perception/issues).
For any other questions or feedback, connect directly with the Computer Vision team at [computer-vision@unity3d.com](mailto:computer-vision@unity3d.com).
## Citation
If you find this package useful, consider citing it using:

4
com.unity.perception/CHANGELOG.md


Added AssetSource class for loading assets from generic sources inside randomizers
User can now choose the base folder location to store their generated data.
### Changed
Increased color variety in instance segmentation images

Fixed keypoint labeling bug when visualizations are disabled.
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.
## [0.8.0-preview.3] - 2021-03-24
### Changed

9
com.unity.perception/Documentation~/HPTutorial/TUTORIAL.md


* [Step 5: Add Joints to the Character and Customize Keypoint Templates](#step-5)
* [Step 6: Randomize the Humanoid Character's Animations](#step-6)
> :information_source: If you face any problems while following this tutorial, please create a post on the **[Unity Computer Vision forum](https://forum.unity.com/forums/computer-vision.626/)** or the **[GitHub issues](https://github.com/Unity-Technologies/com.unity.perception/issues)** page and include as much detail as possible.
### <a name="step-1">Step 1: Import `.fbx` Models and Animations</a>
This tutorial assumes that you have already created a Unity project, installed the Perception package, and set up a Scene with a `Perception Camera` inside. If this is not the case, please follow **steps 1 to 3** of [Phase 1 of the Perception Tutorial](../Tutorial/Phase1.md).

</p>
* **:green_circle: Action**: Return to `Perception Camera` and assign `HPE_IdLabelConfig` to the `KeyPointLabeler`'s label configuration property.
* **:green_circle: Action**: Search in the _**Project**_ tab for `CocoKeypointTemplate`, with the scope set to _**In Packages**_. Drag and drop the found asset into the `Active Template` field of the `Perception Camera`.
</p>
</p>
Note the `CocoKeypointTemplate` asset that is already assigned as the `Active Template`. This template will tell the labeler how to map default Unity rig joints to human joint labels in the popular COCO dataset so that the output of the labeler can be easily converted to COCO format. Later in this tutorial, we will learn how to add more joints to our character and how to customize joint mapping templates.
The `Active Template` tells the labeler how to map default Unity rig joints to human joint labels in the popular COCO dataset so that the output of the labeler can be easily converted to COCO format. Later in this tutorial, we will learn how to add more joints to our character and how to customize joint mapping templates.
<p align="center">
<img src="Images/take_objects_keypoints.gif" width="600"/>

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


* [Step 7: Inspect Generated Synthetic Data](#step-7)
* [Step 8: Verify Data Using Dataset Insights](#step-8)
> :information_source: If you face any problems while following this tutorial, please create a post on the **[Unity Computer Vision forum](https://forum.unity.com/forums/computer-vision.626/)** or the **[GitHub issues](https://github.com/Unity-Technologies/com.unity.perception/issues)** page and include as much detail as possible.
### <a name="step-1">Step 1: Download Unity Editor and Create a New Project</a>
* **:green_circle: Action**: Navigate to [this](https://unity3d.com/get-unity/download/archive) page to download and install the latest version of **Unity Editor 2020.2.x**. (The tutorial has not yet been fully tested on newer versions.)

43
com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs


m_LabelersList.DoLayoutList();
}
var s = new GUIStyle(EditorStyles.textField);
s.wordWrap = true;
var defaultColor = s.normal.textColor;
EditorGUILayout.LabelField("Latest Output Folder");
EditorGUILayout.LabelField("Latest Generated Dataset");
EditorGUILayout.HelpBox(dir, MessageType.None);
s.normal.textColor = Color.green;
EditorGUILayout.LabelField(dir, s);
if (GUILayout.Button("Show Folder"))
{
EditorUtility.RevealInFinder(dir);

GUILayout.EndHorizontal();
GUILayout.EndVertical();
}
GUILayout.Space(10);
var userBaseDir = PlayerPrefs.GetString(SimulationState.userBaseDirectoryKey);
if (userBaseDir == string.Empty)
{
var folder = PlayerPrefs.GetString(SimulationState.defaultOutputBaseDirectory);
userBaseDir = folder != string.Empty ? folder : Application.persistentDataPath;
}
EditorGUILayout.LabelField("Output Base Folder");
GUILayout.BeginVertical("TextArea");
s.normal.textColor = defaultColor;
EditorGUILayout.LabelField(userBaseDir, s);
GUILayout.BeginHorizontal();
if (GUILayout.Button("Change Folder"))
{
var path = EditorUtility.OpenFolderPanel("Choose Output Folder", "", "");
if (path.Length != 0)
{
Debug.Log($"Chose path: {path}");
PlayerPrefs.SetString(SimulationState.userBaseDirectoryKey, path);
}
}
GUILayout.EndHorizontal();
GUILayout.EndVertical();
if (EditorSettings.asyncShaderCompilation)
{

20
com.unity.perception/Runtime/GroundTruth/SimulationState.cs


float m_LastTimeScale;
readonly string m_OutputDirectoryName;
string m_OutputDirectoryPath;
public const string userBaseDirectoryKey = "userBaseDirectory";
public const string defaultOutputBaseDirectory = "defaultOutputBaseDirectory";
public bool IsRunning { get; private set; }

public SimulationState(string outputDirectory)
{
PlayerPrefs.SetString(defaultOutputBaseDirectory, Configuration.Instance.GetStorageBasePath());
PlayerPrefs.SetString(latestOutputDirectoryKey, Manager.Instance.GetDirectoryFor());
var basePath = PlayerPrefs.GetString(userBaseDirectoryKey, string.Empty);
if (basePath != string.Empty)
{
if (Directory.Exists(basePath))
{
Configuration.localPersistentDataPath = basePath;
}
else
{
Debug.LogWarning($"Passed in directory to store simulation artifacts: {basePath}, does not exist. Using default directory {Configuration.localPersistentDataPath} instead.");
basePath = Configuration.localPersistentDataPath;
}
}
PlayerPrefs.SetString(latestOutputDirectoryKey, Manager.Instance.GetDirectoryFor("", basePath));
IsRunning = true;
}

10
com.unity.perception/Runtime/Randomization/Parameters/CategoricalParameter.cs


public T Sample()
{
var randomValue = m_Sampler.Sample();
return uniform
? m_Categories[(int)(randomValue * m_Categories.Count)]
: m_Categories[BinarySearch(randomValue)];
if (uniform)
{
var index = (int)(randomValue * m_Categories.Count);
index = index == m_Categories.Count ? index - 1 : index;
return m_Categories[index];
}
return m_Categories[BinarySearch(randomValue)];
}
/// <summary>

正在加载...
取消
保存