浏览代码

Some fixes I want to keep before reverting some changes

/coco_export
Steve Borkman 3 年前
当前提交
f12d414e
共有 8 个文件被更改,包括 58 次插入39 次删除
  1. 6
      com.unity.perception/Runtime/GroundTruth/DatasetCapture.cs
  2. 17
      com.unity.perception/Runtime/GroundTruth/Exporters/Coco/CocoExporter.cs
  3. 17
      com.unity.perception/Runtime/GroundTruth/Exporters/PerceptionFormat/PerceptionExporter.cs
  4. 2
      com.unity.perception/Runtime/GroundTruth/Exporters/DatasetExporter.cs.meta
  5. 2
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
  6. 35
      com.unity.perception/Runtime/GroundTruth/Exporters/DatasetExporter.cs
  7. 18
      com.unity.perception/Runtime/GroundTruth/Exporters/IDatasetReporter.cs
  8. 0
      /com.unity.perception/Runtime/GroundTruth/Exporters/DatasetExporter.cs.meta

6
com.unity.perception/Runtime/GroundTruth/DatasetCapture.cs


}
}
public enum OutputMode
{
Perception,
COCO
}
/// <summary>
/// Capture trigger modes for sensors.
/// </summary>

17
com.unity.perception/Runtime/GroundTruth/Exporters/Coco/CocoExporter.cs


namespace UnityEngine.Perception.GroundTruth.Exporters.Coco
{
public class CocoExporter : IDatasetReporter
public class CocoExporter : DatasetExporter
{
bool m_ReportingObjectDetection;
bool m_ReportingKeypoints;

Guid m_SessionGuid;
public void OnSimulationBegin(string directoryName)
public override string GetName()
{
return "COCO";
}
public override void OnSimulationBegin(string directoryName)
{
m_DirectoryName = directoryName;
m_DataCaptured = false;

}
public async void OnSimulationEnd()
public override async void OnSimulationEnd()
{
if (!m_DataCaptured) return;

}
}
public void OnAnnotationRegistered<TSpec>(Guid annotationId, TSpec[] values)
public override void OnAnnotationRegistered<TSpec>(Guid annotationId, TSpec[] values)
{
InitializeCaptureFiles();

};
}
public async Task ProcessPendingCaptures(List<SimulationState.PendingCapture> pendingCaptures, SimulationState simState)
public override async Task ProcessPendingCaptures(List<SimulationState.PendingCapture> pendingCaptures, SimulationState simState)
{
var boxJson = string.Empty;
var keypointJson = string.Empty;

return map;
}
public async Task OnCaptureReported(int frame, int width, int height, string filename)
public override async Task OnCaptureReported(int frame, int width, int height, string filename)
{
InitializeCaptureFiles();

17
com.unity.perception/Runtime/GroundTruth/Exporters/PerceptionFormat/PerceptionExporter.cs


namespace UnityEngine.Perception.GroundTruth.Exporters.PerceptionFormat
{
public class PerceptionExporter : IDatasetReporter
public class PerceptionExporter : DatasetExporter
public void OnSimulationBegin(string directoryName)
public override string GetName()
{
return "Perception";
}
public override void OnSimulationBegin(string directoryName)
public void OnSimulationEnd()
public override void OnSimulationEnd()
public void OnAnnotationRegistered<TSpec>(Guid annotationId, TSpec[] values)
public override void OnAnnotationRegistered<TSpec>(Guid annotationId, TSpec[] values)
{
// do nothing :-)
}

Manager.Instance.ConsumerFileProduced(path);
}
public Task ProcessPendingCaptures(List<SimulationState.PendingCapture> pendingCaptures, SimulationState simState)
public override Task ProcessPendingCaptures(List<SimulationState.PendingCapture> pendingCaptures, SimulationState simState)
{
//lazily allocate for fast zero-write frames
var capturesJArray = new JArray();

return null;
}
public Task OnCaptureReported(int frame, int width, int height, string filename)
public override Task OnCaptureReported(int frame, int width, int height, string filename)
{
// do nothing :-)
return null;

2
com.unity.perception/Runtime/GroundTruth/Exporters/DatasetExporter.cs.meta


fileFormatVersion: 2
guid: 474afd2e32730994ba1d1494b735a911
guid: 4059d02ba7a9f37438dd97e5dae05283
MonoImporter:
externalObjects: {}
serializedVersion: 2

2
com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs


/// </summary>
public CaptureTriggerMode captureTriggerMode = CaptureTriggerMode.Scheduled;
public OutputMode outputMode = OutputMode.Perception;
/// <summary>
/// Have this unscheduled (manual capture) camera affect simulation timings (similar to a scheduled camera) by
/// requesting a specific frame delta time

35
com.unity.perception/Runtime/GroundTruth/Exporters/DatasetExporter.cs


using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace UnityEngine.Perception.GroundTruth.Exporters
{
public abstract class DatasetExporter : MonoBehaviour
{
public void Reset()
{
SimulationState.RegisterExporter(this);
}
public void OnEnable()
{
SimulationState.RegisterExporter(this);
}
public void OnDisable()
{
SimulationState.DeregisterExporter(this);
}
public abstract string GetName();
public abstract void OnSimulationBegin(string directoryName);
public abstract void OnSimulationEnd();
public abstract void OnAnnotationRegistered<TSpec>(Guid annotationId, TSpec[] values);
public abstract Task ProcessPendingCaptures(List<SimulationState.PendingCapture> pendingCaptures, SimulationState simState);
public abstract Task OnCaptureReported(int frame, int width, int height, string filename);
}
}

18
com.unity.perception/Runtime/GroundTruth/Exporters/IDatasetReporter.cs


using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace UnityEngine.Perception.GroundTruth.Exporters
{
public interface IDatasetReporter
{
public void OnSimulationBegin(string directoryName);
public void OnSimulationEnd();
public void OnAnnotationRegistered<TSpec>(Guid annotationId, TSpec[] values);
public Task ProcessPendingCaptures(List<SimulationState.PendingCapture> pendingCaptures, SimulationState simState);
public Task OnCaptureReported(int frame, int width, int height, string filename);
}
}

/com.unity.perception/Runtime/GroundTruth/Exporters/IDatasetReporter.cs.meta → /com.unity.perception/Runtime/GroundTruth/Exporters/DatasetExporter.cs.meta

正在加载...
取消
保存