Package ai.vay.client
Class AnalyserFactory
- java.lang.Object
-
- ai.vay.client.AnalyserFactory
-
public final class AnalyserFactory extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AnalyserInput
createInput(byte[] inputImageBytes)
Create a newAnalyserInput
that can be enqueued to be analysed.static AnalyserInput
createInput(byte[] inputImageBytes, java.time.Instant timestamp)
Create a newAnalyserInput
that can be enqueued to be analysed and pass the image capture time.static Analyser
createOnDeviceAnalyser(java.lang.String url, java.lang.String apiKey, long exerciseKey, Listener listener)
Create a newAnalyser
that connects to the given URL and analyses inputs offline.static Analyser
createOnDeviceAnalyser(java.lang.String url, java.lang.String apiKey, long exerciseKey, Listener listener, java.lang.String userExternalId)
Create a newAnalyser
that connects to the given URL and analyses inputs offline.static Analyser
createStreamingAnalyser(java.lang.String url, java.lang.String apiKey, long exerciseKey, Listener listener)
Create a newAnalyser
that connects to the given URL and analyses inputs online.static Analyser
createStreamingAnalyser(java.lang.String url, java.lang.String apiKey, long exerciseKey, Listener listener, java.lang.String userExternalId)
Create a newAnalyser
that connects to the given URL and analyses inputs online.
-
-
-
Method Detail
-
createInput
public static AnalyserInput createInput(byte[] inputImageBytes)
Create a newAnalyserInput
that can be enqueued to be analysed. Note that the input image should already be encoded as JPEG or PNG.- Parameters:
inputImageBytes
- The image as byte array to be transformed.- Returns:
- The input to be enqueued.
-
createInput
public static AnalyserInput createInput(byte[] inputImageBytes, java.time.Instant timestamp)
Create a newAnalyserInput
that can be enqueued to be analysed and pass the image capture time. Note that the input image should already be encoded as JPEG or PNG.- Parameters:
inputImageBytes
- The image as byte array to be transformed.timestamp
- The time instant the image was captured.- Returns:
- The input to be enqueued.
-
createStreamingAnalyser
public static Analyser createStreamingAnalyser(java.lang.String url, java.lang.String apiKey, long exerciseKey, Listener listener, java.lang.String userExternalId)
Create a newAnalyser
that connects to the given URL and analyses inputs online. Authenticate with the given client token. Configure the analyser with the given exercise key. Pass an optional user ID. Add aListener
to the analyser.- Parameters:
url
- The URL to connect to.apiKey
- The authentication client token.exerciseKey
- The exercise key.listener
- The listener to be added to the analyser.userExternalId
- The users ID.- Returns:
- The analyser.
- Throws:
java.lang.RuntimeException
- If url format is invalid.
-
createStreamingAnalyser
public static Analyser createStreamingAnalyser(java.lang.String url, java.lang.String apiKey, long exerciseKey, Listener listener)
Create a newAnalyser
that connects to the given URL and analyses inputs online. Authenticate with the given client token. Configure the analyser with the given exercise key. Add aListener
to the analyser.- Parameters:
url
- The URL to connect to.apiKey
- The authentication client token.exerciseKey
- The exercise key.listener
- The listener to be added to the analyser.- Returns:
- The analyser.
- Throws:
java.lang.RuntimeException
- If url format is invalid.
-
createOnDeviceAnalyser
public static Analyser createOnDeviceAnalyser(java.lang.String url, java.lang.String apiKey, long exerciseKey, Listener listener, java.lang.String userExternalId)
Create a newAnalyser
that connects to the given URL and analyses inputs offline. Authenticate with the given client token. Configure the analyser with the given exercise key. Pass an optional user ID. Add aListener
to the analyser.- Parameters:
url
- The URL to connect to.apiKey
- The authentication client token.exerciseKey
- The exercise key.listener
- The listener to be added to the analyser.userExternalId
- The users ID.- Returns:
- The analyser.
-
createOnDeviceAnalyser
public static Analyser createOnDeviceAnalyser(java.lang.String url, java.lang.String apiKey, long exerciseKey, Listener listener)
Create a newAnalyser
that connects to the given URL and analyses inputs offline. Authenticate with the given client token. Configure the analyser with the given exercise key. Add aListener
to the analyser.- Parameters:
url
- The URL to connect to.apiKey
- The authentication client token.exerciseKey
- The exercise key.listener
- The listener to be added to the analyser.- Returns:
- The analyser.
-
-