Entities
HTTPClientMode
¶
Bases: str
, Enum
Enum for the HTTP client mode.
Attributes:
Name | Type | Description |
---|---|---|
V0 |
The version 0 of the HTTP client. |
|
V1 |
The version 1 of the HTTP client. |
Source code in inference_sdk/http/entities.py
76 77 78 79 80 81 82 83 84 85 |
|
InferenceConfiguration
dataclass
¶
Dataclass for inference configuration.
Attributes:
Name | Type | Description |
---|---|---|
confidence_threshold |
Optional[float]
|
The confidence threshold for the inference. |
keypoint_confidence_threshold |
Optional[float]
|
The keypoint confidence threshold for the inference. |
format |
Optional[str]
|
The format for the inference. |
mask_decode_mode |
Optional[str]
|
The mask decode mode for the inference. |
tradeoff_factor |
Optional[float]
|
The tradeoff factor for the inference. |
max_candidates |
Optional[int]
|
The maximum number of candidates for the inference. |
max_detections |
Optional[int]
|
The maximum number of detections for the inference. |
iou_threshold |
Optional[float]
|
The intersection over union threshold for the inference. |
stroke_width |
Optional[int]
|
The stroke width for the inference. |
Source code in inference_sdk/http/entities.py
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 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
|
to_api_call_parameters(client_mode, task_type)
¶
Convert the current configuration to API call parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client_mode
|
HTTPClientMode
|
The HTTP client mode. |
required |
task_type
|
TaskType
|
The type of task the model is designed for. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: The API call parameters. |
Source code in inference_sdk/http/entities.py
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 |
|
to_classification_parameters()
¶
Convert the current configuration to classification parameters.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: The classification parameters. |
Source code in inference_sdk/http/entities.py
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
|
to_instance_segmentation_parameters()
¶
Convert the current configuration to instance segmentation parameters.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: The instance segmentation parameters. |
Source code in inference_sdk/http/entities.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
|
to_keypoints_detection_parameters()
¶
Convert the current configuration to keypoints detection parameters.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: The keypoints detection parameters. |
Source code in inference_sdk/http/entities.py
215 216 217 218 219 220 221 222 223 |
|
to_legacy_call_parameters()
¶
Convert the current configuration to legacy call parameters.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: The legacy call parameters. |
Source code in inference_sdk/http/entities.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
|
to_object_detection_parameters()
¶
Convert the current configuration to object detection parameters.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: The object detection parameters. |
Source code in inference_sdk/http/entities.py
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 |
|
ModelDescription
dataclass
¶
Bases: DataClassJsonMixin
Dataclass for model description.
Attributes:
Name | Type | Description |
---|---|---|
model_id |
str
|
The unique identifier of the model. |
task_type |
TaskType
|
The type of task the model is designed for. |
batch_size |
Optional[Union[int, str]]
|
The batch size for the model. |
input_height |
Optional[int]
|
The height of the input image. |
input_width |
Optional[int]
|
The width of the input image. |
Source code in inference_sdk/http/entities.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
RegisteredModels
dataclass
¶
Bases: DataClassJsonMixin
Dataclass for registered models.
Attributes:
Name | Type | Description |
---|---|---|
models |
List[ModelDescription]
|
A list of model descriptions. |
Source code in inference_sdk/http/entities.py
65 66 67 68 69 70 71 72 73 |
|
ServerInfo
dataclass
¶
Bases: DataClassJsonMixin
Dataclass for Information about the inference server.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the inference server. |
version |
str
|
The version of the inference server. |
uuid |
str
|
The unique identifier of the inference server instance. |
Source code in inference_sdk/http/entities.py
31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
VisualisationResponseFormat
¶
Bases: str
, Enum
Enum for the visualisation response format.
Attributes:
Name | Type | Description |
---|---|---|
BASE64 |
The base64 format. |
|
NUMPY |
The numpy format. |
|
PILLOW |
The pillow format. |
Source code in inference_sdk/http/entities.py
88 89 90 91 92 93 94 95 96 97 98 99 |
|
get_non_empty_attributes(source_object, specification)
¶
Get non-empty attributes from the source object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_object
|
object
|
The source object. |
required |
specification
|
List[Tuple[str, str]]
|
The specification of the attributes. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: The non-empty attributes. |
Source code in inference_sdk/http/entities.py
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
|