Class CameraSensorComponent
A SensorComponent that creates a CameraSensor.
Inherited Members
Namespace: Unity.MLAgents.Sensors
Syntax
[AddComponentMenu("ML Agents/Camera Sensor", 50)]
public class CameraSensorComponent : SensorComponent
Properties
Camera
Camera object that provides the data to the sensor.
Declaration
public Camera Camera { get; set; }
Property Value
Type | Description |
---|---|
Camera |
CompressionType
The compression type to use for the sensor.
Declaration
public SensorCompressionType CompressionType { get; set; }
Property Value
Type | Description |
---|---|
SensorCompressionType |
Grayscale
Whether to generate grayscale images or color. Note that changing this after the sensor is created has no effect.
Declaration
public bool Grayscale { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Height
Height of the generated observation. Note that changing this after the sensor is created has no effect.
Declaration
public int Height { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
ObservationStacks
Whether to stack previous observations. Using 1 means no previous observations. Note that changing this after the sensor is created has no effect.
Declaration
public int ObservationStacks { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
SensorName
Name of the generated CameraSensor object. Note that changing this at runtime does not affect how the Agent sorts the sensors.
Declaration
public string SensorName { get; set; }
Property Value
Type | Description |
---|---|
String |
Width
Width of the generated observation. Note that changing this after the sensor is created has no effect.
Declaration
public int Width { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
CreateSensor()
Creates the CameraSensor
Declaration
public override ISensor CreateSensor()
Returns
Type | Description |
---|---|
ISensor | The created CameraSensor object for this component. |
Overrides
GetObservationShape()
Computes the observation shape of the sensor.
Declaration
public override int[] GetObservationShape()
Returns
Type | Description |
---|---|
Int32[] | The observation shape of the associated CameraSensor object. |