Class CameraSensor
A sensor that wraps a Camera object to generate visual observations for an agent.
Inherited Members
Namespace: Unity.MLAgents.Sensors
Assembly: solution.dll
Syntax
public class CameraSensor : ISensor, IDisposable
Constructors
| Name | Description |
|---|---|
| CameraSensor(Camera, int, int, bool, string, SensorCompressionType, ObservationType) | Creates and returns the camera sensor. |
Properties
| Name | Description |
|---|---|
| Camera | The Camera used for rendering the sensor observations. |
| CompressionType | The compression type used by the sensor. |
Methods
| Name | Description |
|---|---|
| Dispose() | Clean up the owned Texture2D. |
| GetBuiltInSensorType() | Return the corresponding BuiltInSensorType for the sensor. |
| GetCompressedObservation() | Generates a compressed image. This can be valuable in speeding-up training. |
| GetCompressionSpec() | Return information on the compression type being used. If no compression is used, return Default(). |
| GetName() | Accessor for the name of the sensor. |
| GetObservationSpec() | Returns a description of the observations that will be generated by the sensor. The shape will be 1 x h x w for grayscale and 3 x h x w for color. The dimensions have translational equivariance along width and height, and no property along the channels dimension. |
| ObservationToTexture(Camera, Texture2D, int, int) | Renders a Camera instance to a 2D texture at the corresponding resolution. |
| Reset() | Resets the internal state of the sensor. This is called at the end of an Agent's episode. Most implementations can leave this empty. |
| Update() | Update any internal state of the sensor. This is called once per each agent step. |
| Write(ObservationWriter) | Writes out the generated, uncompressed image to the provided ObservationWriter. |