RF-DETR Large
Bases: RFDETR
Train an RF-DETR Large model.
Source code in rfdetr/detr.py
Attributes¶
class_names
property
¶
Retrieve the class names supported by the loaded model.
Returns:
Name | Type | Description |
---|---|---|
dict |
A dictionary mapping class IDs to class names. The keys are integers starting from |
Functions¶
deploy_to_roboflow(workspace, project_id, version, api_key=None, size=None)
¶
Deploy the trained RF-DETR model to Roboflow.
Deploying with Roboflow will create a Serverless API to which you can make requests.
You can also download weights into a Roboflow Inference deployment for use in Roboflow Workflows and on-device deployment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The name of the Roboflow workspace to deploy to. |
required |
|
List[str]
|
A list of project IDs to which the model will be deployed |
required |
|
str
|
Your Roboflow API key. If not provided,
it will be read from the environment variable |
None
|
|
str
|
The size of the model to deploy. If not provided, it will default to the size of the model being trained (e.g., "rfdetr-base", "rfdetr-large", etc.). |
None
|
|
str
|
The name you want to give the uploaded model. |
required |
Raises:
ValueError: If the api_key
is not provided and not found in the environment
variable ROBOFLOW_API_KEY
, or if the size
is not set for custom architectures.
Source code in rfdetr/detr.py
export(**kwargs)
¶
Export your model to an ONNX file.
See the ONNX export documentation for more information.
get_model(config)
¶
maybe_download_pretrain_weights()
¶
predict(images, threshold=0.5, **kwargs)
¶
Performs object detection on the input images and returns bounding box predictions.
This method accepts a single image or a list of images in various formats (file path, PIL Image, NumPy array, or torch.Tensor). The images should be in RGB channel order. If a torch.Tensor is provided, it must already be normalized to values in the [0, 1] range and have the shape (C, H, W).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Union[str, Image, ndarray, Tensor, List[Union[str, ndarray, Image, Tensor]]]
|
A single image or a list of images to process. Images can be provided as file paths, PIL Images, NumPy arrays, or torch.Tensors. |
required |
|
float
|
The minimum confidence score needed to consider a detected bounding box valid. |
0.5
|
|
Additional keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
Union[Detections, List[Detections]]
|
Union[sv.Detections, List[sv.Detections]]: A single or multiple Detections objects, each containing bounding box coordinates, confidence scores, and class IDs. |
Source code in rfdetr/detr.py
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 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
|