콘텐츠로 이동

API Return Value


모든 API는 기본적으로 (error_code, return value)의 tuple을 리턴합니다.

  • error_code=0인 경우, 함수가 성공적으로 동작했으며 return value실제 함수의 리턴 값입니다.
  • error_code≠0인 경우, 함수 실행중 error가 발생했다는 뜻이며 return valueNone입니다.

error_code 에 해당하는 에러 메세지를 얻으려면 vims.get_error_message() 함수를 이용하세요.

vims.get_error_message(error_code)

입력으로 받은 error_code에 해당하는 error_message를 반환합니다.

Parameters:

Name Type Description Default
error_code int

error_code

required

Raises:

Type Description
UndefinedErrorCodeError

정의되지 않은 error_code를 입력으로 받을 경우 발생하는 error

Returns:

Name Type Description
str str

error_message

TODO: 최종 result container 결과 반영하기.

Inference ResultContainer 구조

  • SaigeVIMS inference 결과로 나오는 ResultContainer에는 아래와 같은 정보가 저장되어 있습니다.
필드 명 Type 필드 의미
anomaly_score List[float] anomaly score 값.
threshold List[float] score의 threshold
cluster_index List[int] clustering 모델이 selected anomaly frame에 배정한 cluster index
state_index List[int] state와 대응되는 int. (WIP) 1: no_motion, 2: inspect, 3: domain_shift_detection, 4: roi_calibration, 5: no_roi_match, 6: error, 7: slow_motion
frame_timestamps List[int] 현재 frame에 대한 timestamp를 나타내는 정보.
roi_coordinates List[Union[Box, Tuple[int, int, int, int], None]] frame 별 원본 전체 이미지 기준 roi coordinate. 기본은 BoxClass, model_dump() 메소드 사용시 (left, top, right, bottom) 으로 자동으로 serialize 됨. (ROI 변경 사항 반영됨)
data List[Union[torch.Tensor, None]] 현재 frame의 원본 input data의 torch.Tensor 형태 값.
reconstruction List[Union[torch.Tensor, None]] 현재 frame의 원본 input data에 대한 VIMS 모듈의 output으로 나온 reconstruction 이미지의 torch.Tensor 형태 값.
transform List[Union[torch.Tensor, None]] 현재 frame의 원본 input data에 대한 adaptation 모듈의 output으로 나온 reconstruction 이미지의 torch.Tensor 형태 값.