class Provider
(Niantic.Lightship.AR.XRSubsystems.XRObjectDetectionSubsystem.Provider)
Overview
The provider which will service the XRObjectDetectionSubsystem.
class Provider: SubsystemProvider< XRObjectDetectionSubsystem > {
public:
// fields
? uint LatestFrameId => throw new NotSupportedException("Getting the latest frame id is not supported by this implementation");
bool IsMetadataAvailable => throw new NotSupportedException("Getting if metadata is available is not supported by this implementation");
// properties
uint TargetFrameRate;
// methods
virtual bool TryGetCategoryNames(out IReadOnlyList<string> names);
virtual bool TryGetDetectedObjects(out XRDetectedObject[] results);
};
Detailed Documentation
The provider which will service the XRObjectDetectionSubsystem.
Fields
LatestFrameId
? uint LatestFrameId => throw new NotSupportedException("Getting the latest frame id is not supported by this implementation")
Frame id of the most recent object detection output.
The frame id.
This is an experimental API. Experimental features are subject to breaking changes, not officially supported, and may be deprecated without notice.
Parameters:
System.NotSupportedException
- Thrown if getting frame id is not supported.
IsMetadataAvailable
bool IsMetadataAvailable => throw new NotSupportedException("Getting if metadata is available is not supported by this implementation")
Is true if metadata has been downloaded and decrypted on the current device. Only if this value is true can the object detection category names or results be acquired.
If metadata is available.
This is an experimental API. Experimental features are subject to breaking changes, not officially supported, and may be deprecated without notice.
Parameters:
System.NotSupportedException
- Thrown frame rate configuration is not supported.
Properties
TargetFrameRate
uint TargetFrameRate
Property to be implemented by the provider to get or set the frame rate for the platform's object detection feature.
The requested frame rate in frames per second.
This is an experimental API. Experimental features are subject to breaking changes, not officially supported, and may be deprecated without notice.
Parameters:
System.NotSupportedException
- Thrown when requesting frame rate is not supported by the implementation.
Methods
TryGetCategoryNames
virtual bool TryGetCategoryNames(out IReadOnlyList<string> names)
Method to be implemented by the provider to get a list of the object detection category names for the current model.
This is an experimental API. Experimental features are subject to breaking changes, not officially supported, and may be deprecated without notice.
Parameters:
names
- A list of category labels. It will be empty if the method returns false.
System.NotSupportedException
- Thrown when reading the category names is not supported by the implementation.
Returns:
True if channel names are available. False if not.
TryGetDetectedObjects
virtual bool TryGetDetectedObjects(out XRDetectedObject[] results)
Tries to acquire the latest object detection results from the camera image.
This is an experimental API. Experimental features are subject to breaking changes, not officially supported, and may be deprecated without notice.
Parameters:
results
- An array of objects detected in the latest input camera image. If no objects were detected, this array will be empty.
System.NotSupportedException
- Thrown if the implementation does not support getting detected objects.
Returns:
True if the object detection neural network has produced output.