File size: 5,802 Bytes
0490d67
075be9e
 
 
 
 
0831531
 
075be9e
 
 
0a91cb6
 
075be9e
 
0490d67
0831531
075be9e
 
 
0490d67
 
075be9e
0490d67
 
 
 
 
075be9e
 
 
 
 
 
 
 
0831531
 
 
 
 
 
 
 
 
 
 
075be9e
0831531
 
075be9e
 
 
 
 
 
 
 
0831531
075be9e
 
0831531
075be9e
0831531
075be9e
 
 
0831531
 
 
 
 
 
 
 
075be9e
 
0831531
075be9e
 
 
 
0831531
 
 
 
075be9e
0831531
075be9e
 
0831531
 
 
 
 
075be9e
0831531
 
 
 
075be9e
 
0831531
 
 
 
 
 
075be9e
0831531
 
 
 
 
 
 
075be9e
0831531
 
 
 
 
075be9e
0831531
 
075be9e
0831531
075be9e
0831531
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
075be9e
0831531
 
075be9e
0831531
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
openapi: 3.1.0
info:
  title: Swagger SamGIS - OpenAPI 3.0
  description: |-
    Segment Anything applied to GIS.
    Some useful links:
    - [SamGIS HuggingFace space direct link](https://huggingface.co/spaces/aletrn/samgis)
    - [SamGIS HuggingFace space](https://huggingface.co/spaces/aletrn/samgis)
    - [SamGIS documentation](https://docs.ml-trinca.tornidor.com)
    - [My blog](https://trinca.tornidor.com)
  contact:
    name: alessandro's website
    url: https://trinca.tornidor.com
  license:
    name: MIT License
    url: https://opensource.org/license/mit/
  version: "1.3.1"
servers:
  - url: https://localhost:8000/
tags:
  - name: samgis-aws
    description: segment anything applied to gis (self-hosted demo)
    externalDocs:
      url: https://ml-trinca.tornidor.com/
  - name: samgis-huggingface
    description: segment anything applied to gis (huggingface demo)
    externalDocs:
      url: https://huggingface.co/spaces/aletrn/samgis
  - name: segment-anything
    description: segment anything machine learning model
    externalDocs:
      url: http://segment-anything.com
  - name: gis
    externalDocs:
      url: https://it.wikipedia.org/wiki/Geographic_information_system
paths:
  /health:
    get:
      summary: Health
      operationId: health_health_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /infer_samgis:
    post:
      summary: Infer Samgis
      operationId: infer_samgis_infer_samgis_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiRequestBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /:
    get:
      summary: Index
      operationId: index__get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
components:
  schemas:
    ApiRequestBody:
      properties:
        id:
          type: string
          title: Id
          default: ''
        bbox:
          $ref: '#/components/schemas/RawBBox'
        prompt:
          items:
            anyOf:
            - $ref: '#/components/schemas/RawPromptPoint'
            - $ref: '#/components/schemas/RawPromptRectangle'
          type: array
          title: Prompt
        zoom:
          anyOf:
          - type: integer
          - type: number
          title: Zoom
        source_type:
          type: string
          title: Source Type
          default: OpenStreetMap.Mapnik
        debug:
          type: boolean
          title: Debug
          default: false
      type: object
      required:
      - bbox
      - prompt
      - zoom
      title: ApiRequestBody
      description: Input request validator type (not yet parsed)
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LatLngDict:
      properties:
        lat:
          type: number
          title: Lat
        lng:
          type: number
          title: Lng
      type: object
      required:
      - lat
      - lng
      title: LatLngDict
      description: Generic geographic latitude-longitude type
    PromptLabel:
      type: integer
      enum:
      - 0
      - 1
      title: PromptLabel
      description: Valid prompt label type
    PromptPointType:
      type: string
      enum:
      - point
      title: PromptPointType
      description: 'Segment Anything: validation point prompt type'
    PromptRectangleType:
      type: string
      enum:
      - rectangle
      title: PromptRectangleType
      description: 'Segment Anything: validation rectangle prompt type'
    RawBBox:
      properties:
        ne:
          $ref: '#/components/schemas/LatLngDict'
        sw:
          $ref: '#/components/schemas/LatLngDict'
      type: object
      required:
      - ne
      - sw
      title: RawBBox
      description: Input lambda bbox request type (not yet parsed)
    RawPromptPoint:
      properties:
        type:
          $ref: '#/components/schemas/PromptPointType'
        data:
          $ref: '#/components/schemas/LatLngDict'
        label:
          $ref: '#/components/schemas/PromptLabel'
      type: object
      required:
      - type
      - data
      - label
      title: RawPromptPoint
      description: Input lambda prompt request of type 'PromptPointType' - point (not
        yet parsed)
    RawPromptRectangle:
      properties:
        type:
          $ref: '#/components/schemas/PromptRectangleType'
        data:
          $ref: '#/components/schemas/RawBBox'
      type: object
      required:
      - type
      - data
      title: RawPromptRectangle
      description: Input lambda prompt request of type 'PromptRectangleType' - rectangle
        (not yet parsed)
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError