All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.gdface.sdk.thrift.client.FaceApi Maven / Gradle / Ivy

There is a newer version: 2.2.10
Show newest version
package net.gdface.sdk.thrift.client;

import com.facebook.swift.codec.*;
import com.facebook.swift.codec.ThriftField.Requiredness;
import com.facebook.swift.service.*;
import com.google.common.util.concurrent.ListenableFuture;
import java.io.*;
import java.util.*;

@ThriftService("FaceApi")
public interface FaceApi
{
    @ThriftService("FaceApi")
    public interface Async
    {
        @ThriftMethod(value = "compare2Face",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=NotFaceDetectedException.class, id=2),
                          @ThriftException(type=ServiceRuntimeException.class, id=3)
                      })
        ListenableFuture compare2Face(
            @ThriftField(value=1, name="imgData1", requiredness=Requiredness.OPTIONAL) final byte [] imgData1,
            @ThriftField(value=2, name="facePos1", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos1,
            @ThriftField(value=3, name="imgData2", requiredness=Requiredness.OPTIONAL) final byte [] imgData2,
            @ThriftField(value=4, name="facePos2", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos2
        );

        @ThriftMethod(value = "compareCode",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture compareCode(
            @ThriftField(value=1, name="code1", requiredness=Requiredness.OPTIONAL) final byte [] code1,
            @ThriftField(value=2, name="code2", requiredness=Requiredness.OPTIONAL) final byte [] code2
        );

        @ThriftMethod(value = "compareCodes",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture> compareCodes(
            @ThriftField(value=1, name="code1", requiredness=Requiredness.OPTIONAL) final byte [] code1,
            @ThriftField(value=2, name="codes", requiredness=Requiredness.OPTIONAL) final List codes
        );

        @ThriftMethod(value = "compareFaces",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=NotFaceDetectedException.class, id=2),
                          @ThriftException(type=ServiceRuntimeException.class, id=3)
                      })
        ListenableFuture> compareFaces(
            @ThriftField(value=1, name="code", requiredness=Requiredness.OPTIONAL) final byte [] code,
            @ThriftField(value=2, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
            @ThriftField(value=3, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum,
            @ThriftField(value=4, name="detectRectangle", requiredness=Requiredness.OPTIONAL) final FRect detectRectangle
        );

        @ThriftMethod(value = "compareFeatures",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture> compareFeatures(
            @ThriftField(value=1, name="code1", requiredness=Requiredness.OPTIONAL) final byte [] code1,
            @ThriftField(value=2, name="codes", requiredness=Requiredness.OPTIONAL) final List codes
        );

        @ThriftMethod(value = "detectAndCompare2Face",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=NotFaceDetectedException.class, id=2),
                          @ThriftException(type=ServiceRuntimeException.class, id=3)
                      })
        ListenableFuture detectAndCompare2Face(
            @ThriftField(value=1, name="imgData1", requiredness=Requiredness.OPTIONAL) final byte [] imgData1,
            @ThriftField(value=2, name="detectRect1", requiredness=Requiredness.OPTIONAL) final FRect detectRect1,
            @ThriftField(value=3, name="imgData2", requiredness=Requiredness.OPTIONAL) final byte [] imgData2,
            @ThriftField(value=4, name="detectRect2", requiredness=Requiredness.OPTIONAL) final FRect detectRect2
        );

        @ThriftMethod(value = "detectAndGetCodeInfo",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=NotFaceDetectedException.class, id=2),
                          @ThriftException(type=ServiceRuntimeException.class, id=3)
                      })
        ListenableFuture> detectAndGetCodeInfo(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
            @ThriftField(value=2, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum,
            @ThriftField(value=3, name="detectRectangle", requiredness=Requiredness.OPTIONAL) final FRect detectRectangle
        );

        @ThriftMethod(value = "detectCenterFace",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=NotFaceDetectedException.class, id=2),
                          @ThriftException(type=ServiceRuntimeException.class, id=3)
                      })
        ListenableFuture detectCenterFace(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData
        );

        @ThriftMethod(value = "detectFace",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=ServiceRuntimeException.class, id=2)
                      })
        ListenableFuture> detectFace(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
            @ThriftField(value=2, name="detectRectangle", requiredness=Requiredness.OPTIONAL) final FRect detectRectangle
        );

        @ThriftMethod(value = "detectFaceAgain",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture> detectFaceAgain(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
            @ThriftField(value=2, name="detectRects", requiredness=Requiredness.OPTIONAL) final List detectRects
        );

        @ThriftMethod(value = "getCodeInfo",
                      exception = {
                          @ThriftException(type=NotFaceDetectedException.class, id=1),
                          @ThriftException(type=ServiceRuntimeException.class, id=2)
                      })
        ListenableFuture> getCodeInfo(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
            @ThriftField(value=2, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum,
            @ThriftField(value=3, name="facePos", requiredness=Requiredness.OPTIONAL) final List facePos
        );

        @ThriftMethod(value = "getFeature",
                      exception = {
                          @ThriftException(type=NotFaceDetectedException.class, id=1),
                          @ThriftException(type=ServiceRuntimeException.class, id=2)
                      })
        ListenableFuture getFeature(
            @ThriftField(value=1, name="faces", requiredness=Requiredness.OPTIONAL) final Map faces
        );

        @ThriftMethod(value = "hasFace",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=ServiceRuntimeException.class, id=2)
                      })
        ListenableFuture hasFace(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
            @ThriftField(value=2, name="detectRectangle", requiredness=Requiredness.OPTIONAL) final FRect detectRectangle
        );

        @ThriftMethod(value = "isLocal",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture isLocal();

        @ThriftMethod(value = "multiFaceFeature",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture multiFaceFeature();
    }
    @ThriftMethod(value = "compare2Face",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=NotFaceDetectedException.class, id=2),
                      @ThriftException(type=ServiceRuntimeException.class, id=3)
                  })
    double compare2Face(
        @ThriftField(value=1, name="imgData1", requiredness=Requiredness.OPTIONAL) final byte [] imgData1,
        @ThriftField(value=2, name="facePos1", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos1,
        @ThriftField(value=3, name="imgData2", requiredness=Requiredness.OPTIONAL) final byte [] imgData2,
        @ThriftField(value=4, name="facePos2", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos2
    ) throws ImageErrorException, NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "compareCode",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    double compareCode(
        @ThriftField(value=1, name="code1", requiredness=Requiredness.OPTIONAL) final byte [] code1,
        @ThriftField(value=2, name="code2", requiredness=Requiredness.OPTIONAL) final byte [] code2
    ) throws ServiceRuntimeException;

    @ThriftMethod(value = "compareCodes",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    List compareCodes(
        @ThriftField(value=1, name="code1", requiredness=Requiredness.OPTIONAL) final byte [] code1,
        @ThriftField(value=2, name="codes", requiredness=Requiredness.OPTIONAL) final List codes
    ) throws ServiceRuntimeException;

    @ThriftMethod(value = "compareFaces",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=NotFaceDetectedException.class, id=2),
                      @ThriftException(type=ServiceRuntimeException.class, id=3)
                  })
    Map compareFaces(
        @ThriftField(value=1, name="code", requiredness=Requiredness.OPTIONAL) final byte [] code,
        @ThriftField(value=2, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
        @ThriftField(value=3, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum,
        @ThriftField(value=4, name="detectRectangle", requiredness=Requiredness.OPTIONAL) final FRect detectRectangle
    ) throws ImageErrorException, NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "compareFeatures",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    List compareFeatures(
        @ThriftField(value=1, name="code1", requiredness=Requiredness.OPTIONAL) final byte [] code1,
        @ThriftField(value=2, name="codes", requiredness=Requiredness.OPTIONAL) final List codes
    ) throws ServiceRuntimeException;

    @ThriftMethod(value = "detectAndCompare2Face",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=NotFaceDetectedException.class, id=2),
                      @ThriftException(type=ServiceRuntimeException.class, id=3)
                  })
    double detectAndCompare2Face(
        @ThriftField(value=1, name="imgData1", requiredness=Requiredness.OPTIONAL) final byte [] imgData1,
        @ThriftField(value=2, name="detectRect1", requiredness=Requiredness.OPTIONAL) final FRect detectRect1,
        @ThriftField(value=3, name="imgData2", requiredness=Requiredness.OPTIONAL) final byte [] imgData2,
        @ThriftField(value=4, name="detectRect2", requiredness=Requiredness.OPTIONAL) final FRect detectRect2
    ) throws ImageErrorException, NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "detectAndGetCodeInfo",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=NotFaceDetectedException.class, id=2),
                      @ThriftException(type=ServiceRuntimeException.class, id=3)
                  })
    List detectAndGetCodeInfo(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
        @ThriftField(value=2, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum,
        @ThriftField(value=3, name="detectRectangle", requiredness=Requiredness.OPTIONAL) final FRect detectRectangle
    ) throws ImageErrorException, NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "detectCenterFace",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=NotFaceDetectedException.class, id=2),
                      @ThriftException(type=ServiceRuntimeException.class, id=3)
                  })
    CodeInfo detectCenterFace(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData
    ) throws ImageErrorException, NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "detectFace",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=ServiceRuntimeException.class, id=2)
                  })
    List detectFace(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
        @ThriftField(value=2, name="detectRectangle", requiredness=Requiredness.OPTIONAL) final FRect detectRectangle
    ) throws ImageErrorException, ServiceRuntimeException;

    @ThriftMethod(value = "detectFaceAgain",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    List detectFaceAgain(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
        @ThriftField(value=2, name="detectRects", requiredness=Requiredness.OPTIONAL) final List detectRects
    ) throws ServiceRuntimeException;

    @ThriftMethod(value = "getCodeInfo",
                  exception = {
                      @ThriftException(type=NotFaceDetectedException.class, id=1),
                      @ThriftException(type=ServiceRuntimeException.class, id=2)
                  })
    List getCodeInfo(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
        @ThriftField(value=2, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum,
        @ThriftField(value=3, name="facePos", requiredness=Requiredness.OPTIONAL) final List facePos
    ) throws NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "getFeature",
                  exception = {
                      @ThriftException(type=NotFaceDetectedException.class, id=1),
                      @ThriftException(type=ServiceRuntimeException.class, id=2)
                  })
    byte [] getFeature(
        @ThriftField(value=1, name="faces", requiredness=Requiredness.OPTIONAL) final Map faces
    ) throws NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "hasFace",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=ServiceRuntimeException.class, id=2)
                  })
    boolean hasFace(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
        @ThriftField(value=2, name="detectRectangle", requiredness=Requiredness.OPTIONAL) final FRect detectRectangle
    ) throws ImageErrorException, ServiceRuntimeException;

    @ThriftMethod(value = "isLocal",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    boolean isLocal() throws ServiceRuntimeException;

    @ThriftMethod(value = "multiFaceFeature",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    boolean multiFaceFeature() throws ServiceRuntimeException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy