MCPcopy Index your code

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

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

↓ 6 callersMethod_output_device
Return the device used by tensor outputs. Args: outputs: Model output dictionary. Top-level values are probed for tensors;
src/rfdetr/models/criterion.py:187
↓ 6 callersFunction_resize_linear
Return a new :class:`~torch.nn.Linear` resized to *num_classes* outputs. Tiles the existing weight rows when *num_classes* is larger than the cur
src/rfdetr/models/lwdetr.py:56
↓ 6 callersFunction_to_float
(value: float | torch.Tensor)
tests/benchmarks/test_training_coco.py:24
↓ 6 callersFunctionapply_lora
Apply LoRA adapters to the backbone encoder of *nn_model*. Replaces ``nn_model.backbone[0].encoder`` in-place with a PEFT-wrapped encoder using D
src/rfdetr/models/weights.py:573
↓ 6 callersFunctionbuild_criterion_from_config
Build criterion and postprocessor directly from config objects. A config-native alternative to ``build_criterion_and_postprocessors(build_namespa
src/rfdetr/models/lwdetr.py:948
↓ 6 callersFunctionbuild_dataset
(image_set: str, args: Any, resolution: int)
src/rfdetr/datasets/__init__.py:89
↓ 6 callersFunctioncollate_boxes
Pack variable-length xyxy boxes into a padded tensor and valid mask. Kornia ``AugmentationSequential`` expects boxes as ``[B, N_max, 4]``. This f
src/rfdetr/datasets/kornia_transforms.py:371
↓ 6 callersFunctioncollate_masks
Pack variable-length instance masks into a zero-padded ``[B, N_max, H, W]`` tensor. Kornia ``AugmentationSequential`` expects masks as ``[B, N_ma
src/rfdetr/datasets/kornia_transforms.py:420
↓ 6 callersFunctioncompute_keypoint_matching_cost
Compute many-to-many keypoint matching costs. Args: all_pred_keypoints: Predicted keypoints of shape ``(B, Q, K_total, >=7)``. ta
src/rfdetr/models/heads/keypoints.py:299
↓ 6 callersMethoddeploy_to_roboflow
Deploy the trained RF-DETR model to Roboflow. Deploying with Roboflow will create a Serverless API to which you can make requests. Y
src/rfdetr/detr.py:2073
↓ 6 callersFunctiondrop_scheduler
Drop scheduler.
src/rfdetr/training/drop_schedule.py:17
↓ 6 callersMethodfind_spec
Return a failing spec with a migration hint for removed legacy modules.
src/rfdetr/__init__.py:123
↓ 6 callersFunctiongather_dim
(shape_t: Any, axis_idx: int, name: str)
src/rfdetr/export/_tflite/converter.py:180
↓ 6 callersFunctiongenerate_synthetic_sample
Generate a single synthetic image and its detections. Args: img_size: Side length of the square output image. min_objects: Minimu
src/rfdetr/datasets/synthetic.py:195
↓ 6 callersFunctionget_coco_download_url
Return the official COCO 2017 download URL for the requested asset.
src/rfdetr/datasets/_develop.py:100
↓ 6 callersFunctionget_model_cache_dir
Return the directory where RF-DETR caches downloaded model weights. Reads the ``RF_HOME`` environment variable; defaults to ``~/.roboflow/models`
src/rfdetr/assets/model_weights.py:272
↓ 6 callersFunctionis_dist_avail_and_initialized
Return True if torch.distributed is available and has been initialised.
src/rfdetr/utilities/distributed.py:22
↓ 6 callersFunctionmake_collate_fn
Build a collate function that rounds batch ``H``/``W`` up to *block_size*. Used by the training DataModule to ensure that batched inputs satisfy
src/rfdetr/utilities/tensors.py:336
↓ 6 callersMethodnum_boxes_for_targets
(self, outputs, targets)
tests/training/helpers.py:54
↓ 6 callersMethodon_after_batch_transfer
Apply Kornia GPU augmentation after the batch is transferred to device. When ``_kornia_pipeline`` is set and the trainer is in training mode,
src/rfdetr/training/module_data.py:587
↓ 6 callersFunctionpoint_sample
A wrapper around :func:`~rfdetr.utilities.tensors._bilinear_grid_sample` to support 3D point_coords tensors. Unlike :func:`torch.nn.functional.gri
src/rfdetr/models/heads/segmentation.py:332
↓ 6 callersMethodpostprocess
Return fixed scores/boxes (and optional keypoints) for every image in the batch.
tests/inference/helpers.py:68
↓ 6 callersFunctionseed_all
Seed all random number generators for reproducibility. Sets seeds for Python's ``random`` module, NumPy, and PyTorch (CPU and all CUDA devices).
src/rfdetr/utilities/reproducibility.py:14
↓ 6 callersMethodtranspose_for_scores
(self, x: torch.Tensor)
src/rfdetr/models/backbone/dinov2_with_windowed_attn.py:484
↓ 6 callersMethodval_dataloader
Return the validation DataLoader. Returns: DataLoader for the validation dataset with sequential sampling.
src/rfdetr/training/module_data.py:314
↓ 5 callersMethod__init__
ch_in, ch_out, number, shortcut, groups, expansion.
src/rfdetr/models/backbone/projector.py:142
↓ 5 callersFunction_bilinear_grid_sample
Bilinear grid sampling compatible with all PyTorch backends including MPS. Drop-in replacement for ``F.grid_sample(input, grid, mode='bilinear',
src/rfdetr/utilities/tensors.py:203
↓ 5 callersMethod_compute_and_log
Shared epoch-end logic for validation and test evaluation loops. Computes mAP (via ``self.map_metric``), runs the F1 confidence-threshold swe
src/rfdetr/training/callbacks/coco_eval.py:468
↓ 5 callersMethod_convert_preds
Normalise prediction dicts from ``PostProcess`` for torchmetrics. ``PostProcess.forward`` returns masks with shape ``[K, 1, H, W]`` (the extr
src/rfdetr/training/callbacks/coco_eval.py:1060
↓ 5 callersFunction_feature
(shape: tuple[int, ...], batch_size: int = 2)
tests/models/backbone/test_backbone.py:50
↓ 5 callersFunction_find_resume_checkpoints
Return ModelCheckpoint callbacks that are NOT BestModelCallback.
tests/training/test_build_trainer.py:35
↓ 5 callersMethod_get_or_create_keypoint_oks_metric
Return the :class:`~rfdetr.evaluation.keypoint_oks.MetricKeypointOKS` for *split*, creating it if needed. The metric is created lazily on fir
src/rfdetr/training/callbacks/coco_eval.py:801
↓ 5 callersFunction_get_rich_console
Return a Rich Console appropriate for the current training context. When a ``RichProgressBar`` callback is active, its ``_console`` is the Rich g
src/rfdetr/utilities/console.py:26
↓ 5 callersFunction_has_progress_bar
Return whether the trainer has a Lightning progress bar callback. Args: trainer: The PTL Trainer (or any object with a ``callbacks`` attr
src/rfdetr/utilities/console.py:62
↓ 5 callersFunction_key_points_for_display
Build ``KeyPoints`` for visualization from RF-DETR keypoint predictions. Args: key_points: RF-DETR keypoint prediction output. ke
src/rfdetr/visualize/keypoints.py:35
↓ 5 callersMethod_make_annotation
(self, segmentation: object, category_id: int = 0)
tests/datasets/test_coco_rle.py:196
↓ 5 callersMethod_make_args
(self, square_resize_div_64: bool, aug_config=None)
tests/datasets/test_yolo.py:86
↓ 5 callersMethod_make_evaluator
Return a single-annotation evaluator with label2cat identity mapping.
tests/evaluation/test_coco_eval.py:335
↓ 5 callersMethod_make_gt
Build a 1-image, 1-annotation, 1-keypoint COCO GT.
tests/evaluation/test_keypoint_oks.py:355
↓ 5 callersFunction_make_keypoint_annotation
Build a minimal keypoint annotation used in keypoint conversion tests.
tests/datasets/test_coco.py:683
↓ 5 callersFunction_make_kp_active_mask
Build a bool _kp_active_mask tensor encoding *schema* (mirrors LwDetr._create_kp_active_mask). Args: schema: Keypoints-per-class list, e.
tests/inference/test_from_checkpoint.py:670
↓ 5 callersFunction_make_kp_checkpoint
Build a minimal keypoint checkpoint encoding *kp_schema* via ``_kp_active_mask``. Args: kp_schema: Keypoints-per-class list, e.g. ``[0, 1
tests/training/test_load_pretrain_weights.py:696
↓ 5 callersFunction_make_kp_fake_model
Build a fake nn_model mock that mimics the GroupPose keypoint model interface. Args: initial_schema: Keypoints-per-class schema the model
tests/training/test_load_pretrain_weights.py:724
↓ 5 callersFunction_make_polygon
Create a polygon annotation from a rectangular mask region.
tests/datasets/test_coco_rle.py:58
↓ 5 callersMethod_make_ptl_checkpoint
Build a fake PyTorch Lightning (PTL) native checkpoint with state_dict keys prefixed by 'model.'. Args: num_classes: Total classe
tests/models/test_weights.py:350
↓ 5 callersFunction_make_trainer
Create a Trainer configured for minimal smoke-test runs.
tests/training/test_trainer_smoke.py:42
↓ 5 callersMethod_merge_metric_state_across_ranks
Merge a metric's accumulated per-rank state onto every rank, replacing torchmetrics' sync. torchmetrics' built-in sync (``gather_all_tensors`
src/rfdetr/training/callbacks/coco_eval.py:755
↓ 5 callersFunction_minimal_backbone_config
Return the smallest valid config for backbone instantiation tests.
tests/models/backbone/test_windowed_dino.py:321
↓ 5 callersFunction_patch_validation_download
Redirect ``download_test_image_data()`` to use local calibration data. ``onnx2tf`` calls ``download_test_image_data()`` during conversion to fetc
src/rfdetr/export/_tflite/converter.py:538
↓ 5 callersFunction_render_summary_tables
Print overall and per-class metric tables to ``console``. Args: console: Rich ``Console`` instance to print to. title_pfx: Split
src/rfdetr/utilities/console.py:261
↓ 5 callersFunction_run_cli
Run RFDETRCli in-process with the given args; return the SystemExit code.
tests/cli/test_smoke.py:43
↓ 5 callersMethod_run_train
Run RFDETR.train() with patched PTL; return (mock_self, output_dir path). class_names is injected via the datamodule mock (the path RFDETR.tr
tests/training/test_detr_shim.py:1693
↓ 5 callersMethod_run_val_step
( self, tmp_path, loss_dict: dict[str, torch.Tensor] | None = None, weight_dic
tests/training/test_module_model.py:1190
↓ 5 callersMethod_setup_dm_with_val
(self, tmp_path, dataset_length=50, batch_size=2, num_workers=0)
tests/training/test_module_data.py:767
↓ 5 callersMethod_setup_dm_with_val
(self, tmp_path, dataset_length=50, batch_size=2, num_workers=0)
tests/training/test_module_data.py:847
↓ 5 callersMethod_setup_module
( self, tmp_path, multi_scale=False, do_random_resize_via_padding=False, )
tests/training/test_module_model.py:620
↓ 5 callersMethod_setup_with_mock_build
Call setup('fit') with build_dataset mocked to avoid real I/O.
tests/training/test_module_data.py:1050
↓ 5 callersMethod_should_compute_ema
Decide — identically on every rank — whether to run the EMA metric ``compute()``. Under DDP, ``_merge_metric_state_across_ranks`` issues cros
src/rfdetr/training/callbacks/coco_eval.py:710
↓ 5 callersMethod_should_step_optimizer
Return whether the current batch closes an optimizer accumulation window. The optimizer steps when either: - The current batch close
src/rfdetr/training/module_model.py:343
↓ 5 callersMethod_update_keypoint_oks_metric
Accumulate batch predictions into the keypoint OKS metric. Args: trainer: The PTL Trainer. outputs: Batch output dict
src/rfdetr/training/callbacks/coco_eval.py:854
↓ 5 callersFunction_write_coco_json
Write a synthetic COCO JSON file. Category IDs use sparse 1-based encoding (index * 2 + 1 → 1, 3, 5, …) so synthetic data exercises the same
src/rfdetr/datasets/synthetic.py:309
↓ 5 callersFunctionall_gather
Run all_gather on arbitrary picklable data (not necessarily tensors). Args: data: Any picklable object. Returns: List of dat
src/rfdetr/utilities/distributed.py:65
↓ 5 callersFunctionbox_cxcywh_to_xyxy
(x: torch.Tensor)
src/rfdetr/utilities/box_ops.py:24
↓ 5 callersFunctionbuild_roboflow_from_yolo
Build a Roboflow YOLO-format dataset. This uses Roboflow's standard YOLO directory structure (train/valid/test folders with images/ and labels/
src/rfdetr/datasets/yolo.py:811
↓ 5 callersFunctiondistributed_merge_matching_data
Gather per-rank matching data from all DDP ranks and merge into one dict. Uses ``rfdetr.utilities.all_gather`` (pickle-based) so the data need no
src/rfdetr/evaluation/matching.py:284
↓ 5 callersFunctionfilter_keypoint_hflip_augmentations
Drop horizontal-flip transforms from keypoint augmentation configs. The helper preserves the input config shape: dictionary configs return di
src/rfdetr/datasets/_aug_utils.py:31
↓ 5 callersMethodnotna
Return values interpreted as non-null booleans.
tests/visualize/test_training.py:33
↓ 5 callersMethodon_fit_start
Pull class names from the DataModule once the datasets are set up. Builds a ``category_id → name`` mapping from the COCO annotation metadata
src/rfdetr/training/callbacks/coco_eval.py:210
↓ 5 callersMethodon_train_batch_start
Apply optional multi-scale resize to the incoming batch. Modifications to ``batch`` (in-place on ``NestedTensor``) are visible in ``training_
src/rfdetr/training/module_model.py:128
↓ 5 callersMethodon_validation_epoch_start
Prepare the EMA metric on every rank before validation (keeps DDP collectives symmetric). Args: trainer: The PTL Trainer.
src/rfdetr/training/callbacks/coco_eval.py:246
↓ 5 callersMethodpredict_dataloader
Return the predict DataLoader (reuses the validation dataset, no augmentation). Returns: DataLoader for the validation dataset wi
src/rfdetr/training/module_data.py:350
↓ 5 callersMethodremove_optimized_model
Remove the optimized inference model and reset all optimization flags. Clears ``model.inference_model`` and resets all internal state set by
src/rfdetr/detr.py:1017
↓ 5 callersMethodshould_update
Return ``True`` after every optimizer step and every epoch end. The base ``WeightAveraging`` only updates on steps. This override also trigge
src/rfdetr/training/callbacks/ema.py:121
↓ 5 callersFunctionunsq0
Promote a 0-D int64 scalar to a 1-D [1] int64 vector for Concat.
src/rfdetr/export/_tflite/converter.py:228
↓ 4 callersFunction_bare_criterion
Return a SetCriterion with no losses so forward() is a no-op.
tests/models/test_criterion.py:21
↓ 4 callersMethod_batch
Build a list of ``(tensor, target_dict)`` pairs with given shapes. Args: *shapes: Variadic sequence of ``(C, H, W)`` shapes, one
tests/utilities/test_tensors.py:498
↓ 4 callersMethod_build_checkpoint_payload
Build a PTL-compatible RF-DETR checkpoint payload. Args: model_state_dict: Model weights with raw (non-prefixed) keys.
src/rfdetr/training/callbacks/best_model.py:125
↓ 4 callersFunction_build_metric_groups
Build plot groups from numeric PTL CSVLogger metrics. Args: df: DataFrame-like object with metric columns. Returns: Non-empt
src/rfdetr/visualize/training.py:139
↓ 4 callersFunction_build_summary_renderable
Build a single Rich renderable for overall and per-class metric tables. Args: title_pfx: Split label (e.g. ``"Val"`` or ``"Test"``).
src/rfdetr/utilities/console.py:208
↓ 4 callersFunction_build_transformer_inputs
Build minimal synthetic multi-scale inputs for `Transformer.forward`. Args: batch_size: Mini-batch size. hidden_dim: Transformer
tests/models/test_transformer_keypoints.py:16
↓ 4 callersMethod_cfg
Return a minimal model_config stub with the given patch_size.
tests/models/test_validate_shape_dims.py:116
↓ 4 callersFunction_check_onnx2tf_available
Verify that a compatible ``onnx2tf`` package is importable. onnx2tf 2.4.0 or later is required — earlier 1.x releases cannot lower the constant `
src/rfdetr/export/_tflite/converter.py:471
↓ 4 callersFunction_coco_val_images_complete
Check whether the COCO val2017 image directory contains the expected number of JPEG files. Returns ``False`` for a missing or empty directory so
src/rfdetr/datasets/_develop.py:43
↓ 4 callersFunction_download_lock
Provide a simple cross-process lock using an exclusive lock file. Args: lock_path: Path to the lock file used for mutual exclusion.
src/rfdetr/datasets/_develop.py:206
↓ 4 callersFunction_find_pruneable_heads_and_indices
Return the set of pruneable heads and their index mask for weight pruning. Copied from transformers.pytorch_utils.find_pruneable_heads_and_indice
src/rfdetr/models/backbone/dinov2_with_windowed_attn.py:63
↓ 4 callersMethod_format_keypoint_output
Convert compact GroupPose keypoints to class-padded keypoint layout.
src/rfdetr/models/lwdetr.py:346
↓ 4 callersFunction_gather
(iy_: torch.Tensor, ix_: torch.Tensor)
src/rfdetr/utilities/tensors.py:280
↓ 4 callersMethod_gather_and_scale_boxes
Gather selected boxes and scale normalized coordinates to pixels. Args: out_bbox: Normalized ``cxcywh`` boxes with shape ``(B, Q,
src/rfdetr/models/postprocess.py:116
↓ 4 callersFunction_get_onnx_input_info
Read the first input tensor's name and shape from an ONNX model. Args: onnx_path: Path to the ``.onnx`` file. Returns: A ``(
src/rfdetr/export/_tflite/converter.py:647
↓ 4 callersMethod_get_src_permutation_idx
(self, indices)
src/rfdetr/models/criterion.py:580
↓ 4 callersMethod_make_args
( *, backbone_only: bool = False, segmentation_head: bool = False, output_dir:
tests/export/test_export.py:249
↓ 4 callersFunction_make_batch
Build a ``(NestedTensor, targets)`` tuple for transfer_batch_to_device tests.
tests/training/test_module_data.py:111
↓ 4 callersMethod_make_images
Create *count* small JPEG images in *directory*.
tests/export/test_tflite_export.py:873
↓ 4 callersMethod_make_inputs
Return tensors suitable for unpack_boxes.
tests/datasets/test_kornia_transforms.py:187
↓ 4 callersMethod_make_kornia_batch
Build a batch with xyxy boxes suitable for on_after_batch_transfer. Returns (NestedTensor, targets) where boxes are in absolute xyxy format a
tests/training/test_module_data.py:1220
↓ 4 callersFunction_make_outputs
( batch_size: int, num_queries: int, num_keypoints: int, )
tests/models/test_criterion_keypoints.py:25
↓ 4 callersMethod_make_rfdetr
Return an RFDETR shell backed by a fully validated RFDETRBaseConfig. Uses RFDETRBaseConfig (which supplies required field defaults) so the ex
tests/assets/test_downloads.py:328
↓ 4 callersFunction_make_synthetic_rgb
Deterministic synthetic RGB image with structure (not pure noise) so resize filtering matters.
tests/export/test_tflite_inference_parity.py:57
↓ 4 callersMethod_make_target
(self, annotations: list)
tests/datasets/test_coco_rle.py:205
↓ 4 callersMethod_make_targets
Build a list of target dicts with the given per-image box counts. Each box is a valid xyxy rectangle within a 100x100 image.
tests/datasets/test_kornia_transforms.py:106
← previousnext →201–300 of 3,167, ranked by callers