MCPcopy Index your code

hub / github.com/roboflow/rf-detr / functions

Functions3,167 in github.com/roboflow/rf-detr

↓ 2 callersFunctionignore_tracer_warnings
Suppress torch.jit.TracerWarning during export tests to reduce log spam.
tests/export/test_export.py:38
↓ 2 callersFunctioninterpolate_position_embeddings
Interpolate DINOv2 positional embeddings in *checkpoint_state* to match *pe_size*. When the model is configured with a custom ``resolution`` that
src/rfdetr/models/weights.py:199
↓ 2 callersFunctionis_main_process
Return True if the current process is rank 0.
src/rfdetr/utilities/distributed.py:45
↓ 2 callersMethodlink_arguments
(self, source, target, **kwargs)
tests/training/test_cli.py:82
↓ 2 callersFunctionload_image
(file_path)
src/rfdetr/export/benchmark.py:48
↓ 2 callersFunctionmain
Entry point for the ``rfdetr`` CLI. Constructs and runs ``RFDETRCli`` with ``RFDETRModelModule`` and ``RFDETRDataModule``. Subcommands are auto-
src/rfdetr/training/cli.py:49
↓ 2 callersFunctionmasks_to_boxes
Compute the bounding boxes around the provided masks. The masks should be in format [N, H, W] where N is the number of masks, (H, W) are the spat
src/rfdetr/utilities/box_ops.py:86
↓ 2 callersMethodmha_mhca_detected
(self, node, mha)
src/rfdetr/export/_onnx/exporter.py:801
↓ 2 callersMethodnum_boxes_for_targets
Compute the distributed target-box denominator for a target batch. The denominator is the total number of ground-truth boxes in the batch, mu
src/rfdetr/models/criterion.py:205
↓ 2 callersMethodon_test_epoch_end
Compute and log mAP and F1 under ``test/`` prefix at end of test epoch. Mirrors :meth:`on_validation_epoch_end` for the test evaluation loop.
src/rfdetr/training/callbacks/coco_eval.py:453
↓ 2 callersMethodon_test_epoch_start
Reset ``_ema_has_updates`` before test to prevent stale validation state from triggering EMA compute. ``on_test_batch_end`` never sets ``_ema
src/rfdetr/training/callbacks/coco_eval.py:259
↓ 2 callersMethodon_train_epoch_end
Optionally update EMA at epoch boundaries.
src/rfdetr/training/callbacks/ema.py:171
↓ 2 callersMethodon_train_epoch_end
Compute optional train-split mAP at the end of the training epoch. Args: trainer: The PTL Trainer. pl_module: The Lig
src/rfdetr/training/callbacks/coco_eval.py:318
↓ 2 callersFunctionplot_map_metrics
Plot train/val/test detection and keypoint mAP metrics from a PTL ``metrics.csv`` file. Reads the CSV written by PyTorch Lightning's ``CSVLogger`
src/rfdetr/visualize/training.py:362
↓ 2 callersFunctionpost_process
(outputs, target_sizes)
src/rfdetr/export/benchmark.py:78
↓ 2 callersFunctionresolve_augmentation_backend
Resolve an ``augmentation_backend`` value to a concrete ``"cpu"`` or ``"gpu"``. ``"auto"`` resolves to ``"gpu"`` only when both CUDA and Kornia a
src/rfdetr/datasets/kornia_transforms.py:86
↓ 2 callersMethodset_attn_implementation
Switch the attention implementation without reloading the model. This is useful when you want to change the attention implementation after th
src/rfdetr/models/backbone/dinov2_with_windowed_attn.py:936
↓ 2 callersMethodsummarize
Print and log COCO summary statistics.
src/rfdetr/evaluation/coco_eval.py:470
↓ 2 callersFunctionsweep_confidence_thresholds
Sweep confidence thresholds and compute precision/recall/F1 at each. Args: per_class_data: Per-class matching data list indexed by class
src/rfdetr/evaluation/f1_sweep.py:13
↓ 2 callersMethodteardown
Release the notebook output widget when the trainer exits. Args: trainer: The PTL Trainer. pl_module: The LightningMo
src/rfdetr/training/callbacks/coco_eval.py:200
↓ 2 callersMethodvalidation_step
(self, batch, batch_idx)
tests/training/callbacks/test_best_model_callback.py:81
↓ 2 callersMethodwith_pos_embed
(self, tensor: Tensor, pos: Optional[Tensor])
src/rfdetr/models/transformer.py:856
↓ 1 callersMethod__getitem__
(self, idx)
tests/training/helpers.py:77
↓ 1 callersMethod__init__
( self, output_dir: str, monitor_regular: str = "val/mAP_50_95", monitor_ema:
src/rfdetr/training/callbacks/best_model.py:79
↓ 1 callersMethod__init__
(self, include_masks: bool = False, include_keypoints: bool = False, num_keypoints: int = 0)
src/rfdetr/datasets/yolo.py:645
↓ 1 callersMethod__init__
( self, include_masks: bool = False, include_keypoints: bool = False, cat2labe
src/rfdetr/datasets/coco.py:314
↓ 1 callersMethod__init__
(self, num_pos_feats=64, temperature=10000, normalize=False, scale=None)
src/rfdetr/models/position_encoding.py:29
↓ 1 callersMethod__init__
(self)
tests/inference/test_predict_eval_mode.py:34
↓ 1 callersMethod__init__
(self)
tests/training/test_auto_batch.py:19
↓ 1 callersMethod__init__
(self)
tests/training/callbacks/test_ema_callback.py:26
↓ 1 callersMethod__init__
(self, hidden_dim: int, num_keypoints_per_class: list[int])
tests/models/test_lwdetr_keypoints.py:30
↓ 1 callersMethod__init__
(self, transformer: Transformer)
tests/models/test_transformer_onnx_spatial_shapes.py:53
↓ 1 callersMethod__repr__
(self)
src/rfdetr/training/model_ema.py:132
↓ 1 callersMethod__setattr__
(self, name: str, value: Any)
src/rfdetr/config.py:94
↓ 1 callersMethod__str__
(self)
src/rfdetr/training/model_ema.py:89
↓ 1 callersFunction_align_output_features_output_indices
( out_features: Optional[List[str]], out_indices: Optional[Union[List[int], Tuple[int, ...]]], sta
src/rfdetr/models/backbone/dinov2_with_windowed_attn.py:94
↓ 1 callersMethod_annotate_and_plot
De-normalize a single image tensor, annotate it with boxes and labels, and plot it on ``ax``. Args: single_image: Normalized imag
src/rfdetr/datasets/save_grids.py:87
↓ 1 callersMethod_apply_geometric_transform
Apply geometric transform to image with boxes and optionally masks. Converts data to Albumentations format, applies the transform, and conver
src/rfdetr/datasets/transforms.py:667
↓ 1 callersMethod_apply_keypoint_trace_fusion
Fuse object scores with keypoint localization uncertainty. Args: scores_i: Object scores for one image before keypoint uncertaint
src/rfdetr/models/postprocess.py:359
↓ 1 callersFunction_backfill_num_keypoints
Populate missing COCO ``num_keypoints`` fields from visibility flags.
src/rfdetr/evaluation/coco_eval.py:100
↓ 1 callersFunction_box_to_polygon
Convert a relative XYXY box into a 4-corner polygon.
src/rfdetr/datasets/yolo.py:54
↓ 1 callersMethod_boxes_to_numpy
Convert boxes to numpy array and validate shape. >>> import torch >>> boxes = torch.tensor([[10.0, 20.0, 30.0, 40.0]]) >>> Al
src/rfdetr/datasets/transforms.py:458
↓ 1 callersMethod_build_albu_keypoints
Flatten per-instance keypoints into Albumentations keypoint fields. >>> keypoints = np.array([[[10.0, 20.0, 2.0], [0.0, 0.0, 0.0]]], dtype=np
src/rfdetr/datasets/transforms.py:490
↓ 1 callersFunction_build_coco_api_from_samples
Build an in-memory ``pycocotools.COCO`` object from YOLO lazy samples. Args: classes: Ordered class names where index is the YOLO class I
src/rfdetr/datasets/yolo.py:507
↓ 1 callersFunction_build_coco_gt
Build a minimal COCO GT object with a single annotation. Args: num_keypoints: Number of keypoints per instance. gt_keypoints: Fla
tests/evaluation/test_keypoint_oks.py:55
↓ 1 callersFunction_build_datamodule
Construct RFDETRDataModule (build_dataset is not called at init time).
tests/training/test_module_data.py:128
↓ 1 callersFunction_build_gridsample_onnx
Write a minimal ONNX model with one GridSample node to *path*.
tests/export/test_tflite_export.py:984
↓ 1 callersFunction_build_keypoint_category_groups
Build category groups that can each be evaluated by one COCO keypoint evaluator.
src/rfdetr/evaluation/coco_eval.py:215
↓ 1 callersFunction_build_lazy_yolo_detection_dataset
Build a YOLO detection dataset that stores bounding boxes lazily. Unlike :func:`_build_lazy_yolo_segmentation_dataset`, this function does not st
src/rfdetr/datasets/yolo.py:451
↓ 1 callersFunction_build_lazy_yolo_keypoint_dataset
Build a YOLO pose dataset that stores keypoints without dense masks.
src/rfdetr/datasets/yolo.py:489
↓ 1 callersFunction_build_lazy_yolo_segmentation_dataset
Build a YOLO dataset that stores polygons and rasterizes masks on demand. Args: img_folder: Path to the directory containing images.
src/rfdetr/datasets/yolo.py:473
↓ 1 callersMethod_build_per_class_rows
Build per-class rows and emit per-class AP metrics. Args: metrics: Output of ``MeanAveragePrecision.compute()``. pfx:
src/rfdetr/training/callbacks/coco_eval.py:943
↓ 1 callersFunction_build_subset_datamodule
( model: RFDETRKeypointPreview, train_config: KeypointTrainConfig, train_subset_size: int = 8,
tests/benchmarks/test_training_coco.py:102
↓ 1 callersFunction_category_ids_with_keypoints
Return sorted COCO category ids that carry keypoint metadata or annotations.
src/rfdetr/datasets/coco.py:43
↓ 1 callersMethod_clear_per_instance_fields
Clear all per-instance fields when no boxes remain. >>> import torch >>> target = {"area": torch.tensor([100, 200]), "iscrowd": torch
src/rfdetr/datasets/transforms.py:617
↓ 1 callersFunction_coco_ann_to_target
Build a torchmetrics target dict from COCO ground-truth annotations for one image. Args: coco_gt: Loaded ``pycocotools.coco.COCO`` object
tests/benchmarks/test_inference_coco.py:104
↓ 1 callersMethod_coco_keypoint_annotation_path
Return the native COCO train keypoint annotation path when it exists. Args: dataset_dir: Path to the COCO dataset root.
src/rfdetr/detr.py:1520
↓ 1 callersFunction_collate_with_block_size
Module-level collate helper used as the base for :func:`make_collate_fn`. Defined at module scope (rather than as a closure inside :func:`make_co
src/rfdetr/utilities/tensors.py:298
↓ 1 callersMethod_compute_train_losses
Compute normalized losses for logging and raw weighted loss for backward. Args: outputs: Model output dictionary. tar
src/rfdetr/training/module_model.py:274
↓ 1 callersMethod_configure_launcher
(self)
src/rfdetr/training/trainer.py:90
↓ 1 callersFunction_copy_key_points
Return a mutable copy of a Supervision ``KeyPoints`` object.
src/rfdetr/visualize/keypoints.py:19
↓ 1 callersMethod_create_keypoint_class_mask
Create attention mask that blocks cross-class keypoint interactions.
src/rfdetr/models/transformer.py:556
↓ 1 callersFunction_create_onnx_session
Load an ONNX model and create an ONNX Runtime inference session. Imports ``onnxruntime`` at call time so that the rest of the package remains usa
src/rfdetr/export/_onnx/inference.py:26
↓ 1 callersMethod_create_valid_yolo_dataset
Create a minimal valid YOLO dataset directory structure.
tests/datasets/test_yolo.py:218
↓ 1 callersMethod_decode_keypoints_for_image
Decode selected keypoints for one image into output tensors. Args: keypoints_i: Gathered selected keypoint predictions for one im
src/rfdetr/models/postprocess.py:284
↓ 1 callersMethod_detach_results
Detach postprocessed result tensors before handing them to callbacks. Args: results: Per-image postprocessed prediction dictionar
src/rfdetr/training/module_model.py:414
↓ 1 callersMethod_detect_num_classes_for_training
Detect the class count using the same category basis as training labels. For COCO-style datasets this counts all categories by ``id`` from ``
src/rfdetr/detr.py:1379
↓ 1 callersFunction_detections_to_coco_predictions
Convert batched supervision keypoints into the COCO evaluator format. Args: detections_batch: Per-image prediction batch returned by RF-D
tests/benchmarks/test_inference_coco.py:356
↓ 1 callersFunction_drop_trailing_validation_only_epochs
Remove post-fit validation rows that Lightning logs as a synthetic final epoch. The Roboflow finetune demos run ``trainer.validate(...)`` after `
src/rfdetr/visualize/training.py:223
↓ 1 callersMethod_ellipsize_sample_title
Shorten long sample titles so subplot grids do not overflow. Args: title: Raw title text, usually an image file name.
src/rfdetr/training/module_data.py:500
↓ 1 callersMethod_empty_keypoint_outputs
Create zero/NaN-filled keypoint output tensors for one image. Args: keypoints_i: Gathered selected keypoint predictions for one i
src/rfdetr/models/postprocess.py:264
↓ 1 callersFunction_encode_uncompressed_rle
Encode a binary mask to uncompressed RLE with integer counts.
tests/datasets/test_coco_rle.py:41
↓ 1 callersFunction_ensure_faster_coco
Return a faster-coco-eval COCO object for evaluator construction.
src/rfdetr/evaluation/coco_eval.py:86
↓ 1 callersMethod_evaluate
Run faster-coco-eval evaluation for accumulated COCO result records.
src/rfdetr/evaluation/coco_eval.py:479
↓ 1 callersMethod_evaluate_grouped_keypoint_results
Evaluate one grouped keypoint result set.
src/rfdetr/evaluation/coco_eval.py:516
↓ 1 callersMethod_evaluate_grouped_keypoints
Run keypoint evaluation per keypoint-count group and aggregate stats.
src/rfdetr/evaluation/coco_eval.py:489
↓ 1 callersFunction_extract_yolo_flip_idx
Extract and validate optional YOLO ``flip_idx`` metadata.
src/rfdetr/datasets/_keypoint_schema.py:184
↓ 1 callersFunction_extract_yolo_keypoint_names
Extract YOLO keypoint names or synthesize stable placeholders.
src/rfdetr/datasets/_keypoint_schema.py:166
↓ 1 callersFunction_fake_postprocess
Return one non-empty prediction per image so COCOEvalCallback has something to score.
tests/training/helpers.py:111
↓ 1 callersFunction_filter_coco_by_category_ids
Return a COCO object containing only the requested categories and annotations.
src/rfdetr/evaluation/coco_eval.py:236
↓ 1 callersFunction_filter_keypoint_hflip_dict
Filter a mapping-style augmentation config.
src/rfdetr/datasets/_aug_utils.py:80
↓ 1 callersMethod_filter_per_instance_fields
Filter per-instance fields to match kept box indices. >>> import torch >>> target = {"area": torch.tensor([100, 200, 300]), "iscrowd"
src/rfdetr/datasets/transforms.py:642
↓ 1 callersFunction_flip_idx_to_pairs
Convert a YOLO flip_idx permutation to flat swap pairs. Args: flip_idx: Full permutation where ``flip_idx[i]`` is the horizontal mirror o
src/rfdetr/datasets/_keypoint_schema.py:200
↓ 1 callersMethod_gather_keypoints_for_queries
Gather keypoint predictions for the selected query rows of one image. Args: out_keypoints_i: Keypoint predictions for one image w
src/rfdetr/models/postprocess.py:246
↓ 1 callersFunction_get_activation_fn
Return an activation function given a string.
src/rfdetr/models/transformer.py:1090
↓ 1 callersFunction_get_clones
(module: nn.Module, num_clones: int)
src/rfdetr/models/transformer.py:1056
↓ 1 callersMethod_get_dataset_for_visualization
Return a built dataset split for private visualization.
src/rfdetr/training/module_data.py:519
↓ 1 callersMethod_get_decay
(self)
src/rfdetr/training/model_ema.py:38
↓ 1 callersFunction_get_ema_inner_module
Return the inner ``nn.Module`` wrapped by an EMA callback. ``RFDETREMACallback._average_model`` is a private attribute holding a ``torch.optim.sw
src/rfdetr/training/callbacks/coco_eval.py:62
↓ 1 callersMethod_get_ema_model_state_dict
Resolve EMA model weights from the active EMA callback. Args: trainer: The Lightning Trainer instance. pl_module: The
src/rfdetr/training/callbacks/best_model.py:195
↓ 1 callersMethod_get_live_model_state_dict
Resolve live model weights from the active Lightning module. Args: pl_module: The ``RFDETRModelModule`` being trained. R
src/rfdetr/training/callbacks/best_model.py:181
↓ 1 callersFunction_get_patch_embed_projection
Return the patch-embedding projection layer for an RF-DETR model. RFDETR wrappers are not nn.Module; the underlying PyTorch module lives at ``mod
tests/models/test_model.py:13
↓ 1 callersFunction_infer_keypoint_count
Infer a single keypoint count from COCO category metadata or annotations.
src/rfdetr/evaluation/coco_eval.py:120
↓ 1 callersFunction_install_fake_onnx2tf
Insert a fake ``onnx2tf`` package into ``sys.modules``. Saves any pre-existing real modules under the same keys so they can be restored by ``_rem
tests/export/test_tflite_export.py:61
↓ 1 callersFunction_is_cuda_oom
(exc: BaseException)
src/rfdetr/training/auto_batch.py:54
↓ 1 callersFunction_is_distributed_strategy_requested
Return whether a TrainConfig strategy string requests distributed execution.
src/rfdetr/training/trainer.py:106
↓ 1 callersFunction_is_geometric_transform
Return True if transform (or any nested transform) affects spatial coordinates. For container transforms such as ``A.OneOf`` or ``A.Sequential``,
src/rfdetr/datasets/transforms.py:152
↓ 1 callersFunction_is_intentional
(key: str)
src/rfdetr/models/weights.py:141
↓ 1 callersFunction_is_loss_col
Return whether a metric column is a loss scalar.
src/rfdetr/visualize/training.py:159
↓ 1 callersFunction_is_online
(host: str, port: int, timeout_s: float = 3.0)
tests/inference/test_predict.py:25
← previousnext →501–600 of 3,167, ranked by callers