| 파라미터 | 타입 | 설명 | 필수값 여부 |
|---|---|---|---|
| pipelines | String[] | 라이브니스 확인에 사용되는 파이프라인 | 필수 |
| calibrations | String[] | 라이브니스 확인에 사용되는 교정 값 | |
| (REGULAR, SOFT, HARD) | 옵션 |
| 파라미터 | 타입 | 설명 | 필수값 여부 |
|---|---|---|---|
| file | File | 파일로 업로드된 바이너리 이미지 데이터 | 필수 |
/check_liveness 기능을 복제하지만 base64로 인코딩된 데이터 대신 파일 업로드를 지원하는 편의성을 위한 엔드포인트입니다.
Postman 사용과 같이, 주로 base64로 인코딩된 데이터와 잘 작동하지 않는 소프트웨어를 사용하여 수행되는 빠른 테스트 및 평가를 위한 것입니다.
IDLIVEDOC_SERVER_AVAILABLE_PIPELINES 환경 변수의 파이프라인 목록에서 파이프라인만 지정할 수 있습니다.
제공된 교정 수는 0이거나 제공된 파이프라인 이름 수와 일치해야 합니다.
HTTP 200/OK
API 함수 'OK' 응답 데이터는 항상 JSON 형식입니다.
Python
data = open('/data/image0.png', 'rb').read()
post_res = requests.post(
url='<URL>/check_liveness_file?pipelines=ibis-sr,kiwi-rc7-pc,lark-ps&calibrations=REGULAR,REGULAR,REGULAR',
files={'file': data}
)
JavaScript
const url = '<URL>/check_liveness_file?pipelines=ibis-sr,kiwi-rc7-pc,lark-ps&calibrations=REGULAR,REGULAR,REGULAR';
function checkLiveness(file) {
const data = new FormData();
data.append('file', file);
const req = new XMLHttpRequest();
req.open('POST', url, true);
req.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
alert(this.responseText);
}
};
req.send(data);
}
Bash
curl -F file=@/data/image0.png -X POST "<URL>/check_liveness_file?pipelines=ibis-sr,kiwi-rc7-pc,lark-ps&calibrations=REGULAR,REGULAR,REGULAR"