openapi: 3.1.0
info:
  title: NeMo Retriever Table Structure v1
  version: 1.2.0
  description: NeMo Retriever object detection of charts and
    tables in structured images.
paths:
  /v1/infer:
    post:
      summary: Inference Endpoint
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TableStructureRequest'
        required: true
      responses:
        '200':
          description: Detected bounding boxes returned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TableStructureResponse'
        '503':
          description: Service not ready
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/health/ready:
    get:
      summary: Readiness Endpoint
      responses:
        '200':
          description: Service ready
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthReadyResponse'
        '503':
          description: Service not ready
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthReadyResponse'
  /v1/health/live:
    get:
      summary: Liveness Endpoint
      responses:
        '200':
          description: Service live
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthLiveResponse'
        '503':
          description: Service not live
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthLiveResponse'
components:
  schemas:
    TableStructureRequest:
      $defs:
        Image:
          properties:
            type:
              const: image_url
              default: image_url
              title: Type
              type: string
            url:
              description: The URL of the image to process.
              title: Url
              type: string
          required:
          - url
          title: Image
          type: object
      properties:
        input:
          items:
            $ref: '#/components/schemas/TableStructureRequest/$defs/Image'
          minItems: 1
          title: Input
          type: array
        confidence_threshold:
          default: 0.01
          description: Threshold for filtering low-confidence predictions
          title: Confidence Threshold
          type: number
        nms_threshold:
          default: 0.25
          description: Threshold for filtering overlapping predictions via non-max
            suppression
          title: Nms Threshold
          type: number
      required:
      - input
      title: TableStructureRequest
      type: object
    TableStructureResponse:
      $defs:
        BoundingBox:
          properties:
            x_min:
              title: X Min
              type: number
            y_min:
              title: Y Min
              type: number
            x_max:
              title: X Max
              type: number
            y_max:
              title: Y Max
              type: number
            confidence:
              title: Confidence
              type: number
          required:
          - x_min
          - y_min
          - x_max
          - y_max
          - confidence
          title: BoundingBox
          type: object
        TableStructureResponseItem:
          properties:
            index:
              title: Index
              type: integer
            bounding_boxes:
              additionalProperties:
                items:
                  $ref: '#/components/schemas/TableStructureResponse/$defs/BoundingBox'
                type: array
              propertyNames:
                enum:
                - border
                - cell
                - row
                - column
                - header
              title: Bounding Boxes
              type: object
          required:
          - index
          - bounding_boxes
          title: TableStructureResponseItem
          type: object
        UsageInfo:
          properties:
            images_size_mb:
              title: Images Size Mb
              type: number
          required:
          - images_size_mb
          title: UsageInfo
          type: object
      properties:
        data:
          items:
            $ref: '#/components/schemas/TableStructureResponse/$defs/TableStructureResponseItem'
          title: Data
          type: array
        usage:
          $ref: '#/components/schemas/TableStructureResponse/$defs/UsageInfo'
      required:
      - data
      - usage
      title: TableStructureResponse
      type: object
    ErrorResponse:
      properties:
        error:
          title: Error
          type: string
      required:
      - error
      title: ErrorResponse
      type: object
    HealthReadyResponse:
      properties:
        ready:
          title: Ready
          type: boolean
      required:
      - ready
      title: HealthReadyResponse
      type: object
    HealthLiveResponse:
      properties:
        live:
          title: Live
          type: boolean
      required:
      - live
      title: HealthLiveResponse
      type: object
