Inference
BaseRequest
¶
Bases: BaseModel
Base request for inference.
Attributes:
Name | Type | Description |
---|---|---|
id |
str_
|
A unique request identifier. |
api_key |
Optional[str]
|
Roboflow API Key that will be passed to the model during initialization for artifact retrieval. |
start |
Optional[float]
|
start time of request |
Source code in inference/core/entities/requests/inference.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
CVInferenceRequest
¶
Bases: InferenceRequest
Computer Vision inference request.
Attributes:
Name | Type | Description |
---|---|---|
image |
Union[List[InferenceRequestImage], InferenceRequestImage]
|
Image(s) for inference. |
disable_preproc_auto_orient |
Optional[bool]
|
If true, the auto orient preprocessing step is disabled for this call. Default is False. |
disable_preproc_contrast |
Optional[bool]
|
If true, the auto contrast preprocessing step is disabled for this call. Default is False. |
disable_preproc_grayscale |
Optional[bool]
|
If true, the grayscale preprocessing step is disabled for this call. Default is False. |
disable_preproc_static_crop |
Optional[bool]
|
If true, the static crop preprocessing step is disabled for this call. Default is False. |
Source code in inference/core/entities/requests/inference.py
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 |
|
ClassificationInferenceRequest
¶
Bases: CVInferenceRequest
Classification inference request.
Attributes:
Name | Type | Description |
---|---|---|
confidence |
Optional[float]
|
The confidence threshold used to filter out predictions. |
visualization_stroke_width |
Optional[int]
|
The stroke width used when visualizing predictions. |
visualize_predictions |
Optional[bool]
|
If true, the predictions will be drawn on the original image and returned as a base64 string. |
Source code in inference/core/entities/requests/inference.py
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 |
|
DepthEstimationRequest
¶
Bases: InferenceRequest
Request for depth estimation.
Attributes:
Name | Type | Description |
---|---|---|
image |
Union[List[InferenceRequestImage], InferenceRequestImage]
|
Image(s) to be estimated. |
model_id |
str
|
The model ID to use for depth estimation. |
depth_version_id |
Optional[str]
|
The version ID of the depth estimation model. |
Source code in inference/core/entities/requests/inference.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
InferenceRequest
¶
Bases: BaseRequest
Base request for inference.
Attributes:
Name | Type | Description |
---|---|---|
model_id |
str
|
A unique model identifier. |
model_type |
Optional[str]
|
The type of the model, usually referring to what task the model performs. |
Source code in inference/core/entities/requests/inference.py
31 32 33 34 35 36 37 38 39 40 |
|
InferenceRequestImage
¶
Bases: BaseModel
Image data for inference request.
Attributes:
Name | Type | Description |
---|---|---|
type |
str
|
The type of image data provided, one of 'url', 'base64', or 'numpy'. |
value |
Optional[Any]
|
Image data corresponding to the image type. |
Source code in inference/core/entities/requests/inference.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
InstanceSegmentationInferenceRequest
¶
Bases: ObjectDetectionInferenceRequest
Instance Segmentation inference request.
Attributes:
Name | Type | Description |
---|---|---|
mask_decode_mode |
Optional[str]
|
The mode used to decode instance segmentation masks, one of 'accurate', 'fast', 'tradeoff'. |
tradeoff_factor |
Optional[float]
|
The amount to tradeoff between 0='fast' and 1='accurate'. |
Source code in inference/core/entities/requests/inference.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
|
ObjectDetectionInferenceRequest
¶
Bases: CVInferenceRequest
Object Detection inference request.
Attributes:
Name | Type | Description |
---|---|---|
class_agnostic_nms |
Optional[bool]
|
If true, NMS is applied to all detections at once, if false, NMS is applied per class. |
class_filter |
Optional[List[str]]
|
If provided, only predictions for the listed classes will be returned. |
confidence |
Optional[float]
|
The confidence threshold used to filter out predictions. |
fix_batch_size |
Optional[bool]
|
If true, the batch size will be fixed to the maximum batch size configured for this server. |
iou_threshold |
Optional[float]
|
The IoU threshold that must be met for a box pair to be considered duplicate during NMS. |
max_detections |
Optional[int]
|
The maximum number of detections that will be returned. |
max_candidates |
Optional[int]
|
The maximum number of candidate detections passed to NMS. |
visualization_labels |
Optional[bool]
|
If true, labels will be rendered on prediction visualizations. |
visualization_stroke_width |
Optional[int]
|
The stroke width used when visualizing predictions. |
visualize_predictions |
Optional[bool]
|
If true, the predictions will be drawn on the original image and returned as a base64 string. |
Source code in inference/core/entities/requests/inference.py
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 |
|
request_from_type(model_type, request_dict)
¶
Uses original request id
Source code in inference/core/entities/requests/inference.py
272 273 274 275 276 277 278 279 280 281 282 283 |
|