浏览代码

Aisv756 obj count bug (#84)

* Fixes for object count bug

* Updated change log
/main
GitHub 4 年前
当前提交
c8f54784
共有 4 个文件被更改,包括 29 次插入7 次删除
  1. 5
      com.unity.perception/CHANGELOG.md
  2. 13
      com.unity.perception/Runtime/GroundTruth/Labelers/ObjectCountLabeler.cs
  3. 8
      com.unity.perception/Runtime/GroundTruth/Labelers/RenderedObjectInfoLabeler.cs
  4. 10
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/HUDPanel.cs

5
com.unity.perception/CHANGELOG.md


### Fixed
Fixed visualization issue where object count and pixel count labelers were shown stale values
Fixed visualization issue where HUD entry labels could be too long and take up the entire panel
## [0.4.0-preview.1] - 2020-08-07
### Added

### Removed
### Fixed
Fixed 2d bounding boxes being reported for objects that do not match the label config.
Fixed a categorical parameter UI error in which deleting an individual option would successfully remove the option from the UI but only serialize the option to null during serialization instead of removing it

Changed minimum Unity Editor version to 2019.4
### Fixed
Fixed compilation warnings with latest com.unity.simulation.core package.
Fixed errors in example script when exiting play mode

13
com.unity.perception/Runtime/GroundTruth/Labelers/ObjectCountLabeler.cs


if (m_ClassCountValues == null || m_ClassCountValues.Length != entries.Count)
m_ClassCountValues = new ClassCountValue[entries.Count];
bool visualize = visualizationEnabled;
var visualize = visualizationEnabled;
if (visualize)
{
// Clear out all of the old entries...
hudPanel.RemoveEntries(this);
}
for (var i = 0; i < entries.Count; i++)
{
m_ClassCountValues[i] = new ClassCountValue()

count = counts[i]
};
if (visualize)
// Only display entries with a count greater than 0
if (visualize && counts[i] > 0)
}
}

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


if (m_VisiblePixelsValues == null || m_VisiblePixelsValues.Length != renderedObjectInfos.Length)
m_VisiblePixelsValues = new RenderedObjectInfoValue[renderedObjectInfos.Length];
bool visualize = visualizationEnabled;
var visualize = visualizationEnabled;
if (visualize)
{
// Clear out all of the old entries...
hudPanel.RemoveEntries(this);
}
for (var i = 0; i < renderedObjectInfos.Length; i++)
{
var objectInfo = renderedObjectInfos[i];

10
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/HUDPanel.cs


using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEngine.UI;

const int k_YPadding = 10;
const int k_BoxWidth = 200;
const int k_YLineSpacing = 4;
const int k_MaxKeyLength = 20;
/// <summary>
/// The number of labelers currently displaying real-time information on the visualization HUD

GUI.skin.label.font = Resources.Load<Font>("Inter-Light");
GUI.skin.label.padding = new RectOffset(0, 0, 1, 1);
GUI.skin.label.margin = new RectOffset(0, 0, 1, 1);
GUI.skin.label.wordWrap = false;
GUI.skin.label.clipping = TextClipping.Clip;
GUI.skin.box.padding = new RectOffset(5, 5, 5, 5);
GUI.skin.toggle.margin = new RectOffset(0, 0, 0, 0);
GUI.skin.horizontalSlider.margin = new RectOffset(0, 0, 0, 0);

{
GUILayout.BeginHorizontal();
GUILayout.Space(5);
GUILayout.Label(entry.Key);
var k = new StringBuilder(entry.Key.Substring(0, Math.Min(entry.Key.Length, k_MaxKeyLength)));
if (k.Length != entry.Key.Length)
k.Append("...");
GUILayout.Label(k.ToString());
GUILayout.FlexibleSpace();
GUILayout.Label(entry.Value);
GUILayout.EndHorizontal();

正在加载...
取消
保存