MCPcopy Index your code

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

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

↓ 3 callersMethodreinitialize_keypoint_head
Resize schema-dependent GroupPose state to match ``num_keypoints_per_class``.
src/rfdetr/models/lwdetr.py:288
↓ 3 callersFunctionremap_projector_to_cross_attn
Clone backbone projector weights into ``cross_attn_projector`` for dual-projector models. Older checkpoints can contain only ``backbone.0.project
src/rfdetr/utilities/state_dict.py:207
↓ 3 callersMethodsave_grid
Create and save image grids to ``output_dir``. Each grid is a 3x3 JPEG containing up to 9 images from a single batch, with bounding boxes and
src/rfdetr/datasets/save_grids.py:44
↓ 3 callersFunctionschemas_semantically_equal
Return True if *a* and *b* represent the same keypoint structure. Two schemas are semantically equal when they encode identical active keypoi
src/rfdetr/utilities/keypoints.py:97
↓ 3 callersMethodtest_step
(self, batch: object, batch_idx: int)
tests/training/callbacks/test_best_model_callback.py:454
↓ 3 callersMethodupdate_drop_path
(self, *args, **kwargs)
tests/training/helpers.py:35
↓ 3 callersMethodwarning_once
Emit *msg* as a WARNING exactly once per unique message string.
src/rfdetr/utilities/logger.py:20
↓ 2 callersMethod__init__
(self, dim, layer_scale_init_value=0)
src/rfdetr/models/heads/segmentation.py:184
↓ 2 callersMethod__init__
(self)
tests/training/callbacks/test_best_model_callback.py:71
↓ 2 callersFunction_accelerator_has_multiple_auto_devices
Return whether PTL auto/all device resolution can select multiple devices.
src/rfdetr/training/trainer.py:112
↓ 2 callersFunction_accumulate_and_summarize
Accumulate a COCO evaluator and populate ``stats`` regardless of log mode.
src/rfdetr/evaluation/coco_eval.py:324
↓ 2 callersFunction_adapt_input_conv
Adapt a 3-channel pretrained conv weight tensor to *num_channels* input channels. When ``num_channels == 3``: returns the weight unchanged. When
src/rfdetr/inference.py:70
↓ 2 callersFunction_bbox_dict
Build a torchmetrics-compatible bounding-box dict from raw list or array data. Handles empty inputs transparently — an empty *boxes* list produce
tests/benchmarks/test_inference_coco.py:73
↓ 2 callersFunction_build_coco_keypoint_subset_from_val
( *, images_root: Path, annotations_path: Path, output_root: Path, train_images: int,
tests/benchmarks/test_training_coco.py:51
↓ 2 callersFunction_build_datamodule
Set up an :class:`~rfdetr.training.RFDETRDataModule` for validation. Calls ``setup("validate")`` so ``_dataset_val`` is ready. When *num_samples
tests/benchmarks/test_inference_coco.py:220
↓ 2 callersFunction_build_feature_batch
(batch_size: int, hidden_dim: int)
tests/models/test_lwdetr_keypoints.py:18
↓ 2 callersMethod_build_module_with_backbone
Build module with a mock backbone that exposes backbone[0].encoder.
tests/training/test_module_model.py:523
↓ 2 callersFunction_build_ms_deform_inputs
Build minimal valid inputs for ms_deform_attn_core_pytorch. Args: bsz: Batch size. n_heads: Number of attention heads. he
tests/models/test_transformer.py:29
↓ 2 callersFunction_build_ptl_module
Copy pretrained weights from *rfdetr_obj* into a fresh :class:`~rfdetr.training.RFDETRModelModule`. Constructs the module with the same architect
tests/benchmarks/test_inference_coco.py:248
↓ 2 callersFunction_build_subset_annotations
( payload: dict, image_ids: list[int], )
tests/benchmarks/test_training_coco.py:28
↓ 2 callersFunction_build_train_config
Build a minimal :class:`~rfdetr.config.TrainConfig` for COCO inference runs. Loggers and EMA are disabled; the config is only used for validation
tests/benchmarks/test_inference_coco.py:191
↓ 2 callersFunction_calculate_polygon_area
Calculate polygon area from COCO-style flat coordinates.
src/rfdetr/datasets/synthetic.py:298
↓ 2 callersFunction_cdist_bce_with_logits
Compute pairwise BCE-with-logits summed along the last dim.
src/rfdetr/models/heads/keypoints.py:291
↓ 2 callersMethod_compute_map_metric
Compute a torchmetrics mAP metric while suppressing duplicate terminal summaries under progress bars.
src/rfdetr/training/callbacks/coco_eval.py:665
↓ 2 callersMethod_construct_module
Construct an RFDETRModelModule with all heavy work mocked. Returns the constructed module and the fake nn_model whose ``load_state_dict`` rec
tests/training/test_load_pretrain_weights.py:584
↓ 2 callersMethod_create_keypoint_class_mask
Create an attention mask that blocks cross-class keypoint interactions.
src/rfdetr/models/lwdetr.py:256
↓ 2 callersMethod_create_kp_active_mask
Create a compact class-by-keypoint active mask for a keypoint schema.
src/rfdetr/models/lwdetr.py:244
↓ 2 callersFunction_dict
Fake PTL-style checkpoint with dict args.
tests/inference/test_from_checkpoint.py:33
↓ 2 callersFunction_extract_yolo_class_names_from_data
Extract contiguous YOLO class names from parsed YAML data.
src/rfdetr/datasets/_keypoint_schema.py:122
↓ 2 callersFunction_fake_model
Return a MagicMock that behaves enough like an LWDETR model.
tests/training/test_module_model.py:59
↓ 2 callersFunction_filter_intentional_keys
Return *keys* with intentional-reinit/trim entries removed. Matching is boundary-aware: a pattern matches a key when the pattern appears at the s
src/rfdetr/models/weights.py:119
↓ 2 callersFunction_filter_keypoint_hflip_item
Filter one augmentation entry, recursing into supported containers.
src/rfdetr/datasets/_aug_utils.py:95
↓ 2 callersMethod_get_ema_callback
Return the EMA callback instance, or ``None`` if not present.
src/rfdetr/training/callbacks/coco_eval.py:658
↓ 2 callersFunction_has_cuda_device
Return ``True`` when the runtime has a CUDA accelerator available. Uses the fork-safe global ``DEVICE`` constant from ``rfdetr.config`` so that t
src/rfdetr/datasets/kornia_transforms.py:68
↓ 2 callersFunction_infer_keypoint_flip_pairs_from_names
Infer horizontal-flip swap pairs from left/right keypoint names.
src/rfdetr/datasets/_keypoint_schema.py:242
↓ 2 callersFunction_input_tensor
(batch_size: int = 2)
tests/models/backbone/test_backbone.py:58
↓ 2 callersFunction_instantiate
Import class_path and construct an instance with init_args.
tests/cli/test_smoke.py:58
↓ 2 callersFunction_is_online
(host: str, port: int, timeout_s: float = 3.0)
tests/benchmarks/conftest.py:26
↓ 2 callersFunction_load
(name: str)
tests/cli/test_smoke.py:54
↓ 2 callersFunction_load_coco_results
Build a COCO detections object, including the empty-result case.
src/rfdetr/evaluation/coco_eval.py:262
↓ 2 callersFunction_load_yaml_mapping
Load a YAML file and require a mapping root. Args: yaml_path: Path to a YAML data file. Returns: Parsed YAML mapping. R
src/rfdetr/datasets/_keypoint_schema.py:93
↓ 2 callersFunction_log_keypoint_stats
Log keypoint COCO stats from an already accumulated evaluator.
src/rfdetr/evaluation/coco_eval.py:304
↓ 2 callersFunction_make_coco_builder_args
Return a namespace with all fields consumed by ``build_coco``.
tests/datasets/test_coco.py:700
↓ 2 callersFunction_make_detr_checkpoint
Return a minimal checkpoint dict for _load_pretrain_weights_into tests.
tests/training/test_detr_shim.py:1351
↓ 2 callersMethod_make_keypoint_module
Build a keypoint module wired with ``_ScalarLossModel`` and ``_BoxNormalizedCriterion`` for accum tests.
tests/training/test_module_model.py:775
↓ 2 callersFunction_make_kp_active_mask
Build a bool _kp_active_mask tensor from a keypoints-per-class schema list.
tests/training/callbacks/test_best_model_callback.py:1902
↓ 2 callersFunction_make_minimal_lwdetr
Construct the smallest viable LWDETR without loading pretrained weights. Uses a MagicMock backbone and transformer with hidden_dim=4 so the model
tests/models/heads/test_detection_head.py:25
↓ 2 callersMethod_make_ns
(self, mc=None, tc=None)
tests/models/test_namespace.py:58
↓ 2 callersMethod_make_ptl_checkpoint
Build a minimal PTL checkpoint with mismatched PE shape. Args: pe_size_src: Source grid side length (checkpoint was saved with th
tests/training/test_module_model.py:1731
↓ 2 callersFunction_make_ptl_module_from
Build an :class:`~rfdetr.training.RFDETRModelModule` from an RFDETR instance. Creates the module with the same architecture as *rfdetr_obj*, copi
tests/benchmarks/test_training_synthetic.py:36
↓ 2 callersFunction_make_train_config
(tmp_path, **overrides)
tests/training/test_detr_shim.py:50
↓ 2 callersFunction_mirror_keypoint_name
Return the left/right counterpart for a normalized keypoint name.
src/rfdetr/datasets/_keypoint_schema.py:230
↓ 2 callersFunction_move_model_context_to_device
Move model weights to the target device recorded in *model_ctx*. ``_build_model_context`` intentionally keeps the ``nn.Module`` on CPU so that ``
src/rfdetr/detr.py:188
↓ 2 callersFunction_parse_yolo_label_line
Parse one YOLO label line and return ``(class_id, xyxy_px, polygon_px)``. Args: values: Whitespace-split fields from the label line.
src/rfdetr/datasets/yolo.py:169
↓ 2 callersFunction_place_legend_below_axes
Place a compact multi-column legend below a matplotlib axes.
src/rfdetr/visualize/training.py:42
↓ 2 callersFunction_plot_columns_on_axes
Plot columns with color by metric name and line style by split. When seaborn is installed, draws mean ± 1 std-dev bands computed from within-epoc
src/rfdetr/visualize/training.py:75
↓ 2 callersFunction_predict_keypoint_preview_batches
Run keypoint-preview inference in fixed-size batches. Args: model: Loaded keypoint-preview model. image_paths: COCO image paths t
tests/benchmarks/test_inference_coco.py:321
↓ 2 callersMethod_prepare_ema_metric
Ensure ``map_metric_ema`` exists (and is reset) on EVERY rank when EMA is active. Driven by the rank-invariant presence of the EMA callback r
src/rfdetr/training/callbacks/coco_eval.py:682
↓ 2 callersFunction_preprocess_pil_to_nchw
Resize and normalise a PIL image to an ``(1, C, H, W)`` float32 NCHW tensor. Resizes using ``BILINEAR`` to match ``torchvision.transforms.functio
src/rfdetr/export/_onnx/inference.py:79
↓ 2 callersFunction_probe_step
Run one forward + loss + backward; return True if successful, False on OOM.
src/rfdetr/training/auto_batch.py:101
↓ 2 callersFunction_raise_patch_size_mismatch
Raise a descriptive ValueError for a patch_size incompatibility. Args: ckpt_patch_size: patch_size recorded in (or inferred from) the che
src/rfdetr/utilities/state_dict.py:29
↓ 2 callersMethod_read_entry_point
Return the rfdetr console_scripts value from pyproject.toml.
tests/cli/test_legacy_cli.py:15
↓ 2 callersFunction_remove_fake_onnx2tf
Remove fake ``onnx2tf`` entries from ``sys.modules`` and restore originals. Args: saved: Snapshot returned by ``_install_fake_onnx2tf``.
tests/export/test_tflite_export.py:103
↓ 2 callersMethod_replay_contains_horizontal_flip
Return whether Albumentations replay metadata applied a horizontal flip. Args: replay: ``ReplayCompose`` metadata from an Albumen
src/rfdetr/datasets/transforms.py:520
↓ 2 callersFunction_require_grid_sample_dtype_support
Skip test when current backend does not support grid_sample for dtype.
tests/utilities/test_tensors.py:102
↓ 2 callersMethod_reset_f1_local
Reset the F1 accumulator for a metric split.
src/rfdetr/training/callbacks/coco_eval.py:651
↓ 2 callersFunction_reset_keypoint_gaussian_output_rows
Reset keypoint precision-Cholesky output rows to unit Gaussian values.
src/rfdetr/models/lwdetr.py:100
↓ 2 callersFunction_resize_parameter_rows
Return a parameter with the first dimension resized by tiling or truncating rows.
src/rfdetr/models/lwdetr.py:86
↓ 2 callersMethod_resolve_model_name
Resolve checkpoint model_name from model_config or config type. The CLI/PTL path does not call ``RFDETR.train()``, so ``model_config.model_na
src/rfdetr/training/callbacks/best_model.py:266
↓ 2 callersMethod_resolved_precision
Resolve the Lightning precision string for a mocked device capability and ``amp_dtype``. Args: tmp_path: pytest temporary directo
tests/training/test_build_trainer.py:497
↓ 2 callersFunction_round_up_to_multiple
Round *value* up to the next multiple of *multiple*. Args: value: Non-negative integer to round. multiple: Positive integer divis
src/rfdetr/utilities/tensors.py:23
↓ 2 callersFunction_run
(command: list[str])
src/rfdetr/utilities/package.py:36
↓ 2 callersFunction_score_rfdetr_predict
Run ``RFDETR.predict()`` on a COCO val subset and return ``(mAP@50, macro-F1)``. Loads images from disk as PIL images, calls ``rfdetr_obj.predict
tests/benchmarks/test_inference_coco.py:126
↓ 2 callersFunction_select_fixed_person_images
Load a deterministic subset of COCO person-keypoint validation images. Args: images_root: Directory containing COCO validation images.
tests/benchmarks/test_inference_coco.py:280
↓ 2 callersMethod_setup_module
(self, tmp_path, precision: str)
tests/training/test_module_model.py:1584
↓ 2 callersMethod_simulate_missing_removed_module_specs
Force the removed-module finder to behave as if shim files no longer exist.
tests/training/test_detr_shim.py:1122
↓ 2 callersMethod_swap_models
Swap live model weights with averaged EMA weights.
src/rfdetr/training/callbacks/ema.py:140
↓ 2 callersMethod_tc
(self, **kwargs)
tests/models/test_config.py:449
↓ 2 callersFunction_to_bg_first
Prepend a background slot to an active-first schema. A no-op when *schema* already starts with a zero-keypoint slot or is empty. Args:
src/rfdetr/utilities/keypoints.py:73
↓ 2 callersMethod_torch_interpolate
Reference implementation: ``F.interpolate`` with ``align_corners=False``.
tests/export/test_tflite_inference_parity.py:200
↓ 2 callersMethod_update
( self, model: torch.nn.Module, update_fn: Callable[[torch.Tensor, torch.Tensor], torc
src/rfdetr/training/model_ema.py:45
↓ 2 callersFunction_warn_custom_keypoint_oks_sigma_once
Warn once per keypoint count when using uniform custom OKS sigmas.
src/rfdetr/evaluation/coco_eval.py:202
↓ 2 callersMethod_write_roboflow_keypoint_categories
Write a minimal Roboflow COCO keypoint annotation file.
tests/training/test_detr_shim.py:1791
↓ 2 callersFunction_xyxy_to_xywh
Convert boxes from [x1, y1, x2, y2] to [x1, y1, w, h].
src/rfdetr/evaluation/coco_eval.py:276
↓ 2 callersMethod_yolo_data_file_path
Return the YOLO data file path when a dataset root has one. Args: dataset_dir: Path to the YOLO dataset root. Returns:
src/rfdetr/detr.py:1540
↓ 2 callersFunctionbox_iou
Compute pairwise IoU and union for two sets of boxes. Returns: iou: the NxM matrix containing the pairwise IoU values for eve
src/rfdetr/utilities/box_ops.py:42
↓ 2 callersFunctionbox_xyxy_to_cxcywh
(x: torch.Tensor)
src/rfdetr/utilities/box_ops.py:35
↓ 2 callersFunctionbuild_transformer
(args: BuilderArgs)
src/rfdetr/models/transformer.py:1060
↓ 2 callersFunctioncalculate_boundary_overlap
Calculate how much of a bounding box is outside the image boundaries. Args: bbox: Bounding box in [x_min, y_min, x_max, y_max] format.
src/rfdetr/datasets/synthetic.py:168
↓ 2 callersMethoddecompose
Return ``(tensors, mask)`` tuple. Returns: Tuple of the padded tensor and the boolean mask.
src/rfdetr/utilities/tensors.py:98
↓ 2 callersMethodexport
(self)
src/rfdetr/models/lwdetr.py:338
↓ 2 callersMethodexport
Export mode.
src/rfdetr/models/ops/modules/ms_deform_attn.py:70
↓ 2 callersMethodforward_export
(self, inputs: torch.Tensor)
src/rfdetr/models/backbone/__init__.py:45
↓ 2 callersMethodget_ema_model_state_dict
Expose EMA model weights for external checkpoint callbacks.
src/rfdetr/training/callbacks/ema.py:209
↓ 2 callersMethodget_num_keypoints_per_class_from_checkpoint
Infer the keypoint schema stored in a checkpoint state dict.
src/rfdetr/models/lwdetr.py:281
↓ 2 callersFunctionget_rank
Return the rank of the current process in the distributed group.
src/rfdetr/utilities/distributed.py:38
↓ 2 callersFunctionget_sha
Return a short status string for the current git repo, or 'unknown' if unavailable. Returns: String describing the current git HEAD, stat
src/rfdetr/utilities/package.py:28
↓ 2 callersMethodget_url
Get download URL for a model by filename. Args: filename: The model filename Returns: URL string if found, N
src/rfdetr/assets/model_weights.py:133
↓ 2 callersFunctionget_version
Get the current version of the specified package. Args: package_name: The name of the package to get the version for. Defaults to ``'rfde
src/rfdetr/utilities/package.py:13
↓ 2 callersFunctiongrp_w
Return merged cell width for columns start..end inclusive.
src/rfdetr/utilities/console.py:151
← previousnext →401–500 of 3,167, ranked by callers