Package ai.vay.client

Class 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 new AnalyserInput that can be enqueued to be analysed.
      static AnalyserInput createInput​(byte[] inputImageBytes, java.time.Instant timestamp)
      Create a new AnalyserInput 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 new Analyser 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 new Analyser 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 new Analyser 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 new Analyser that connects to the given URL and analyses inputs online.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createInput

        public static AnalyserInput createInput​(byte[] inputImageBytes)
        Create a new AnalyserInput 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 new AnalyserInput 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 new Analyser 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 a Listener 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 new Analyser 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 a Listener 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 new Analyser 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 a Listener 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 new Analyser 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 a Listener 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.