MCPcopy Index your code

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

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

↓ 11 callersFunction_make_checkpoint
Build a minimal checkpoint dict with the given class count. Args: num_classes: Total classes including background (bias shape). n
tests/models/test_weights.py:26
↓ 11 callersFunction_make_legacy_pth
Write a minimal legacy .pth checkpoint and return its path.
tests/training/test_detr_shim.py:755
↓ 11 callersFunction_make_reference_mask
Create a deterministic 100x100 binary mask with a rectangular region.
tests/datasets/test_coco_rle.py:25
↓ 11 callersFunction_write_coco_annotations
Write a minimal COCO annotation file. Args: path: Destination JSON path. categories: COCO category objects. annotations:
tests/datasets/test_keypoint_schema.py:25
↓ 11 callersFunctiongen_encoder_output_proposals
r""" Input: - memory: bs, \sum{hw}, d_model - memory_padding_mask: bs, \sum{hw} - spatial_shapes: nlevel, 2 Output:
src/rfdetr/models/transformer.py:78
↓ 11 callersFunctiongenerate_coco_dataset
Generate a full synthetic dataset in COCO format. Args: output_dir: Directory where the dataset will be saved. num_images: Total
src/rfdetr/datasets/synthetic.py:424
↓ 11 callersFunctioninfer_yolo_keypoint_schema
Infer a keypoint schema from an Ultralytics YOLO pose YAML file. Args: data_file: Path to a YOLO ``data.yaml`` or ``data.yml`` file.
src/rfdetr/datasets/_keypoint_schema.py:462
↓ 10 callersMethod_box
Return a [1, 4] float32 box tensor from (x1, y1, x2, y2).
tests/evaluation/test_evaluation.py:84
↓ 10 callersFunction_cpu_module
Mock LightningModule whose ``device`` is a real string so ``metric.to(device)`` works.
tests/training/callbacks/test_coco_eval_callback.py:1275
↓ 10 callersFunction_create_interpreter
Load a TFLite model, allocate tensors, and log I/O shapes. Tries ``tflite_runtime`` first (lightweight; preferred on edge devices), then falls ba
src/rfdetr/export/_tflite/inference.py:36
↓ 10 callersMethod_make_model_with_class_names
Return a _DummyRFDETR whose inner model carries custom class_names and returns given labels.
tests/inference/test_predict.py:534
↓ 10 callersMethod_scaffold
Build a minimal RFDETR-like namespace with controllable patch_size/num_windows.
tests/export/test_export.py:481
↓ 10 callersMethod_setup_module
(self, tmp_path, **train_overrides)
tests/training/test_module_model.py:1370
↓ 10 callersFunction_write_person_keypoint_coco
Write a minimal COCO keypoint annotation file.
tests/evaluation/test_coco_eval.py:22
↓ 10 callersMethodconfigure_optimizers
Minimal single-group AdamW — bypasses get_param_dict.
tests/training/test_trainer_smoke.py:298
↓ 10 callersFunctionprecision_cholesky_to_pixel_covariance
Convert RF-DETR keypoint precision parameters into pixel covariances. The keypoint head predicts lower-triangular precision-Cholesky parameters i
src/rfdetr/utilities/keypoints.py:136
↓ 10 callersMethodtrain_dataloader
Return the training DataLoader. Uses a replacement sampler when the dataset is too small to fill ``_MIN_TRAIN_BATCHES`` effective batches
src/rfdetr/training/module_data.py:256
↓ 9 callersMethod_call_build_o365_raw
Call build_o365_raw with mocked CocoDetection and transform builders.
tests/datasets/test_coco.py:428
↓ 9 callersFunction_detect_device
Detect the best available device **without** initialising the CUDA runtime. ``torch.cuda.is_available()`` creates a CUDA driver context that make
src/rfdetr/config.py:27
↓ 9 callersMethod_get_backbone_encoder_layers
Resolve the list of transformer blocks/layers from backbone[0].encoder. Supports multiple backbone architectures: - encoder.blocks (s
src/rfdetr/models/lwdetr.py:710
↓ 9 callersFunction_load_calibration_images
Load images from a directory and prepare them for calibration. Images are loaded, resized to ``(height, width)``, converted to ``float32`` in ``[
src/rfdetr/export/_tflite/converter.py:589
↓ 9 callersMethod_make_checkpoint
Build a fake checkpoint dict.
tests/training/test_module_model.py:290
↓ 9 callersFunction_make_evaluator_mock
Return a CocoEvaluator mock that returns the given stats array. Stats list must have exactly 10 elements matching _summarizeKps() output shape.
tests/evaluation/test_keypoint_oks.py:44
↓ 9 callersFunction_make_mock_pl_module
Create a minimal mock RFDETRModule with ``train_config.epochs``.
tests/training/callbacks/test_drop_path_callback.py:31
↓ 9 callersFunction_make_mock_trainer
Create a minimal mock Trainer with controllable step metadata.
tests/training/callbacks/test_drop_path_callback.py:23
↓ 9 callersFunction_ns
Fake legacy checkpoint with argparse.Namespace args.
tests/inference/test_from_checkpoint.py:28
↓ 9 callersFunction_preprocess_image
Resize and ImageNet-normalise an image to match ``RFDETR.predict()``. Uses ``torchvision.transforms.functional`` when importable for bit-exact pa
src/rfdetr/export/_tflite/inference.py:155
↓ 9 callersFunction_render_overall_merged
Render the overall metrics table with merged group-header cells. Uses only plain Unicode box-drawing characters (no ANSI colour codes) so the out
src/rfdetr/utilities/console.py:75
↓ 9 callersMethod_reset_keypoint_split
Reset accumulated keypoint predictions for *split*. Args: split: One of ``"train"``, ``"val"``, ``"val_ema"``, or ``"test"``.
src/rfdetr/training/callbacks/coco_eval.py:844
↓ 9 callersFunction_resolve_patch_size
Resolve and validate the ``patch_size`` argument for :meth:`RFDETR.export` and :meth:`RFDETR.predict`. Args: patch_size: Value supplied b
src/rfdetr/detr.py:154
↓ 9 callersMethod_run_step
(self, tmp_path, loss_dict=None, weight_dict=None, accumulate_grad_batches=1, model_config=None)
tests/training/test_module_model.py:699
↓ 9 callersMethod_setup_dm_with_train
Construct DataModule and inject a fake _dataset_train of given length.
tests/training/test_module_data.py:550
↓ 9 callersFunction_slice_query_param_per_group
Slice a ``refpoint_embed`` / ``query_feat`` weight preserving per-group structure. ``LWDETR`` packs query embeddings as ``nn.Embedding(num_querie
src/rfdetr/models/weights.py:42
↓ 9 callersFunction_split_cols
Return split-prefixed columns whose name contains any of the given patterns.
src/rfdetr/visualize/training.py:152
↓ 9 callersFunction_write_yolo_pose_dataset
Create a minimal YOLO pose dataset on disk.
tests/datasets/test_yolo.py:50
↓ 9 callersFunctionbuild_model_from_config
Build an LWDETR model directly from a ModelConfig. A config-native alternative to ``build_model(build_namespace(mc, tc))``. Constructs the namesp
src/rfdetr/models/lwdetr.py:904
↓ 9 callersFunctiondraw_synthetic_shape
Draw a geometric shape on an image and return its COCO polygon. The polygon is computed first, then used for both rendering and annotation, so th
src/rfdetr/datasets/synthetic.py:120
↓ 9 callersMethodget_image_info
Return lightweight metadata without loading pixels or dense masks.
src/rfdetr/datasets/yolo.py:164
↓ 9 callersFunctionmatcher
Shared HungarianMatcher instance.
tests/models/test_matcher.py:15
↓ 9 callersMethodon_train_start
Build per-step rate arrays from trainer metadata. Args: trainer: The Lightning Trainer instance. pl_module: The ``RFD
src/rfdetr/training/callbacks/drop_schedule.py:54
↓ 9 callersMethodon_validation_epoch_end
Compute and log mAP and F1 metrics at the end of the validation epoch. Args: trainer: The PTL Trainer. pl_module: The
src/rfdetr/training/callbacks/coco_eval.py:400
↓ 9 callersMethodto
(self, *_args, **_kwargs)
tests/export/test_export.py:55
↓ 9 callersFunctionunpack_boxes
Unpack augmented boxes (and optionally masks), clamp to image bounds, remove zero-area boxes. After Kornia augmentation the padded ``[B, N_max, 4
src/rfdetr/datasets/kornia_transforms.py:468
↓ 8 callersMethod_convert_targets
Convert targets from normalised CxCyWH to absolute xyxy boxes. Also passes ``iscrowd`` and ``masks`` through unchanged. Args:
src/rfdetr/training/callbacks/coco_eval.py:1086
↓ 8 callersFunction_decode_masks
Upsample mask logits to image size and threshold at zero. Matches ``PostProcess.forward``: bilinear upsample with ``align_corners=False`` followe
src/rfdetr/export/_tflite/inference.py:113
↓ 8 callersFunction_detection_targets
Return a single-image target dict with one box in normalised CxCyWH.
tests/training/callbacks/test_coco_eval_callback.py:51
↓ 8 callersFunction_download_and_extract
Download a zip file and safely extract it into the destination directory. Args: url: URL to a zip archive. dest_dir: Directory wh
src/rfdetr/datasets/_develop.py:175
↓ 8 callersMethod_ensure_eval_mode_for_unoptimized_inference
Put the underlying module in eval mode before unoptimized inference. Inference must never run with dropout / batch-norm in training mode. The
src/rfdetr/detr.py:1717
↓ 8 callersMethod_load_classes
Load class names from a COCO or YOLO dataset directory.
src/rfdetr/detr.py:1334
↓ 8 callersFunction_make_keypoint_prediction
Build a per-image prediction dict for MetricKeypointOKS.update(). Args: image_id: COCO image ID. kp_xy: List of (x, y) coordinate
tests/evaluation/test_keypoint_oks.py:98
↓ 8 callersMethod_make_module
(self, mc=None, tc=None)
tests/models/test_builder_characterization.py:367
↓ 8 callersFunction_make_param_dicts
Build a minimal param-dict list for AdamW from all trainable parameters.
tests/training/helpers.py:124
↓ 8 callersFunction_make_predictions
Return a single-image prediction dict with zero-valued tensors.
tests/evaluation/test_keypoint_oks.py:32
↓ 8 callersMethod_make_rfdetr
Create a minimal RFDETR instance with mocked internals.
tests/export/test_tflite_export.py:509
↓ 8 callersFunction_make_trainer
Return a minimal mock Trainer.
tests/utilities/test_console.py:26
↓ 8 callersFunction_minimal_overall
Return an overall dict with the minimal keys _render_overall_merged expects.
tests/utilities/test_console.py:33
↓ 8 callersFunction_prepare_calibration_data
Prepare calibration data as a ``.npy`` file for ``onnx2tf``. The returned path points to a ``.npy`` file containing an NHWC float32 array with pi
src/rfdetr/export/_tflite/converter.py:672
↓ 8 callersMethod_print_metrics_tables
Print two tables to the terminal: overall metrics and per-class metrics. The overall table is transposed (metrics as columns, one value row)
src/rfdetr/training/callbacks/coco_eval.py:986
↓ 8 callersMethod_run
( self, pred_scores: torch.Tensor, pred_items: torch.Tensor, gt_items: torch.T
tests/evaluation/test_evaluation.py:93
↓ 8 callersMethod_serialize_model_config
Serialize the model architecture config when the module exposes one. Schema-critical fields (``num_keypoints_per_class``, ``num_classes``) ar
src/rfdetr/training/callbacks/best_model.py:223
↓ 8 callersMethod_show_samples
Build a private diagnostic figure for transformed dataset samples. Samples the dataset after RF-DETR dataset transforms, so boxes and
src/rfdetr/training/module_data.py:368
↓ 8 callersFunction_write_coco_json
Write a minimal valid COCO annotation file.
tests/datasets/test_coco.py:136
↓ 8 callersFunctioncompute_l1_keypoint_loss
Compute the keypoint loss vector per matched target. The tensor layout follows GroupPose-style keypoints where each target class defines how
src/rfdetr/models/heads/keypoints.py:125
↓ 8 callersMethodexport_for_roboflow
Write a Roboflow upload bundle (``weights.pt`` + ``class_names.txt``) into *output_dir*. This is the network-free core of :meth:`deploy_to_ro
src/rfdetr/detr.py:2125
↓ 8 callersMethodfrom_filename
Get ModelWeightAsset by filename. Args: filename: The model filename (e.g., 'rf-detr-base.pth') Returns: Mod
src/rfdetr/assets/model_weights.py:113
↓ 8 callersFunctionnested_tensor_from_tensor_list
Pad a list of variable-size tensors into a single NestedTensor. Args: tensor_list: List of 3-D tensors (C, H, W) with possibly different
src/rfdetr/utilities/tensors.py:110
↓ 8 callersFunctionseg_train_config
Factory fixture — call with **overrides to get a minimal SegmentationTrainConfig. tmp_path is injected automatically so test methods do not need
tests/training/conftest.py:67
↓ 8 callersFunctionstrip_checkpoint
Strip a checkpoint file down to ``model``, ``args``, and PTL-compatible keys. Preserves ``model_name`` (when present) so that ``RFDETR.from_check
src/rfdetr/utilities/state_dict.py:133
↓ 7 callersMethod_aggregate_keypoint_class_logits
Aggregate keypoint class-logit contributions into detection-class logits.
src/rfdetr/models/lwdetr.py:397
↓ 7 callersMethod_align_keypoint_schema_from_dataset
Infer or validate keypoint schema from COCO, Roboflow COCO, or YOLO pose metadata. Args: config: Training configuration containin
src/rfdetr/detr.py:1577
↓ 7 callersMethod_align_num_classes_from_dataset
Auto-detect the dataset class count and align ``model_config.num_classes`` in-place. Must be called before ``RFDETRModelModule`` is construct
src/rfdetr/detr.py:1400
↓ 7 callersFunction_bilinear_resize_half_pixel
Numpy bilinear resize matching ``F.interpolate(mode="bilinear", align_corners=False)``. Half-pixel center convention. Used by ``_decode_masks`` o
src/rfdetr/export/_tflite/inference.py:77
↓ 7 callersFunction_build_albu_transform
Build a single Albumentations transform from its name and parameter dict. Handles container transforms (``OneOf``, ``SomeOf``, ``Sequential``) by
src/rfdetr/datasets/transforms.py:181
↓ 7 callersMethod_build_dm_with_backend
Construct a DataModule with the given augmentation_backend.
tests/training/test_module_data.py:1042
↓ 7 callersFunction_ckpt_args_get
Get a field from checkpoint ``"args"``, handling both dict and attribute access. New checkpoints (PTL training stack) store ``"args"`` as a plain
src/rfdetr/utilities/state_dict.py:47
↓ 7 callersFunction_compute_file_md5
Compute MD5 hash of a file. Args: filepath: Path to the file. Returns: MD5 hash as hexadecimal string.
src/rfdetr/utilities/files.py:21
↓ 7 callersFunction_download_file
Download a file from a URL with optional MD5 validation. Args: url: URL to download from. filename: Path to save the file.
src/rfdetr/utilities/files.py:54
↓ 7 callersFunction_encode_compressed_rle
Encode a binary mask to compressed RLE with string counts (COCO JSON format).
tests/datasets/test_coco_rle.py:32
↓ 7 callersFunction_export_tiny_model
Export a tiny model to ONNX and return the output file path. Args: tmp_path: Temporary directory provided by pytest. notes: Optio
tests/export/test_onnx_notes.py:36
↓ 7 callersMethod_image
Return a ``(C, H, W)`` float32 tensor filled with the given value.
tests/utilities/test_tensors.py:427
↓ 7 callersFunction_load
Parse a config file by stem name and return its dict.
tests/cli/test_configs.py:58
↓ 7 callersFunction_make_boxes
Return (1, 10, 4) array of normalised cxcywh boxes all centred at 0.5.
tests/export/test_tflite_inference.py:42
↓ 7 callersMethod_make_dataset
Return a simple TensorDataset of given length.
tests/training/test_module_data.py:676
↓ 7 callersFunction_make_fit_loop_state
Build a minimal ``fit_loop`` state dict that restores the epoch counter. ``BestModelCallback`` stores ``trainer.current_epoch`` as ``"epoch"`` in
src/rfdetr/utilities/state_dict.py:67
↓ 7 callersFunction_make_target
(annotations=_ANNOTATIONS)
tests/datasets/test_coco.py:42
↓ 7 callersFunction_validate_file_md5
Validate that a file's MD5 hash matches the expected hash. Args: filepath: Path to the file. expected_md5: Expected MD5 hash.
src/rfdetr/utilities/files.py:37
↓ 7 callersFunction_warn_on_partial_load
Emit a ``logger.warning`` when ``load_state_dict`` left non-trivial gaps. ``load_state_dict(strict=False)`` silently ignores keys that the model
src/rfdetr/models/weights.py:147
↓ 7 callersFunctionbuild_roboflow_from_coco
Build a Roboflow COCO-format dataset. This uses Roboflow's standard directory structure (train/valid/test folders with _annotations.coco.json).
src/rfdetr/datasets/coco.py:790
↓ 7 callersFunctionms_deform_attn_core_pytorch
For debug and test only, need to use cuda version instead.
src/rfdetr/models/ops/functions/ms_deform_attn_func.py:23
↓ 6 callersFunction_assert_no_download_temp_files
Assert that randomized temporary download files were cleaned up.
tests/utilities/test_file_validation.py:70
↓ 6 callersMethod_attach_mock_trainer
Attach a mock trainer with the given training state to the DataModule.
tests/training/test_module_data.py:1214
↓ 6 callersMethod_build_dm
Construct a DataModule for on_after_batch_transfer tests.
tests/training/test_module_data.py:1206
↓ 6 callersFunction_compute_mask_iou
Compute pairwise boolean-mask IoU between N predictions and M ground truths. Args: pred_masks: Boolean mask tensor of shape [N, H, W].
src/rfdetr/evaluation/matching.py:28
↓ 6 callersFunction_detection_preds
Return a list with one per-image prediction dict.
tests/training/callbacks/test_coco_eval_callback.py:40
↓ 6 callersFunction_get_aligned_output_features_output_indices
Align out_features and out_indices against stage_names, filling in defaults when either is None. Copied from transformers.utils.backbone_utils.ge
src/rfdetr/models/backbone/dinov2_with_windowed_attn.py:109
↓ 6 callersFunction_is_bg_first_schema
Return True if *schema* uses a background-first layout. A background-first schema has a leading slot with zero keypoints that acts as a backg
src/rfdetr/utilities/keypoints.py:18
↓ 6 callersMethod_make_image
(self)
tests/datasets/test_augmentations.py:1837
↓ 6 callersMethod_make_model_with_config
Return a _DummyRFDETR whose model_config carries patch_size and num_windows.
tests/inference/test_predict.py:460
↓ 6 callersMethod_make_ns
Build a namespace for tests with minimal default TrainConfig values.
tests/models/test_namespace.py:22
↓ 6 callersFunction_make_stub_model
Build an RFDETR instance whose model/state are stubbed for export_for_roboflow. ``RFDETR.__init__`` is bypassed; only the attributes ``export_for
tests/export/test_export_for_roboflow.py:23
← previousnext →101–200 of 3,167, ranked by callers