SYMBOL INDEX (1094 symbols across 117 files) FILE: dinov2/configs/__init__.py function load_config (line 11) | def load_config(config_name: str): function load_and_merge_config (line 19) | def load_and_merge_config(config_name: str): FILE: dinov2/data/accumulators.py function _simple_gather_all_tensors (line 17) | def _simple_gather_all_tensors(result: torch.Tensor, group: Any, world_s... function gather_all_tensors (line 23) | def gather_all_tensors(result: torch.Tensor, group: Optional[Any] = None... function _cat_and_gather_tensor_list (line 74) | def _cat_and_gather_tensor_list(tensor_list: List[Tensor]) -> Tensor: class Accumulator (line 79) | class Accumulator: method __init__ (line 80) | def __init__(self) -> None: method update (line 83) | def update(self, preds: Tensor, target: Tensor, index: Tensor) -> None: method accumulate (line 86) | def accumulate(self) -> Optional[Dict[str, Tensor]]: class NoOpAccumulator (line 90) | class NoOpAccumulator(Accumulator): method __init__ (line 91) | def __init__(self) -> None: method update (line 94) | def update(self, preds: Tensor, target: Tensor, index: Tensor) -> None: method accumulate (line 97) | def accumulate(self) -> None: class ResultsAccumulator (line 101) | class ResultsAccumulator(Accumulator): method __init__ (line 106) | def __init__(self) -> None: method update (line 111) | def update(self, preds: Tensor, target: Tensor, index: Tensor) -> None: method _gather_tensors (line 119) | def _gather_tensors(self): method accumulate (line 124) | def accumulate(self) -> Dict[str, Tensor]: FILE: dinov2/data/adapters.py class DatasetWithEnumeratedTargets (line 11) | class DatasetWithEnumeratedTargets(Dataset): method __init__ (line 18) | def __init__(self, dataset: Dataset, pad_dataset: bool = False, num_re... method get_image_relpath (line 27) | def get_image_relpath(self, index: int) -> str: method get_image_data (line 31) | def get_image_data(self, index: int) -> bytes: method get_target (line 35) | def get_target(self, index: int) -> Tuple[Any, int]: method __getitem__ (line 42) | def __getitem__(self, index: int) -> Tuple[Any, Tuple[Any, int]]: method __len__ (line 50) | def __len__(self) -> int: FILE: dinov2/data/augmentations.py class DataAugmentationDINO (line 19) | class DataAugmentationDINO(object): method __init__ (line 20) | def __init__( method __call__ (line 96) | def __call__(self, image): FILE: dinov2/data/cell_dino/augmentations.py class CellAugmentationDINO (line 22) | class CellAugmentationDINO(object): method __init__ (line 23) | def __init__( method __call__ (line 75) | def __call__(self, image): FILE: dinov2/data/cell_dino/transforms.py class NormalizationType (line 12) | class NormalizationType(Enum): class Div255 (line 17) | class Div255(torch.nn.Module): method forward (line 18) | def forward(self, x): class SelfNormalizeNoDiv (line 23) | class SelfNormalizeNoDiv(torch.nn.Module): method forward (line 24) | def forward(self, x): class SelfNormalize (line 32) | class SelfNormalize(torch.nn.Module): method forward (line 33) | def forward(self, x): class RandomContrastProteinChannel (line 42) | class RandomContrastProteinChannel(torch.nn.Module): method __init__ (line 48) | def __init__(self, p=0.2): method forward (line 52) | def forward(self, img): class RandomRemoveChannelExceptProtein (line 65) | class RandomRemoveChannelExceptProtein(torch.nn.Module): method __init__ (line 70) | def __init__(self, p=0.2): method forward (line 74) | def forward(self, img): class RandomRemoveChannel (line 86) | class RandomRemoveChannel(torch.nn.Module): method __init__ (line 91) | def __init__(self, p=0.2): method forward (line 95) | def forward(self, img): class RandomContrast (line 108) | class RandomContrast(torch.nn.Module): method __init__ (line 109) | def __init__(self, p=0.2): method forward (line 113) | def forward(self, img): class RandomBrightness (line 123) | class RandomBrightness(torch.nn.Module): method __init__ (line 124) | def __init__(self, p=0.2): method forward (line 128) | def forward(self, img): function make_classification_eval_cell_transform (line 138) | def make_classification_eval_cell_transform( FILE: dinov2/data/collate.py function collate_data_and_cast (line 10) | def collate_data_and_cast(samples_list, mask_ratio_tuple, mask_probabili... FILE: dinov2/data/datasets/cell_dino/chammi_cp.py class _Split (line 33) | class _Split(Enum): function _load_file_names_and_targets (line 41) | def _load_file_names_and_targets( class CHAMMI_CP (line 59) | class CHAMMI_CP(ExtendedVisionDataset): method __init__ (line 68) | def __init__( method get_image_relpath (line 95) | def get_image_relpath(self, index: int) -> str: method get_image_data (line 98) | def get_image_data(self, index: int) -> bytes: method get_target (line 105) | def get_target(self, index: int) -> Any: method get_targets (line 108) | def get_targets(self) -> np.ndarray: method __len__ (line 111) | def __len__(self) -> int: FILE: dinov2/data/datasets/cell_dino/chammi_hpa.py class _Split (line 33) | class _Split(Enum): function _load_file_names_and_targets (line 40) | def _load_file_names_and_targets( class CHAMMI_HPA (line 57) | class CHAMMI_HPA(ExtendedVisionDataset): method __init__ (line 66) | def __init__( method get_image_relpath (line 94) | def get_image_relpath(self, index: int) -> str: method get_image_data (line 97) | def get_image_data(self, index: int) -> bytes: method get_target (line 104) | def get_target(self, index: int) -> Any: method get_targets (line 107) | def get_targets(self) -> np.ndarray: method __len__ (line 110) | def __len__(self) -> int: FILE: dinov2/data/datasets/cell_dino/chammi_wtc.py class _Split (line 32) | class _Split(Enum): function _load_file_names_and_targets (line 38) | def _load_file_names_and_targets( class CHAMMI_WTC (line 55) | class CHAMMI_WTC(ExtendedVisionDataset): method __init__ (line 64) | def __init__( method get_image_relpath (line 91) | def get_image_relpath(self, index: int) -> str: method get_image_data (line 94) | def get_image_data(self, index: int) -> bytes: method get_target (line 101) | def get_target(self, index: int) -> Any: method get_targets (line 104) | def get_targets(self) -> np.ndarray: method __len__ (line 107) | def __len__(self) -> int: FILE: dinov2/data/datasets/cell_dino/hpafov.py class _Split (line 89) | class _Split(Enum): function get_csv_fpath (line 95) | def get_csv_fpath(split): class _WildCard (line 105) | class _WildCard(Enum): class _Mode (line 110) | class _Mode(Enum): method nb_labels (line 123) | def nb_labels(self): function _list_images_from_csv (line 132) | def _list_images_from_csv(img_path, csv_path): function _load_file_names_and_labels_ssl (line 141) | def _load_file_names_and_labels_ssl( function _load_file_names_and_labels (line 152) | def _load_file_names_and_labels( class HPAFoV (line 208) | class HPAFoV(ExtendedVisionDataset): method __init__ (line 213) | def __init__( method get_image_relpath (line 262) | def get_image_relpath(self, index: int) -> str: method get_image_data (line 265) | def get_image_data(self, index: int) -> bytes: method get_target (line 276) | def get_target(self, index: int) -> Any: method get_targets (line 279) | def get_targets(self) -> np.ndarray: method __len__ (line 282) | def __len__(self) -> int: FILE: dinov2/data/datasets/cell_dino/hpaone.py class _Split (line 75) | class _Split(Enum): class _Mode (line 81) | class _Mode(Enum): method num_labels (line 86) | def num_labels(self): function _simple_parse_csv (line 92) | def _simple_parse_csv(img_rootdir, csv_filepath: str): function _parse_csv (line 100) | def _parse_csv(img_rootdir, csv_labels_path: str): function _load_file_names_and_labels_ssl (line 127) | def _load_file_names_and_labels_ssl( function _load_file_names_and_labels_train_or_test (line 138) | def _load_file_names_and_labels_train_or_test( class HPAone (line 164) | class HPAone(ExtendedVisionDataset): method __init__ (line 168) | def __init__( method get_image_relpath (line 206) | def get_image_relpath(self, index: int) -> str: method get_image_data (line 209) | def get_image_data(self, index: int) -> bytes: method get_target (line 216) | def get_target(self, index: int) -> Any: method get_targets (line 219) | def get_targets(self) -> np.ndarray: method __len__ (line 222) | def __len__(self) -> int: FILE: dinov2/data/datasets/decoders.py class Decoder (line 20) | class Decoder: method decode (line 21) | def decode(self) -> Any: class DecoderType (line 25) | class DecoderType(Enum): method get_class (line 31) | def get_class(self) -> Type[Decoder]: # noqa: C901 class ImageDataDecoder (line 42) | class ImageDataDecoder(Decoder): method __init__ (line 43) | def __init__(self, image_data: bytes) -> None: method decode (line 46) | def decode(self) -> Image: class TargetDecoder (line 51) | class TargetDecoder(Decoder): method __init__ (line 52) | def __init__(self, target: Any): method decode (line 55) | def decode(self) -> Any: class XChannelsDecoder (line 59) | class XChannelsDecoder(Decoder): method __init__ (line 60) | def __init__(self, image_data: bytes) -> None: method decode (line 63) | def decode(self): class XChannelsTIFFDecoder (line 70) | class XChannelsTIFFDecoder(Decoder): method __init__ (line 71) | def __init__(self, image_data: bytes, num_channels: int = 3) -> None: method decode (line 75) | def decode(self): class ChannelSelectDecoder (line 81) | class ChannelSelectDecoder(Decoder): method __init__ (line 82) | def __init__(self, image_data: bytes, select_channel: bool = False) ->... method decode (line 90) | def decode(self): FILE: dinov2/data/datasets/extended.py class ExtendedVisionDataset (line 13) | class ExtendedVisionDataset(VisionDataset): method __init__ (line 14) | def __init__(self, *args, **kwargs) -> None: method get_image_data (line 23) | def get_image_data(self, index: int) -> bytes: method get_target (line 26) | def get_target(self, index: int) -> Any: method __getitem__ (line 29) | def __getitem__(self, index: int) -> Tuple[Any, Any]: method __len__ (line 43) | def __len__(self) -> int: FILE: dinov2/data/datasets/image_net.py class _Split (line 21) | class _Split(Enum): method length (line 27) | def length(self) -> int: method get_dirname (line 35) | def get_dirname(self, class_id: Optional[str] = None) -> str: method get_image_relpath (line 38) | def get_image_relpath(self, actual_index: int, class_id: Optional[str]... method parse_image_relpath (line 46) | def parse_image_relpath(self, image_relpath: str) -> Tuple[str, int]: class ImageNet (line 55) | class ImageNet(ExtendedVisionDataset): method __init__ (line 59) | def __init__( method split (line 78) | def split(self) -> "ImageNet.Split": method _get_extra_full_path (line 81) | def _get_extra_full_path(self, extra_path: str) -> str: method _load_extra (line 84) | def _load_extra(self, extra_path: str) -> np.ndarray: method _save_extra (line 88) | def _save_extra(self, extra_array: np.ndarray, extra_path: str) -> None: method _entries_path (line 94) | def _entries_path(self) -> str: method _class_ids_path (line 98) | def _class_ids_path(self) -> str: method _class_names_path (line 102) | def _class_names_path(self) -> str: method _get_entries (line 105) | def _get_entries(self) -> np.ndarray: method _get_class_ids (line 111) | def _get_class_ids(self) -> np.ndarray: method _get_class_names (line 119) | def _get_class_names(self) -> np.ndarray: method find_class_id (line 127) | def find_class_id(self, class_index: int) -> str: method find_class_name (line 131) | def find_class_name(self, class_index: int) -> str: method get_image_data (line 135) | def get_image_data(self, index: int) -> bytes: method get_target (line 147) | def get_target(self, index: int) -> Optional[Target]: method get_targets (line 152) | def get_targets(self) -> Optional[np.ndarray]: method get_class_id (line 156) | def get_class_id(self, index: int) -> Optional[str]: method get_class_name (line 161) | def get_class_name(self, index: int) -> Optional[str]: method __len__ (line 166) | def __len__(self) -> int: method _load_labels (line 171) | def _load_labels(self, labels_path: str) -> List[Tuple[str, str]]: method _dump_entries (line 186) | def _dump_entries(self) -> None: method _dump_class_ids_and_names (line 252) | def _dump_class_ids_and_names(self) -> None: method dump_extra (line 288) | def dump_extra(self) -> None: FILE: dinov2/data/datasets/image_net_22k.py class _ClassEntry (line 27) | class _ClassEntry: class _Entry (line 33) | class _Entry: class _Split (line 40) | class _Split(Enum): method length (line 45) | def length(self) -> int: method entries_path (line 51) | def entries_path(self): function _get_tarball_path (line 55) | def _get_tarball_path(class_id: str) -> str: function _make_mmap_tarball (line 59) | def _make_mmap_tarball(tarballs_root: str, mmap_cache_size: int): class ImageNet22k (line 70) | class ImageNet22k(ExtendedVisionDataset): method __init__ (line 101) | def __init__( method _get_entries_path (line 123) | def _get_entries_path(self, root: Optional[str] = None) -> str: method _get_class_ids_path (line 126) | def _get_class_ids_path(self, root: Optional[str] = None) -> str: method _find_class_ids (line 129) | def _find_class_ids(self, path: str) -> List[str]: method _load_entries_class_ids (line 141) | def _load_entries_class_ids(self, root: Optional[str] = None) -> Tuple... method _load_extra (line 185) | def _load_extra(self, extra_path: str) -> np.ndarray: method _save_extra (line 190) | def _save_extra(self, extra_array: np.ndarray, extra_path: str) -> None: method _tarballs_root (line 197) | def _tarballs_root(self) -> str: method find_class_id (line 200) | def find_class_id(self, class_index: int) -> str: method get_image_data (line 203) | def get_image_data(self, index: int) -> bytes: method get_target (line 222) | def get_target(self, index: int) -> Any: method get_targets (line 225) | def get_targets(self) -> np.ndarray: method get_class_id (line 228) | def get_class_id(self, index: int) -> str: method get_class_ids (line 231) | def get_class_ids(self) -> np.ndarray: method __getitem__ (line 234) | def __getitem__(self, index: int) -> Tuple[Any, Any]: method __len__ (line 239) | def __len__(self) -> int: method _dump_entries (line 242) | def _dump_entries(self, *args, **kwargs) -> None: method _dump_class_ids (line 280) | def _dump_class_ids(self, *args, **kwargs) -> None: method _dump_extra (line 297) | def _dump_extra(self, *args, **kwargs) -> None: method dump_extra (line 301) | def dump_extra(self, root: Optional[str] = None) -> None: FILE: dinov2/data/loaders.py class SamplerType (line 20) | class SamplerType(Enum): function _make_bool_str (line 28) | def _make_bool_str(b: bool) -> str: function _make_sample_transform (line 32) | def _make_sample_transform(image_transform: Optional[Callable] = None, t... function _parse_dataset_str (line 44) | def _parse_dataset_str(dataset_str: str): function make_dataset (line 77) | def make_dataset( function _make_sampler (line 110) | def _make_sampler( function make_data_loader (line 176) | def make_data_loader( FILE: dinov2/data/masking.py class MaskingGenerator (line 11) | class MaskingGenerator: method __init__ (line 12) | def __init__( method __repr__ (line 34) | def __repr__(self): method get_shape (line 46) | def get_shape(self): method _mask (line 49) | def _mask(self, mask, max_mask_patches): method __call__ (line 73) | def __call__(self, num_masking_patches=0): FILE: dinov2/data/samplers.py class EpochSampler (line 17) | class EpochSampler(Sampler): method __init__ (line 18) | def __init__( method __iter__ (line 36) | def __iter__(self): method __len__ (line 48) | def __len__(self): method set_epoch (line 51) | def set_epoch(self, epoch): function _get_numpy_dtype (line 55) | def _get_numpy_dtype(size: int) -> Any: function _get_torch_dtype (line 59) | def _get_torch_dtype(size: int) -> Any: function _generate_randperm_indices (line 63) | def _generate_randperm_indices(*, size: int, generator: torch.Generator): class InfiniteSampler (line 78) | class InfiniteSampler(Sampler): method __init__ (line 79) | def __init__( method __iter__ (line 96) | def __iter__(self): method _iterator (line 104) | def _iterator(self): method _shuffled_iterator (line 111) | def _shuffled_iterator(self): function _shuffle_tensor_slice (line 125) | def _shuffle_tensor_slice( function _new_shuffle_tensor_slice (line 146) | def _new_shuffle_tensor_slice( function _make_seed (line 160) | def _make_seed(seed: int, start: int, iter_count: int) -> int: class ShardedInfiniteSampler (line 165) | class ShardedInfiniteSampler(Sampler): method __init__ (line 166) | def __init__( method __iter__ (line 188) | def __iter__(self): method _iterator (line 201) | def _iterator(self): method _shuffled_iterator (line 208) | def _shuffled_iterator(self): FILE: dinov2/data/transforms.py class GaussianBlur (line 12) | class GaussianBlur(transforms.RandomApply): method __init__ (line 17) | def __init__(self, *, p: float = 0.5, radius_min: float = 0.1, radius_... class MaybeToTensor (line 24) | class MaybeToTensor(transforms.ToTensor): method __call__ (line 29) | def __call__(self, pic): function make_normalize_transform (line 46) | def make_normalize_transform( function make_classification_train_transform (line 55) | def make_classification_train_transform( function make_classification_eval_transform (line 77) | def make_classification_eval_transform( FILE: dinov2/distributed/__init__.py function is_enabled (line 19) | def is_enabled() -> bool: function get_global_size (line 27) | def get_global_size() -> int: function get_global_rank (line 35) | def get_global_rank() -> int: function get_local_rank (line 43) | def get_local_rank() -> int: function get_local_size (line 54) | def get_local_size() -> int: function is_main_process (line 66) | def is_main_process() -> bool: function _restrict_print_to_main_process (line 74) | def _restrict_print_to_main_process() -> None: function _get_master_port (line 90) | def _get_master_port(seed: int = 0) -> int: function _get_available_port (line 101) | def _get_available_port() -> int: function _collect_env_vars (line 120) | def _collect_env_vars() -> Dict[str, str]: function _is_slurm_job_process (line 124) | def _is_slurm_job_process() -> bool: function _parse_slurm_node_list (line 128) | def _parse_slurm_node_list(s: str) -> List[str]: function _check_env_variable (line 145) | def _check_env_variable(key: str, new_value: str): class _TorchDistributedEnvironment (line 151) | class _TorchDistributedEnvironment: method __init__ (line 152) | def __init__(self): method _set_from_slurm_env (line 181) | def _set_from_slurm_env(self): method _set_from_preset_env (line 198) | def _set_from_preset_env(self): method _set_from_local (line 210) | def _set_from_local(self): method export (line 219) | def export(self, *, overwrite: bool) -> "_TorchDistributedEnvironment": function enable (line 239) | def enable(*, set_cuda_current_device: bool = True, overwrite: bool = Fa... FILE: dinov2/eval/cell_dino/knn.py function get_args_parser (line 47) | def get_args_parser( class SequentialWithKwargs (line 148) | class SequentialWithKwargs(torch.nn.Sequential): method __init__ (line 149) | def __init__(self, *args): method forward (line 152) | def forward(self, input, **kwargs): function create_train_test_dataset_dict_leave_one_out (line 160) | def create_train_test_dataset_dict_leave_one_out( function eval_knn_with_leave_one_out (line 185) | def eval_knn_with_leave_one_out( function eval_knn_with_model (line 290) | def eval_knn_with_model( function eval_knn (line 372) | def eval_knn( function main (line 452) | def main(args): FILE: dinov2/eval/cell_dino/linear.py function get_args_parser (line 63) | def get_args_parser( function has_ddp_wrapper (line 239) | def has_ddp_wrapper(m: nn.Module) -> bool: function remove_ddp_wrapper (line 243) | def remove_ddp_wrapper(m: nn.Module) -> nn.Module: function create_linear_input (line 247) | def create_linear_input(x_tokens_list, use_n_blocks, use_avgpool, bag_of... class LinearClassifier (line 273) | class LinearClassifier(nn.Module): method __init__ (line 276) | def __init__( method forward (line 290) | def forward(self, x_tokens_list): class AllClassifiers (line 297) | class AllClassifiers(nn.Module): method __init__ (line 298) | def __init__(self, classifiers_dict): method forward (line 303) | def forward(self, inputs): method __len__ (line 306) | def __len__(self): class LinearPostprocessor (line 310) | class LinearPostprocessor(nn.Module): method __init__ (line 311) | def __init__(self, linear_classifier, class_mapping=None): method forward (line 316) | def forward(self, samples, targets): function scale_lr (line 324) | def scale_lr(learning_rates, batch_size): function setup_linear_classifiers (line 328) | def setup_linear_classifiers( function make_eval_data_loader (line 371) | def make_eval_data_loader( class Evaluator (line 411) | class Evaluator: method __post_init__ (line 422) | def __post_init__(self): method _evaluate_linear_classifiers (line 436) | def _evaluate_linear_classifiers( method evaluate_and_maybe_save (line 498) | def evaluate_and_maybe_save( function make_evaluators (line 531) | def make_evaluators( class SchedulerType (line 570) | class SchedulerType(Enum): method get_scheduler (line 574) | def get_scheduler(self, optimizer, optim_param_groups, epoch_length, e... function setup_linear_training (line 586) | def setup_linear_training( function train_linear_classifiers (line 646) | def train_linear_classifiers( function eval_linear_with_model (line 749) | def eval_linear_with_model( function main (line 1011) | def main(args): FILE: dinov2/eval/cell_dino/utils.py class LossType (line 26) | class LossType(Enum): class BagOfChannelsModelWithNormalize (line 31) | class BagOfChannelsModelWithNormalize(nn.Module): method __init__ (line 32) | def __init__(self, model, autocast_ctx, avgpool, n_last_blocks=1): method forward (line 39) | def forward(self, samples): function evaluate_with_accumulate (line 47) | def evaluate_with_accumulate( function all_gather_and_flatten (line 118) | def all_gather_and_flatten(tensor_rank): function extract_features_cell_dino (line 130) | def extract_features_cell_dino( function extract_features_with_dataloader_cell_dino (line 147) | def extract_features_with_dataloader_cell_dino(model, data_loader, sampl... function create_linear_input (line 187) | def create_linear_input(x_tokens_list, avgpool=False, use_n_blocks=1): function get_target_transform (line 207) | def get_target_transform(dataset) -> Optional[Callable]: function get_labels (line 217) | def get_labels(dataset) -> torch.Tensor: function get_num_classes (line 239) | def get_num_classes(dataset) -> int: function average_metrics (line 249) | def average_metrics(eval_metrics_dict: dict[Any, dict[str, torch.Tensor]... function create_class_indices_mapping (line 265) | def create_class_indices_mapping(labels: torch.Tensor) -> dict[int, torc... function _shuffle_dataset (line 282) | def _shuffle_dataset(dataset: torch.Tensor, seed: int = 0): function _subset_dataset_per_class (line 292) | def _subset_dataset_per_class( function _multilabel_rebalance_subset (line 318) | def _multilabel_rebalance_subset( function split_train_val_datasets (line 351) | def split_train_val_datasets(train_dataset, split_percentage: float = 0.... function create_train_dataset_dict (line 374) | def create_train_dataset_dict( function extract_features_for_dataset_dict (line 421) | def extract_features_for_dataset_dict( function pad_multilabel_and_collate (line 441) | def pad_multilabel_and_collate(batch, pad_value=-1): class KnnModule (line 455) | class KnnModule(torch.nn.Module): method __init__ (line 465) | def __init__(self, train_features, train_labels, nb_knn, T, device, nu... method _get_knn_sims_and_labels (line 480) | def _get_knn_sims_and_labels(self, similarity, train_labels): method _similarity_for_rank (line 487) | def _similarity_for_rank(self, features_rank, source_rank): method _gather_all_knn_for_rank (line 502) | def _gather_all_knn_for_rank(self, topk_sims, neighbors_labels, target... method compute_neighbors (line 520) | def compute_neighbors(self, features_rank): method forward (line 528) | def forward(self, features_rank): FILE: dinov2/eval/depth/models/backbones/vision_transformer.py class DinoVisionTransformer (line 12) | class DinoVisionTransformer(BaseModule): method __init__ (line 15) | def __init__(self, *args, **kwargs): FILE: dinov2/eval/depth/models/builder.py function build_backbone (line 23) | def build_backbone(cfg): function build_neck (line 28) | def build_neck(cfg): function build_head (line 33) | def build_head(cfg): function build_loss (line 38) | def build_loss(cfg): function build_depther (line 43) | def build_depther(cfg, train_cfg=None, test_cfg=None): FILE: dinov2/eval/depth/models/decode_heads/decode_head.py class DepthBaseDecodeHead (line 19) | class DepthBaseDecodeHead(BaseModule, metaclass=ABCMeta): method __init__ (line 52) | def __init__( method extra_repr (line 105) | def extra_repr(self): method forward (line 112) | def forward(self, inputs, img_metas): method forward_train (line 116) | def forward_train(self, img, inputs, img_metas, depth_gt, train_cfg): method forward_test (line 139) | def forward_test(self, inputs, img_metas, test_cfg): method depth_pred (line 155) | def depth_pred(self, feat): method losses (line 187) | def losses(self, depth_pred, depth_gt): method log_images (line 204) | def log_images(self, img_path, depth_pred, depth_gt, img_meta): FILE: dinov2/eval/depth/models/decode_heads/dpt_head.py class Interpolate (line 18) | class Interpolate(nn.Module): method __init__ (line 19) | def __init__(self, scale_factor, mode, align_corners=False): method forward (line 26) | def forward(self, x): class HeadDepth (line 31) | class HeadDepth(nn.Module): method __init__ (line 32) | def __init__(self, features): method forward (line 42) | def forward(self, x): class ReassembleBlocks (line 47) | class ReassembleBlocks(BaseModule): method __init__ (line 59) | def __init__( method forward (line 101) | def forward(self, inputs): class PreActResidualConvUnit (line 124) | class PreActResidualConvUnit(BaseModule): method __init__ (line 135) | def __init__(self, in_channels, act_cfg, norm_cfg, stride=1, dilation=... method forward (line 162) | def forward(self, inputs): class FeatureFusionBlock (line 169) | class FeatureFusionBlock(BaseModule): method __init__ (line 182) | def __init__(self, in_channels, act_cfg, norm_cfg, expand=False, align... method forward (line 198) | def forward(self, *inputs): class DPTHead (line 213) | class DPTHead(DepthBaseDecodeHead): method __init__ (line 227) | def __init__( method forward (line 260) | def forward(self, inputs, img_metas): FILE: dinov2/eval/depth/models/decode_heads/linear_head.py class BNHead (line 15) | class BNHead(DepthBaseDecodeHead): method __init__ (line 18) | def __init__(self, input_transform="resize_concat", in_index=(0, 1, 2,... method _transform_inputs (line 29) | def _transform_inputs(self, inputs): method _forward_feature (line 57) | def _forward_feature(self, inputs, img_metas=None, **kwargs): method forward (line 84) | def forward(self, inputs, img_metas=None, **kwargs): FILE: dinov2/eval/depth/models/depther/base.py class BaseDepther (line 14) | class BaseDepther(BaseModule, metaclass=ABCMeta): method __init__ (line 17) | def __init__(self, init_cfg=None): method with_neck (line 22) | def with_neck(self): method with_auxiliary_head (line 27) | def with_auxiliary_head(self): method with_decode_head (line 32) | def with_decode_head(self): method extract_feat (line 37) | def extract_feat(self, imgs): method encode_decode (line 42) | def encode_decode(self, img, img_metas): method forward_train (line 48) | def forward_train(self, imgs, img_metas, **kwargs): method simple_test (line 53) | def simple_test(self, img, img_meta, **kwargs): method aug_test (line 58) | def aug_test(self, imgs, img_metas, **kwargs): method forward_test (line 62) | def forward_test(self, imgs, img_metas, **kwargs): method forward (line 94) | def forward(self, img, img_metas, return_loss=True, **kwargs): method train_step (line 109) | def train_step(self, data_batch, optimizer, **kwargs): method val_step (line 152) | def val_step(self, data_batch, **kwargs): method _parse_losses (line 163) | def _parse_losses(losses): FILE: dinov2/eval/depth/models/depther/encoder_decoder.py function add_prefix (line 15) | def add_prefix(inputs, prefix): class DepthEncoderDecoder (line 35) | class DepthEncoderDecoder(BaseDepther): method __init__ (line 41) | def __init__(self, backbone, decode_head, neck=None, train_cfg=None, t... method _init_decode_head (line 57) | def _init_decode_head(self, decode_head): method extract_feat (line 62) | def extract_feat(self, img): method encode_decode (line 69) | def encode_decode(self, img, img_metas, rescale=True, size=None): method _decode_head_forward_train (line 85) | def _decode_head_forward_train(self, img, x, img_metas, depth_gt, **kw... method _decode_head_forward_test (line 93) | def _decode_head_forward_test(self, x, img_metas): method forward_dummy (line 99) | def forward_dummy(self, img): method forward_train (line 105) | def forward_train(self, img, img_metas, depth_gt, **kwargs): method whole_inference (line 133) | def whole_inference(self, img, img_meta, rescale, size=None): method slide_inference (line 139) | def slide_inference(self, img, img_meta, rescale): method inference (line 173) | def inference(self, img, img_meta, rescale, size=None): method simple_test (line 208) | def simple_test(self, img, img_meta, rescale=True): method aug_test (line 220) | def aug_test(self, imgs, img_metas, rescale=True): FILE: dinov2/eval/depth/models/losses/gradientloss.py class GradientLoss (line 13) | class GradientLoss(nn.Module): method __init__ (line 24) | def __init__(self, valid_mask=True, loss_weight=1.0, max_depth=None, l... method gradientloss (line 33) | def gradientloss(self, input, target): method forward (line 65) | def forward(self, depth_pred, depth_gt): FILE: dinov2/eval/depth/models/losses/sigloss.py class SigLoss (line 13) | class SigLoss(nn.Module): method __init__ (line 26) | def __init__( method sigloss (line 42) | def sigloss(self, input, target): method forward (line 61) | def forward(self, depth_pred, depth_gt): FILE: dinov2/eval/depth/ops/wrappers.py function resize (line 11) | def resize(input, size=None, scale_factor=None, mode="nearest", align_co... FILE: dinov2/eval/knn.py function get_args_parser (line 29) | def get_args_parser( class KnnModule (line 99) | class KnnModule(torch.nn.Module): method __init__ (line 109) | def __init__(self, train_features, train_labels, nb_knn, T, device, nu... method _get_knn_sims_and_labels (line 124) | def _get_knn_sims_and_labels(self, similarity, train_labels): method _similarity_for_rank (line 129) | def _similarity_for_rank(self, features_rank, source_rank): method _gather_all_knn_for_rank (line 144) | def _gather_all_knn_for_rank(self, topk_sims, neighbors_labels, target... method compute_neighbors (line 162) | def compute_neighbors(self, features_rank): method forward (line 170) | def forward(self, features_rank): class DictKeysModule (line 187) | class DictKeysModule(torch.nn.Module): method __init__ (line 188) | def __init__(self, keys): method forward (line 192) | def forward(self, features_dict, targets): function create_module_dict (line 198) | def create_module_dict(*, module, n_per_class_list, n_tries, nb_knn, tra... function filter_train (line 225) | def filter_train(mapping, n_per_class, seed): function create_class_indices_mapping (line 234) | def create_class_indices_mapping(labels): class ModuleDictWithForward (line 240) | class ModuleDictWithForward(torch.nn.ModuleDict): method forward (line 241) | def forward(self, *args, **kwargs): function eval_knn (line 245) | def eval_knn( function eval_knn_with_model (line 318) | def eval_knn_with_model( function main (line 379) | def main(args): FILE: dinov2/eval/linear.py function get_args_parser (line 33) | def get_args_parser( function has_ddp_wrapper (line 155) | def has_ddp_wrapper(m: nn.Module) -> bool: function remove_ddp_wrapper (line 159) | def remove_ddp_wrapper(m: nn.Module) -> nn.Module: function _pad_and_collate (line 163) | def _pad_and_collate(batch): function create_linear_input (line 171) | def create_linear_input(x_tokens_list, use_n_blocks, use_avgpool): class LinearClassifier (line 186) | class LinearClassifier(nn.Module): method __init__ (line 189) | def __init__(self, out_dim, use_n_blocks, use_avgpool, num_classes=1000): method forward (line 199) | def forward(self, x_tokens_list): class AllClassifiers (line 204) | class AllClassifiers(nn.Module): method __init__ (line 205) | def __init__(self, classifiers_dict): method forward (line 210) | def forward(self, inputs): method __len__ (line 213) | def __len__(self): class LinearPostprocessor (line 217) | class LinearPostprocessor(nn.Module): method __init__ (line 218) | def __init__(self, linear_classifier, class_mapping=None): method forward (line 223) | def forward(self, samples, targets): function scale_lr (line 231) | def scale_lr(learning_rates, batch_size): function setup_linear_classifiers (line 235) | def setup_linear_classifiers(sample_output, n_last_blocks_list, learning... function evaluate_linear_classifiers (line 260) | def evaluate_linear_classifiers( function eval_linear (line 313) | def eval_linear( function make_eval_data_loader (line 411) | def make_eval_data_loader(test_dataset_str, batch_size, num_workers, met... function test_on_datasets (line 429) | def test_on_datasets( function run_eval_linear (line 463) | def run_eval_linear( function main (line 595) | def main(args): FILE: dinov2/eval/log_regression.py function get_args_parser (line 38) | def get_args_parser( class LogRegModule (line 109) | class LogRegModule(nn.Module): method __init__ (line 110) | def __init__( method forward (line 129) | def forward(self, samples, targets): method fit (line 137) | def fit(self, train_features, train_labels): function evaluate_model (line 147) | def evaluate_model(*, logreg_model, logreg_metric, test_data_loader, dev... function train_for_C (line 153) | def train_for_C(*, C, max_iter, train_features, train_labels, dtype=torc... function train_and_evaluate (line 159) | def train_and_evaluate( function sweep_C_values (line 187) | def sweep_C_values( function eval_log_regression (line 252) | def eval_log_regression( function eval_log_regression_with_model (line 362) | def eval_log_regression_with_model( function main (line 423) | def main(args): FILE: dinov2/eval/metrics.py class MetricType (line 20) | class MetricType(Enum): method accuracy_averaging (line 29) | def accuracy_averaging(self): method __str__ (line 32) | def __str__(self): class AccuracyAveraging (line 36) | class AccuracyAveraging(Enum): method __str__ (line 41) | def __str__(self): function build_metric (line 45) | def build_metric(metric_type: MetricType, *, num_classes: int, ks: Optio... function build_topk_accuracy_metric (line 65) | def build_topk_accuracy_metric(average_type: AccuracyAveraging, num_clas... function build_topk_imagenet_real_accuracy_metric (line 72) | def build_topk_imagenet_real_accuracy_metric(num_classes: int, ks: tuple... class ImageNetReaLAccuracy (line 77) | class ImageNetReaLAccuracy(Metric): method __init__ (line 82) | def __init__( method update (line 93) | def update(self, preds: Tensor, target: Tensor) -> None: # type: ignore method compute (line 117) | def compute(self) -> Tensor: FILE: dinov2/eval/segmentation/hooks/optimizer.py class DistOptimizerHook (line 15) | class DistOptimizerHook(OptimizerHook): method __init__ (line 18) | def __init__(self, update_interval=1, grad_clip=None, coalesce=True, b... method before_run (line 25) | def before_run(self, runner): method after_train_iter (line 28) | def after_train_iter(self, runner): FILE: dinov2/eval/segmentation/models/backbones/vision_transformer.py class DinoVisionTransformer (line 11) | class DinoVisionTransformer(BaseModule): method __init__ (line 14) | def __init__( FILE: dinov2/eval/segmentation/models/decode_heads/linear_head.py class BNHead (line 15) | class BNHead(BaseDecodeHead): method __init__ (line 18) | def __init__(self, resize_factors=None, **kwargs): method _forward_feature (line 24) | def _forward_feature(self, inputs): method _transform_inputs (line 42) | def _transform_inputs(self, inputs): method forward (line 86) | def forward(self, inputs): FILE: dinov2/eval/segmentation_m2f/core/anchor/builder.py function build_prior_generator (line 15) | def build_prior_generator(cfg, default_args=None): function build_anchor_generator (line 19) | def build_anchor_generator(cfg, default_args=None): FILE: dinov2/eval/segmentation_m2f/core/anchor/point_generator.py class MlvlPointGenerator (line 14) | class MlvlPointGenerator: method __init__ (line 25) | def __init__(self, strides, offset=0.5): method num_levels (line 30) | def num_levels(self): method num_base_priors (line 35) | def num_base_priors(self): method _meshgrid (line 40) | def _meshgrid(self, x, y, row_major=True): method grid_priors (line 50) | def grid_priors(self, featmap_sizes, dtype=torch.float32, device="cuda... method single_level_grid_priors (line 82) | def single_level_grid_priors(self, featmap_size, level_idx, dtype=torc... method valid_flags (line 130) | def valid_flags(self, featmap_sizes, pad_shape, device="cuda"): method single_level_valid_flags (line 156) | def single_level_valid_flags(self, featmap_size, valid_size, device="c... method sparse_priors (line 182) | def sparse_priors(self, prior_idxs, featmap_size, level_idx, dtype=tor... FILE: dinov2/eval/segmentation_m2f/core/box/builder.py function build_sampler (line 12) | def build_sampler(cfg, **default_args): function build_bbox_coder (line 17) | def build_bbox_coder(cfg, **default_args): FILE: dinov2/eval/segmentation_m2f/core/box/samplers/base_sampler.py class BaseSampler (line 13) | class BaseSampler(metaclass=ABCMeta): method __init__ (line 16) | def __init__(self, num, pos_fraction, neg_pos_ub=-1, add_gt_as_proposa... method _sample_pos (line 25) | def _sample_pos(self, assign_result, num_expected, **kwargs): method _sample_neg (line 30) | def _sample_neg(self, assign_result, num_expected, **kwargs): method sample (line 34) | def sample(self, assign_result, bboxes, gt_bboxes, gt_labels=None, **k... FILE: dinov2/eval/segmentation_m2f/core/box/samplers/mask_pseudo_sampler.py class MaskPseudoSampler (line 17) | class MaskPseudoSampler(BaseSampler): method __init__ (line 20) | def __init__(self, **kwargs): method _sample_pos (line 23) | def _sample_pos(self, **kwargs): method _sample_neg (line 27) | def _sample_neg(self, **kwargs): method sample (line 31) | def sample(self, assign_result, masks, gt_masks, **kwargs): FILE: dinov2/eval/segmentation_m2f/core/box/samplers/mask_sampling_result.py class MaskSamplingResult (line 14) | class MaskSamplingResult(SamplingResult): method __init__ (line 17) | def __init__(self, pos_inds, neg_inds, masks, gt_masks, assign_result,... method masks (line 40) | def masks(self): method __nice__ (line 44) | def __nice__(self): method info (line 53) | def info(self): FILE: dinov2/eval/segmentation_m2f/core/box/samplers/sampling_result.py class SamplingResult (line 9) | class SamplingResult: method __init__ (line 28) | def __init__(self, pos_inds, neg_inds, bboxes, gt_bboxes, assign_resul... method bboxes (line 54) | def bboxes(self): method to (line 58) | def to(self, device): method __nice__ (line 73) | def __nice__(self): method info (line 82) | def info(self): method random (line 95) | def random(cls, rng=None, **kwargs): FILE: dinov2/eval/segmentation_m2f/core/utils/dist_utils.py function reduce_mean (line 9) | def reduce_mean(tensor): FILE: dinov2/eval/segmentation_m2f/core/utils/misc.py function multi_apply (line 9) | def multi_apply(func, *args, **kwargs): function add_prefix (line 31) | def add_prefix(inputs, prefix): FILE: dinov2/eval/segmentation_m2f/models/backbones/adapter_modules.py function get_reference_points (line 16) | def get_reference_points(spatial_shapes, device): function deform_inputs (line 32) | def deform_inputs(x, patch_size): class ConvFFN (line 49) | class ConvFFN(nn.Module): method __init__ (line 50) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 60) | def forward(self, x, H, W): class DWConv (line 70) | class DWConv(nn.Module): method __init__ (line 71) | def __init__(self, dim=768): method forward (line 75) | def forward(self, x, H, W): class Extractor (line 88) | class Extractor(nn.Module): method __init__ (line 89) | def __init__( method forward (line 116) | def forward(self, query, reference_points, feat, spatial_shapes, level... class Injector (line 136) | class Injector(nn.Module): method __init__ (line 137) | def __init__( method forward (line 157) | def forward(self, query, reference_points, feat, spatial_shapes, level... class InteractionBlock (line 173) | class InteractionBlock(nn.Module): method __init__ (line 174) | def __init__( method forward (line 235) | def forward(self, x, c, blocks, deform_inputs1, deform_inputs2, H_c, W... class InteractionBlockWithCls (line 268) | class InteractionBlockWithCls(nn.Module): method __init__ (line 269) | def __init__( method forward (line 330) | def forward(self, x, c, cls, blocks, deform_inputs1, deform_inputs2, H... class SpatialPriorModule (line 374) | class SpatialPriorModule(nn.Module): method __init__ (line 375) | def __init__(self, inplanes=64, embed_dim=384, with_cp=False): method forward (line 419) | def forward(self, x): FILE: dinov2/eval/segmentation_m2f/models/backbones/drop_path.py function drop_path (line 13) | def drop_path(x, drop_prob: float = 0.0, training: bool = False): class DropPath (line 24) | class DropPath(nn.Module): method __init__ (line 27) | def __init__(self, drop_prob: float = 0.0): method forward (line 31) | def forward(self, x): FILE: dinov2/eval/segmentation_m2f/models/backbones/vit.py function to_2tuple (line 48) | def to_2tuple(x): class Mlp (line 52) | class Mlp(nn.Module): method __init__ (line 53) | def __init__( method forward (line 70) | def forward(self, x: Tensor) -> Tensor: class SwiGLUFFN (line 79) | class SwiGLUFFN(nn.Module): method __init__ (line 80) | def __init__( method forward (line 98) | def forward(self, x: Tensor) -> Tensor: class PatchEmbed (line 105) | class PatchEmbed(nn.Module): method __init__ (line 108) | def __init__( method forward (line 123) | def forward(self, x): class Attention (line 132) | class Attention(nn.Module): method __init__ (line 133) | def __init__(self, dim, num_heads=8, qkv_bias=False, attn_drop=0.0, pr... method forward (line 144) | def forward(self, x, H, W): class MemEffAttention (line 159) | class MemEffAttention(nn.Module): method __init__ (line 160) | def __init__( method forward (line 178) | def forward(self, x: Tensor, H, W) -> Tensor: function window_partition (line 194) | def window_partition(x, window_size): function window_reverse (line 208) | def window_reverse(windows, window_size, H, W): class WindowedAttention (line 224) | class WindowedAttention(nn.Module): method __init__ (line 225) | def __init__( method forward (line 240) | def forward(self, x, H, W): class Block (line 319) | class Block(nn.Module): method __init__ (line 320) | def __init__( method forward (line 368) | def forward(self, x, H, W): class TIMMVisionTransformer (line 386) | class TIMMVisionTransformer(BaseModule): method __init__ (line 396) | def __init__( method init_weights (line 503) | def init_weights(self, pretrained=None): method forward_features (line 508) | def forward_features(self, x): method forward (line 522) | def forward(self, x): method resize_pos_embed (line 527) | def resize_pos_embed(pos_embed, input_shpae, pos_shape, mode): FILE: dinov2/eval/segmentation_m2f/models/backbones/vit_adapter.py class ViTAdapter (line 20) | class ViTAdapter(TIMMVisionTransformer): method __init__ (line 21) | def __init__( method _init_weights (line 92) | def _init_weights(self, m): method _get_pos_embed (line 107) | def _get_pos_embed(self, pos_embed, H, W): method _init_deform_weights (line 118) | def _init_deform_weights(self, m): method _add_level_embed (line 122) | def _add_level_embed(self, c2, c3, c4): method forward (line 128) | def forward(self, x): FILE: dinov2/eval/segmentation_m2f/models/builder.py function build_match_cost (line 13) | def build_match_cost(cfg): function build_assigner (line 18) | def build_assigner(cfg): function build_transformer (line 23) | def build_transformer(cfg): FILE: dinov2/eval/segmentation_m2f/models/decode_heads/mask2former_head.py class Mask2FormerHead (line 24) | class Mask2FormerHead(BaseDecodeHead): method __init__ (line 61) | def __init__( method init_weights (line 141) | def init_weights(self): method get_targets (line 152) | def get_targets(self, cls_scores_list, mask_preds_list, gt_labels_list... method _get_target_single (line 200) | def _get_target_single(self, cls_score, mask_pred, gt_labels, gt_masks... method loss_single (line 258) | def loss_single(self, cls_scores, mask_preds, gt_labels_list, gt_masks... method loss (line 342) | def loss(self, all_cls_scores, all_mask_preds, gt_labels_list, gt_mask... method forward_head (line 383) | def forward_head(self, decoder_out, mask_feature, attn_mask_target_size): method forward (line 420) | def forward(self, feats, img_metas): method forward_train (line 494) | def forward_train(self, x, img_metas, gt_semantic_seg, gt_labels, gt_m... method forward_test (line 522) | def forward_test(self, inputs, img_metas, test_cfg): FILE: dinov2/eval/segmentation_m2f/models/losses/cross_entropy_loss.py function cross_entropy (line 15) | def cross_entropy( function _expand_onehot_labels (line 65) | def _expand_onehot_labels(labels, label_weights, target_shape, ignore_in... function binary_cross_entropy (line 88) | def binary_cross_entropy( function mask_cross_entropy (line 149) | def mask_cross_entropy( class CrossEntropyLoss (line 182) | class CrossEntropyLoss(nn.Module): method __init__ (line 203) | def __init__( method extra_repr (line 237) | def extra_repr(self): method forward (line 242) | def forward( method loss_name (line 267) | def loss_name(self): FILE: dinov2/eval/segmentation_m2f/models/losses/dice_loss.py function dice_loss (line 12) | def dice_loss(pred, target, weight=None, eps=1e-3, reduction="mean", avg... function naive_dice_loss (line 46) | def naive_dice_loss(pred, target, weight=None, eps=1e-3, reduction="mean... class DiceLoss (line 79) | class DiceLoss(nn.Module): method __init__ (line 80) | def __init__(self, use_sigmoid=True, activate=True, reduction="mean", ... method forward (line 116) | def forward(self, pred, target, weight=None, reduction_override=None, ... FILE: dinov2/eval/segmentation_m2f/models/losses/match_costs.py class ClassificationCost (line 13) | class ClassificationCost: method __init__ (line 33) | def __init__(self, weight=1.0): method __call__ (line 36) | def __call__(self, cls_pred, gt_labels): class DiceCost (line 56) | class DiceCost: method __init__ (line 66) | def __init__(self, weight=1.0, pred_act=False, eps=1e-3): method binary_mask_dice_loss (line 71) | def binary_mask_dice_loss(self, mask_preds, gt_masks): method __call__ (line 89) | def __call__(self, mask_preds, gt_masks): class CrossEntropyLossCost (line 105) | class CrossEntropyLossCost: method __init__ (line 114) | def __init__(self, weight=1.0, use_sigmoid=True): method _binary_cross_entropy (line 119) | def _binary_cross_entropy(self, cls_pred, gt_labels): method __call__ (line 139) | def __call__(self, cls_pred, gt_labels): FILE: dinov2/eval/segmentation_m2f/models/plugins/msdeformattn_pixel_decoder.py class MSDeformAttnPixelDecoder (line 18) | class MSDeformAttnPixelDecoder(BaseModule): method __init__ (line 42) | def __init__( method init_weights (line 124) | def init_weights(self): method forward (line 146) | def forward(self, feats): FILE: dinov2/eval/segmentation_m2f/models/segmentors/encoder_decoder_mask2former.py class EncoderDecoderMask2Former (line 17) | class EncoderDecoderMask2Former(BaseSegmentor): method __init__ (line 25) | def __init__( method _init_decode_head (line 53) | def _init_decode_head(self, decode_head): method _init_auxiliary_head (line 59) | def _init_auxiliary_head(self, auxiliary_head): method extract_feat (line 69) | def extract_feat(self, img): method encode_decode (line 76) | def encode_decode(self, img, img_metas): method _decode_head_forward_train (line 84) | def _decode_head_forward_train(self, x, img_metas, gt_semantic_seg, **... method _decode_head_forward_test (line 93) | def _decode_head_forward_test(self, x, img_metas): method _auxiliary_head_forward_train (line 99) | def _auxiliary_head_forward_train(self, x, img_metas, gt_semantic_seg): method forward_dummy (line 113) | def forward_dummy(self, img): method forward_train (line 119) | def forward_train(self, img, img_metas, gt_semantic_seg, **kwargs): method slide_inference (line 149) | def slide_inference(self, img, img_meta, rescale): method whole_inference (line 192) | def whole_inference(self, img, img_meta, rescale): method inference (line 206) | def inference(self, img, img_meta, rescale): method simple_test (line 241) | def simple_test(self, img, img_meta, rescale=True): method aug_test (line 254) | def aug_test(self, imgs, img_metas, rescale=True): FILE: dinov2/eval/segmentation_m2f/models/utils/assigner.py class AssignResult (line 18) | class AssignResult(metaclass=ABCMeta): method __init__ (line 21) | def __init__(self, num_gts, gt_inds, labels): method info (line 27) | def info(self): class BaseAssigner (line 36) | class BaseAssigner(metaclass=ABCMeta): method assign (line 40) | def assign(self, masks, gt_masks, gt_masks_ignore=None, gt_labels=None): class MaskHungarianAssigner (line 46) | class MaskHungarianAssigner(BaseAssigner): method __init__ (line 67) | def __init__( method assign (line 77) | def assign(self, cls_pred, mask_pred, gt_labels, gt_masks, img_meta, g... FILE: dinov2/eval/segmentation_m2f/models/utils/point_sample.py function get_uncertainty (line 10) | def get_uncertainty(mask_pred, labels): function get_uncertain_point_coords_with_randomness (line 36) | def get_uncertain_point_coords_with_randomness( FILE: dinov2/eval/segmentation_m2f/models/utils/positional_encoding.py class SinePositionalEncoding (line 15) | class SinePositionalEncoding(BaseModule): method __init__ (line 40) | def __init__( method forward (line 55) | def forward(self, mask): method __repr__ (line 87) | def __repr__(self): class LearnedPositionalEncoding (line 99) | class LearnedPositionalEncoding(BaseModule): method __init__ (line 113) | def __init__(self, num_feats, row_num_embed=50, col_num_embed=50, init... method forward (line 121) | def forward(self, mask): method __repr__ (line 146) | def __repr__(self): FILE: dinov2/eval/segmentation_m2f/models/utils/transformer.py class AdaptivePadding (line 35) | class AdaptivePadding(nn.Module): method __init__ (line 66) | def __init__(self, kernel_size=1, stride=1, dilation=1, padding="corne... method get_pad_shape (line 82) | def get_pad_shape(self, input_shape): method forward (line 92) | def forward(self, x): class PatchMerging (line 102) | class PatchMerging(BaseModule): method __init__ (line 133) | def __init__( method forward (line 178) | def forward(self, x, input_size): function inverse_sigmoid (line 223) | def inverse_sigmoid(x, eps=1e-5): class FFN (line 243) | class FFN(BaseModule): method __init__ (line 265) | def __init__( method forward (line 298) | def forward(self, x, identity=None): class DetrTransformerDecoderLayer (line 316) | class DetrTransformerDecoderLayer(BaseTransformerLayer): method __init__ (line 338) | def __init__( class DetrTransformerEncoder (line 364) | class DetrTransformerEncoder(TransformerLayerSequence): method __init__ (line 372) | def __init__(self, *args, post_norm_cfg=dict(type="LN"), **kwargs): method forward (line 380) | def forward(self, *args, **kwargs): class DetrTransformerDecoder (line 393) | class DetrTransformerDecoder(TransformerLayerSequence): method __init__ (line 402) | def __init__(self, *args, post_norm_cfg=dict(type="LN"), return_interm... method forward (line 411) | def forward(self, query, *args, **kwargs): class Transformer (line 441) | class Transformer(BaseModule): method __init__ (line 463) | def __init__(self, encoder=None, decoder=None, init_cfg=None): method init_weights (line 469) | def init_weights(self): method forward (line 476) | def forward(self, x, mask, query_embed, pos_embed): class DeformableDetrTransformerDecoder (line 517) | class DeformableDetrTransformerDecoder(TransformerLayerSequence): method __init__ (line 526) | def __init__(self, *args, return_intermediate=False, **kwargs): method forward (line 531) | def forward(self, query, *args, reference_points=None, valid_ratios=No... class DeformableDetrTransformer (line 592) | class DeformableDetrTransformer(Transformer): method __init__ (line 604) | def __init__(self, as_two_stage=False, num_feature_levels=4, two_stage... method init_layers (line 612) | def init_layers(self): method init_weights (line 624) | def init_weights(self): method gen_encoder_output_proposals (line 636) | def gen_encoder_output_proposals(self, memory, memory_padding_mask, sp... method get_reference_points (line 694) | def get_reference_points(spatial_shapes, valid_ratios, device): method get_valid_ratio (line 724) | def get_valid_ratio(self, mask): method get_proposal_pos_embed (line 734) | def get_proposal_pos_embed(self, proposals, num_pos_feats=128, tempera... method forward (line 747) | def forward( class DynamicConv (line 886) | class DynamicConv(BaseModule): method __init__ (line 913) | def __init__( method forward (line 948) | def forward(self, param_feature, input_feature): FILE: dinov2/eval/segmentation_m2f/ops/modules/ms_deform_attn.py class MSDeformAttnFunction (line 17) | class MSDeformAttnFunction(Function): method forward (line 20) | def forward( function ms_deform_attn_core_pytorch (line 33) | def ms_deform_attn_core_pytorch(value, value_spatial_shapes, sampling_lo... function _is_power_of_2 (line 57) | def _is_power_of_2(n): class MSDeformAttn (line 63) | class MSDeformAttn(nn.Module): method __init__ (line 64) | def __init__(self, d_model=256, n_levels=4, n_heads=8, n_points=4, rat... method _reset_parameters (line 99) | def _reset_parameters(self): method forward (line 120) | def forward( FILE: dinov2/eval/setup.py function get_args_parser (line 17) | def get_args_parser( function get_autocast_dtype (line 52) | def get_autocast_dtype(config): function build_model_for_eval (line 62) | def build_model_for_eval(config, pretrained_weights): function setup_and_build_model (line 70) | def setup_and_build_model(args) -> Tuple[Any, torch.dtype]: FILE: dinov2/eval/utils.py class ModelWithNormalize (line 21) | class ModelWithNormalize(torch.nn.Module): method __init__ (line 22) | def __init__(self, model): method forward (line 26) | def forward(self, samples): class ModelWithIntermediateLayers (line 30) | class ModelWithIntermediateLayers(nn.Module): method __init__ (line 31) | def __init__(self, feature_model, n_last_blocks, autocast_ctx): method forward (line 38) | def forward(self, images): function evaluate (line 48) | def evaluate( function all_gather_and_flatten (line 86) | def all_gather_and_flatten(tensor_rank): function extract_features (line 98) | def extract_features(model, dataset, batch_size, num_workers, gather_on_... function extract_features_with_dataloader (line 113) | def extract_features_with_dataloader(model, data_loader, sample_count, g... FILE: dinov2/fsdp/__init__.py function get_fsdp_wrapper (line 22) | def get_fsdp_wrapper(model_cfg, modules_to_wrap=set()): function is_fsdp (line 57) | def is_fsdp(x): function is_sharded_fsdp (line 61) | def is_sharded_fsdp(x): function free_if_fsdp (line 65) | def free_if_fsdp(x): function get_fsdp_modules (line 72) | def get_fsdp_modules(x): function reshard_fsdp_model (line 76) | def reshard_fsdp_model(x): function rankstr (line 81) | def rankstr(): class FSDPCheckpointer (line 85) | class FSDPCheckpointer(Checkpointer): method save (line 86) | def save(self, name: str, **kwargs: Any) -> None: method load (line 114) | def load(self, *args, **kwargs): method has_checkpoint (line 118) | def has_checkpoint(self) -> bool: method get_checkpoint_file (line 126) | def get_checkpoint_file(self) -> str: method tag_last_checkpoint (line 143) | def tag_last_checkpoint(self, last_filename_basename: str) -> None: FILE: dinov2/hub/backbones.py class Weights (line 16) | class Weights(Enum): function is_url (line 21) | def is_url(path: str) -> bool: function convert_path_or_url_to_url (line 26) | def convert_path_or_url_to_url(path: str) -> str: function _make_dinov2_model (line 32) | def _make_dinov2_model( function dinov2_vits14 (line 82) | def dinov2_vits14(*, pretrained: bool = True, weights: Union[Weights, st... function dinov2_vitb14 (line 89) | def dinov2_vitb14(*, pretrained: bool = True, weights: Union[Weights, st... function dinov2_vitl14 (line 96) | def dinov2_vitl14(*, pretrained: bool = True, weights: Union[Weights, st... function dinov2_vitg14 (line 103) | def dinov2_vitg14(*, pretrained: bool = True, weights: Union[Weights, st... function dinov2_vits14_reg (line 116) | def dinov2_vits14_reg(*, pretrained: bool = True, weights: Union[Weights... function dinov2_vitb14_reg (line 131) | def dinov2_vitb14_reg(*, pretrained: bool = True, weights: Union[Weights... function dinov2_vitl14_reg (line 146) | def dinov2_vitl14_reg(*, pretrained: bool = True, weights: Union[Weights... function dinov2_vitg14_reg (line 161) | def dinov2_vitg14_reg(*, pretrained: bool = True, weights: Union[Weights... FILE: dinov2/hub/cell_dino/backbones.py class Weights (line 12) | class Weights(Enum): function _make_cell_dino_model (line 16) | def _make_cell_dino_model( function cell_dino_hpa_vitl16 (line 67) | def cell_dino_hpa_vitl16( function cell_dino_hpa_vitl14 (line 96) | def cell_dino_hpa_vitl14( function cell_dino_cp_vits8 (line 125) | def cell_dino_cp_vits8( function channel_adaptive_dino_vitl16 (line 154) | def channel_adaptive_dino_vitl16( FILE: dinov2/hub/classifiers.py class Weights (line 16) | class Weights(Enum): function _make_dinov2_linear_classification_head (line 20) | def _make_dinov2_linear_classification_head( class _LinearClassifierWrapper (line 52) | class _LinearClassifierWrapper(nn.Module): method __init__ (line 53) | def __init__(self, *, backbone: nn.Module, linear_head: nn.Module, lay... method forward (line 59) | def forward(self, x): function _make_dinov2_linear_classifier (line 86) | def _make_dinov2_linear_classifier( function dinov2_vits14_lc (line 121) | def dinov2_vits14_lc( function dinov2_vitb14_lc (line 140) | def dinov2_vitb14_lc( function dinov2_vitl14_lc (line 159) | def dinov2_vitl14_lc( function dinov2_vitg14_lc (line 178) | def dinov2_vitg14_lc( function dinov2_vits14_reg_lc (line 198) | def dinov2_vits14_reg_lc( function dinov2_vitb14_reg_lc (line 216) | def dinov2_vitb14_reg_lc( function dinov2_vitl14_reg_lc (line 234) | def dinov2_vitl14_reg_lc( function dinov2_vitg14_reg_lc (line 252) | def dinov2_vitg14_reg_lc( FILE: dinov2/hub/depth/decode_heads.py function _imdenormalize (line 18) | def _imdenormalize(img, mean, std, to_bgr=True): class DepthBaseDecodeHead (line 29) | class DepthBaseDecodeHead(nn.Module): method __init__ (line 61) | def __init__( method forward (line 108) | def forward(self, inputs, img_metas): method forward_train (line 112) | def forward_train(self, img, inputs, img_metas, depth_gt): method forward_test (line 134) | def forward_test(self, inputs, img_metas): method depth_pred (line 149) | def depth_pred(self, feat): method losses (line 180) | def losses(self, depth_pred, depth_gt): method log_images (line 197) | def log_images(self, img_path, depth_pred, depth_gt, img_meta): class BNHead (line 223) | class BNHead(DepthBaseDecodeHead): method __init__ (line 226) | def __init__(self, input_transform="resize_concat", in_index=(0, 1, 2,... method _transform_inputs (line 237) | def _transform_inputs(self, inputs): method _forward_feature (line 265) | def _forward_feature(self, inputs, img_metas=None, **kwargs): method forward (line 292) | def forward(self, inputs, img_metas=None, **kwargs): class ConvModule (line 299) | class ConvModule(nn.Module): method __init__ (line 352) | def __init__( method norm (line 453) | def norm(self): method init_weights (line 459) | def init_weights(self): method forward (line 486) | def forward(self, x, activate=True, norm=True): class Interpolate (line 499) | class Interpolate(nn.Module): method __init__ (line 500) | def __init__(self, scale_factor, mode, align_corners=False): method forward (line 507) | def forward(self, x): class HeadDepth (line 512) | class HeadDepth(nn.Module): method __init__ (line 513) | def __init__(self, features): method forward (line 523) | def forward(self, x): class ReassembleBlocks (line 528) | class ReassembleBlocks(nn.Module): method __init__ (line 539) | def __init__(self, in_channels=768, out_channels=[96, 192, 384, 768], ... method forward (line 577) | def forward(self, inputs): class PreActResidualConvUnit (line 600) | class PreActResidualConvUnit(nn.Module): method __init__ (line 610) | def __init__(self, in_channels, act_layer, norm_layer, stride=1, dilat... method forward (line 637) | def forward(self, inputs): class FeatureFusionBlock (line 644) | class FeatureFusionBlock(nn.Module): method __init__ (line 656) | def __init__(self, in_channels, act_layer, norm_layer, expand=False, a... method forward (line 676) | def forward(self, *inputs): class DPTHead (line 690) | class DPTHead(DepthBaseDecodeHead): method __init__ (line 704) | def __init__( method forward (line 737) | def forward(self, inputs, img_metas): FILE: dinov2/hub/depth/encoder_decoder.py function add_prefix (line 15) | def add_prefix(inputs, prefix): class DepthEncoderDecoder (line 34) | class DepthEncoderDecoder(nn.Module): method __init__ (line 40) | def __init__(self, backbone, decode_head): method extract_feat (line 47) | def extract_feat(self, img): method encode_decode (line 51) | def encode_decode(self, img, img_metas, rescale=True, size=None): method _decode_head_forward_train (line 67) | def _decode_head_forward_train(self, img, x, img_metas, depth_gt, **kw... method _decode_head_forward_test (line 75) | def _decode_head_forward_test(self, x, img_metas): method forward_dummy (line 81) | def forward_dummy(self, img): method forward_train (line 87) | def forward_train(self, img, img_metas, depth_gt, **kwargs): method whole_inference (line 115) | def whole_inference(self, img, img_meta, rescale, size=None): method slide_inference (line 119) | def slide_inference(self, img, img_meta, rescale, stride, crop_size): method inference (line 153) | def inference(self, img, img_meta, rescale, size=None, mode="whole"): method simple_test (line 188) | def simple_test(self, img, img_meta, rescale=True): method aug_test (line 200) | def aug_test(self, imgs, img_metas, rescale=True): method forward_test (line 218) | def forward_test(self, imgs, img_metas, **kwargs): method forward (line 249) | def forward(self, img, img_metas, return_loss=True, **kwargs): method train_step (line 264) | def train_step(self, data_batch, optimizer, **kwargs): method val_step (line 307) | def val_step(self, data_batch, **kwargs): method _parse_losses (line 318) | def _parse_losses(losses): FILE: dinov2/hub/depth/ops.py function resize (line 11) | def resize(input, size=None, scale_factor=None, mode="nearest", align_co... FILE: dinov2/hub/depthers.py class Weights (line 17) | class Weights(Enum): function _get_depth_range (line 22) | def _get_depth_range(pretrained: bool, weights: Weights = Weights.NYU) -... function _make_dinov2_linear_depth_head (line 36) | def _make_dinov2_linear_depth_head( function _make_dinov2_linear_depther (line 70) | def _make_dinov2_linear_depther( function dinov2_vits14_ld (line 143) | def dinov2_vits14_ld(*, layers: int = 4, pretrained: bool = True, weight... function dinov2_vitb14_ld (line 149) | def dinov2_vitb14_ld(*, layers: int = 4, pretrained: bool = True, weight... function dinov2_vitl14_ld (line 155) | def dinov2_vitl14_ld(*, layers: int = 4, pretrained: bool = True, weight... function dinov2_vitg14_ld (line 161) | def dinov2_vitg14_ld(*, layers: int = 4, pretrained: bool = True, weight... function _make_dinov2_dpt_depth_head (line 167) | def _make_dinov2_dpt_depth_head(*, embed_dim: int, min_depth: float, max... function _make_dinov2_dpt_depther (line 180) | def _make_dinov2_dpt_depther( function dinov2_vits14_dd (line 231) | def dinov2_vits14_dd(*, pretrained: bool = True, weights: Union[Weights,... function dinov2_vitb14_dd (line 235) | def dinov2_vitb14_dd(*, pretrained: bool = True, weights: Union[Weights,... function dinov2_vitl14_dd (line 239) | def dinov2_vitl14_dd(*, pretrained: bool = True, weights: Union[Weights,... function dinov2_vitg14_dd (line 243) | def dinov2_vitg14_dd(*, pretrained: bool = True, weights: Union[Weights,... FILE: dinov2/hub/dinotxt.py function dinov2_vitl14_reg4_dinotxt_tet1280d20h24l (line 13) | def dinov2_vitl14_reg4_dinotxt_tet1280d20h24l(): function get_tokenizer (line 70) | def get_tokenizer(): FILE: dinov2/hub/text/dinotxt_model.py class DinoTxtConfig (line 19) | class DinoTxtConfig: class DinoTxt (line 42) | class DinoTxt(nn.Module): method __init__ (line 43) | def __init__( method init_weights (line 77) | def init_weights(self): method get_visual_class_and_patch_tokens (line 81) | def get_visual_class_and_patch_tokens(self, image: Tensor) -> Tuple[Te... method encode_image (line 84) | def encode_image( method encode_text (line 104) | def encode_text(self, text: Tensor, normalize: bool = False) -> Tensor: method get_logits (line 120) | def get_logits(self, image: Tensor, text: Tensor) -> Tuple[Tensor, Ten... method forward (line 127) | def forward( FILE: dinov2/hub/text/dinov2_wrapper.py class DINOv2Wrapper (line 11) | class DINOv2Wrapper(torch.nn.Module): method __init__ (line 12) | def __init__(self, model): method forward (line 20) | def forward(self, img, is_training: bool): method get_intermediate_layers (line 31) | def get_intermediate_layers( FILE: dinov2/hub/text/text_tower.py class TextHead (line 14) | class TextHead(nn.Module): method __init__ (line 15) | def __init__( method init_weights (line 45) | def init_weights(self): method forward (line 53) | def forward(self, text_tokens: Tensor) -> Tensor: class TextTower (line 60) | class TextTower(nn.Module): method __init__ (line 61) | def __init__( method init_weights (line 88) | def init_weights(self): method forward (line 92) | def forward(self, token_indices: Tensor) -> Tensor: FILE: dinov2/hub/text/text_transformer.py class TextTransformer (line 15) | class TextTransformer(nn.Module): method __init__ (line 16) | def __init__( method init_weights (line 55) | def init_weights(self): method forward (line 65) | def forward(self, token_indices: Tensor) -> Tuple[torch.Tensor, torch.... FILE: dinov2/hub/text/tokenizer.py class Tokenizer (line 13) | class Tokenizer(SimpleTokenizer): method __init__ (line 14) | def __init__(self, vocab_path: str): method tokenize (line 17) | def tokenize(self, texts: Union[str, List[str]], context_length: int =... FILE: dinov2/hub/text/vision_tower.py function init_weights_vit_timm (line 19) | def init_weights_vit_timm(module: nn.Module, name: str = ""): function named_apply (line 33) | def named_apply(fn: Callable, module: nn.Module, name="", depth_first=Tr... class VisionHead (line 50) | class VisionHead(nn.Module): method __init__ (line 51) | def __init__( method init_weights (line 85) | def init_weights(self): method forward (line 94) | def forward(self, image_tokens: Tensor) -> Tensor: class VisionTower (line 101) | class VisionTower(nn.Module): method __init__ (line 102) | def __init__( method init_weights (line 139) | def init_weights(self): method get_backbone_features (line 144) | def get_backbone_features(self, images: Tensor) -> Tuple[Tensor, Tenso... method get_class_and_patch_tokens (line 156) | def get_class_and_patch_tokens(self, images: Tensor) -> Tuple[Tensor, ... method forward (line 162) | def forward(self, images: Tensor) -> Tensor: FILE: dinov2/hub/utils.py function _make_dinov2_model_name (line 17) | def _make_dinov2_model_name(arch_name: str, patch_size: int, num_registe... class CenterPadding (line 23) | class CenterPadding(nn.Module): method __init__ (line 24) | def __init__(self, multiple): method _get_pad (line 28) | def _get_pad(self, size): method forward (line 36) | def forward(self, x): FILE: dinov2/hub/xray_dino/backbones.py function xray_dino_vitl16 (line 11) | def xray_dino_vitl16(*, pretrained: bool = True, weights: Union[Weights,... FILE: dinov2/layers/attention.py class Attention (line 36) | class Attention(nn.Module): method __init__ (line 37) | def __init__( method init_weights (line 57) | def init_weights( method forward (line 69) | def forward(self, x: Tensor, is_causal: bool = False) -> Tensor: class MemEffAttention (line 82) | class MemEffAttention(Attention): method forward (line 83) | def forward(self, x: Tensor, attn_bias=None) -> Tensor: FILE: dinov2/layers/block.py class Block (line 43) | class Block(nn.Module): method __init__ (line 44) | def __init__( method forward (line 89) | def forward(self, x: Tensor) -> Tensor: class CausalAttentionBlock (line 117) | class CausalAttentionBlock(nn.Module): method __init__ (line 118) | def __init__( method init_weights (line 148) | def init_weights( method forward (line 164) | def forward( function drop_add_residual_stochastic_depth (line 173) | def drop_add_residual_stochastic_depth( function get_branges_scales (line 197) | def get_branges_scales(x, sample_drop_ratio=0.0): function add_residual (line 205) | def add_residual(x, brange, residual, residual_scale_factor, scaling_vec... function get_attn_bias_and_cat (line 220) | def get_attn_bias_and_cat(x_list, branges=None): function drop_add_residual_stochastic_depth_list (line 244) | def drop_add_residual_stochastic_depth_list( class NestedTensorBlock (line 267) | class NestedTensorBlock(Block): method forward_nested (line 268) | def forward_nested(self, x_list: List[Tensor]) -> List[Tensor]: method forward (line 308) | def forward(self, x_or_x_list): FILE: dinov2/layers/dino_head.py class DINOHead (line 12) | class DINOHead(nn.Module): method __init__ (line 13) | def __init__( method _init_weights (line 30) | def _init_weights(self, m): method forward (line 36) | def forward(self, x): function _build_mlp (line 44) | def _build_mlp(nlayers, in_dim, bottleneck_dim, hidden_dim=None, use_bn=... FILE: dinov2/layers/drop_path.py function drop_path (line 14) | def drop_path(x, drop_prob: float = 0.0, training: bool = False): class DropPath (line 26) | class DropPath(nn.Module): method __init__ (line 29) | def __init__(self, drop_prob=None): method forward (line 33) | def forward(self, x): FILE: dinov2/layers/layer_scale.py class LayerScale (line 15) | class LayerScale(nn.Module): method __init__ (line 16) | def __init__( method reset_parameters (line 30) | def reset_parameters(self): method forward (line 33) | def forward(self, x: Tensor) -> Tensor: FILE: dinov2/layers/mlp.py class Mlp (line 16) | class Mlp(nn.Module): method __init__ (line 17) | def __init__( method forward (line 34) | def forward(self, x: Tensor) -> Tensor: FILE: dinov2/layers/patch_embed.py function make_2tuple (line 16) | def make_2tuple(x): class PatchEmbed (line 25) | class PatchEmbed(nn.Module): method __init__ (line 37) | def __init__( method forward (line 68) | def forward(self, x: Tensor) -> Tensor: method flops (line 83) | def flops(self) -> float: FILE: dinov2/layers/swiglu_ffn.py class SwiGLUFFN (line 14) | class SwiGLUFFN(nn.Module): method __init__ (line 15) | def __init__( method forward (line 30) | def forward(self, x: Tensor) -> Tensor: class SwiGLUFFNFused (line 54) | class SwiGLUFFNFused(SwiGLU): method __init__ (line 55) | def __init__( class SwiGLUFFNAligned (line 75) | class SwiGLUFFNAligned(nn.Module): method __init__ (line 76) | def __init__( method forward (line 96) | def forward(self, x: Tensor) -> Tensor: FILE: dinov2/logging/__init__.py function _configure_logger (line 18) | def _configure_logger( function setup_logging (line 82) | def setup_logging( FILE: dinov2/logging/helpers.py class MetricLogger (line 20) | class MetricLogger(object): method __init__ (line 21) | def __init__(self, delimiter="\t", output_file=None): method update (line 26) | def update(self, **kwargs): method __getattr__ (line 33) | def __getattr__(self, attr): method __str__ (line 40) | def __str__(self): method synchronize_between_processes (line 46) | def synchronize_between_processes(self): method add_meter (line 50) | def add_meter(self, name, meter): method dump_in_output_file (line 53) | def dump_in_output_file(self, iteration, iter_time, data_time): method log_every (line 66) | def log_every(self, iterable, print_freq, header=None, n_iterations=No... class SmoothedValue (line 133) | class SmoothedValue: method __init__ (line 138) | def __init__(self, window_size=20, fmt=None): method update (line 146) | def update(self, value, num=1): method synchronize_between_processes (line 151) | def synchronize_between_processes(self): method median (line 166) | def median(self): method avg (line 171) | def avg(self): method global_avg (line 176) | def global_avg(self): method max (line 180) | def max(self): method value (line 184) | def value(self): method __str__ (line 187) | def __str__(self): FILE: dinov2/loss/dino_clstoken_loss.py class DINOLoss (line 12) | class DINOLoss(nn.Module): method __init__ (line 13) | def __init__( method softmax_center_teacher (line 29) | def softmax_center_teacher(self, teacher_output, teacher_temp): method sinkhorn_knopp_teacher (line 35) | def sinkhorn_knopp_teacher(self, teacher_output, teacher_temp, n_itera... method forward (line 63) | def forward(self, student_output_list, teacher_out_softmaxed_centered_... method update_center (line 77) | def update_center(self, teacher_output): method reduce_center_update (line 81) | def reduce_center_update(self, teacher_output): method apply_center_update (line 89) | def apply_center_update(self): FILE: dinov2/loss/ibot_patch_loss.py function lossfunc (line 20) | def lossfunc(t, s, temp): function lossfunc (line 30) | def lossfunc(t, s, temp): class iBOTPatchLoss (line 34) | class iBOTPatchLoss(nn.Module): method __init__ (line 35) | def __init__(self, patch_out_dim, student_temp=0.1, center_momentum=0.9): method softmax_center_teacher (line 46) | def softmax_center_teacher(self, teacher_patch_tokens, teacher_temp): method sinkhorn_knopp_teacher (line 62) | def sinkhorn_knopp_teacher(self, teacher_output, teacher_temp, n_maske... method forward (line 92) | def forward(self, student_patch_tokens, teacher_patch_tokens, student_... method forward_masked (line 105) | def forward_masked( method update_center (line 129) | def update_center(self, teacher_patch_tokens): method reduce_center_update (line 133) | def reduce_center_update(self, teacher_patch_tokens): method apply_center_update (line 141) | def apply_center_update(self): FILE: dinov2/loss/koleo_loss.py class KoLeoLoss (line 18) | class KoLeoLoss(nn.Module): method __init__ (line 21) | def __init__(self): method pairwise_NNs_inner (line 25) | def pairwise_NNs_inner(self, x): method forward (line 38) | def forward(self, student_output, eps=1e-8): FILE: dinov2/models/__init__.py function build_model (line 14) | def build_model(args, only_teacher=False, img_size=224): function build_model_from_cfg (line 44) | def build_model_from_cfg(cfg, only_teacher=False): FILE: dinov2/models/vision_transformer.py function named_apply (line 27) | def named_apply(fn: Callable, module: nn.Module, name="", depth_first=Tr... class BlockChunk (line 38) | class BlockChunk(nn.ModuleList): method forward (line 39) | def forward(self, x): class DinoVisionTransformer (line 45) | class DinoVisionTransformer(nn.Module): method __init__ (line 46) | def __init__( method init_weights (line 175) | def init_weights(self): method interpolate_pos_encoding (line 182) | def interpolate_pos_encoding(self, x, w, h): method prepare_tokens_with_masks (line 216) | def prepare_tokens_with_masks(self, x, masks=None): method forward_features_list (line 237) | def forward_features_list(self, x_list, masks_list): method forward_features (line 257) | def forward_features(self, x, masks=None): method _get_intermediate_layers_not_chunked (line 275) | def _get_intermediate_layers_not_chunked(self, x, n=1): method _get_intermediate_layers_chunked (line 287) | def _get_intermediate_layers_chunked(self, x, n=1): method get_intermediate_layers (line 301) | def get_intermediate_layers( method forward (line 348) | def forward(self, *args, is_training=False, **kwargs): function init_weights_vit_timm (line 356) | def init_weights_vit_timm(module: nn.Module, name: str = ""): function vit_small (line 364) | def vit_small(patch_size=16, num_register_tokens=0, in_chans=3, channel_... function vit_base (line 380) | def vit_base(patch_size=16, num_register_tokens=0, in_chans=3, channel_a... function vit_large (line 396) | def vit_large(patch_size=16, num_register_tokens=0, in_chans=3, channel_... function vit_giant2 (line 412) | def vit_giant2(patch_size=16, num_register_tokens=0, in_chans=3, channel... FILE: dinov2/run/eval/cell_dino/knn.py class Evaluator (line 18) | class Evaluator: method __init__ (line 19) | def __init__(self, args): method __call__ (line 22) | def __call__(self): method checkpoint (line 28) | def checkpoint(self): method _setup_args (line 35) | def _setup_args(self): function main (line 44) | def main(): FILE: dinov2/run/eval/cell_dino/linear.py class Evaluator (line 18) | class Evaluator: method __init__ (line 19) | def __init__(self, args): method __call__ (line 22) | def __call__(self): method checkpoint (line 28) | def checkpoint(self): method _setup_args (line 35) | def _setup_args(self): function main (line 44) | def main(): FILE: dinov2/run/eval/knn.py class Evaluator (line 18) | class Evaluator: method __init__ (line 19) | def __init__(self, args): method __call__ (line 22) | def __call__(self): method checkpoint (line 28) | def checkpoint(self): method _setup_args (line 35) | def _setup_args(self): function main (line 44) | def main(): FILE: dinov2/run/eval/linear.py class Evaluator (line 18) | class Evaluator: method __init__ (line 19) | def __init__(self, args): method __call__ (line 22) | def __call__(self): method checkpoint (line 28) | def checkpoint(self): method _setup_args (line 35) | def _setup_args(self): function main (line 44) | def main(): FILE: dinov2/run/eval/log_regression.py class Evaluator (line 18) | class Evaluator: method __init__ (line 19) | def __init__(self, args): method __call__ (line 22) | def __call__(self): method checkpoint (line 28) | def checkpoint(self): method _setup_args (line 35) | def _setup_args(self): function main (line 44) | def main(): FILE: dinov2/run/submit.py function get_args_parser (line 24) | def get_args_parser( function get_shared_folder (line 83) | def get_shared_folder() -> Path: function submit_jobs (line 92) | def submit_jobs(task_class, args, name: str): FILE: dinov2/run/train/train.py class Trainer (line 18) | class Trainer(object): method __init__ (line 19) | def __init__(self, args): method __call__ (line 22) | def __call__(self): method checkpoint (line 28) | def checkpoint(self): method _setup_args (line 35) | def _setup_args(self): function main (line 44) | def main(): FILE: dinov2/thirdparty/CLIP/clip/simple_tokenizer.py function default_bpe (line 16) | def default_bpe(): function bytes_to_unicode (line 21) | def bytes_to_unicode(): function get_pairs (line 43) | def get_pairs(word): function basic_clean (line 55) | def basic_clean(text): function whitespace_clean (line 61) | def whitespace_clean(text): class SimpleTokenizer (line 67) | class SimpleTokenizer(object): method __init__ (line 68) | def __init__(self, bpe_path: str = default_bpe()): method bpe (line 88) | def bpe(self, token): method encode (line 129) | def encode(self, text): method decode (line 137) | def decode(self, tokens): FILE: dinov2/train/ssl_meta_arch.py class SSLMetaArch (line 31) | class SSLMetaArch(nn.Module): method __init__ (line 32) | def __init__(self, cfg): method forward (line 123) | def forward(self, inputs): method backprop_loss (line 126) | def backprop_loss(self, loss): method forward_backward (line 132) | def forward_backward(self, images, teacher_temp): method fsdp_synchronize_streams (line 348) | def fsdp_synchronize_streams(self): method update_teacher (line 356) | def update_teacher(self, m): method train (line 367) | def train(self): method get_maybe_fused_params_for_submodel (line 371) | def get_maybe_fused_params_for_submodel(self, m): method get_params_groups (line 384) | def get_params_groups(self): method prepare_for_distributed_training (line 390) | def prepare_for_distributed_training(self): FILE: dinov2/train/train.py function get_args_parser (line 30) | def get_args_parser(add_help: bool = True): function build_optimizer (line 61) | def build_optimizer(cfg, params_groups): function build_schedulers (line 65) | def build_schedulers(cfg): function apply_optim_scheduler (line 113) | def apply_optim_scheduler(optimizer, lr, wd, last_layer_lr): function do_test (line 122) | def do_test(cfg, model, iteration): function do_train (line 134) | def do_train(cfg, model, resume=False): function main (line 306) | def main(args): FILE: dinov2/utils/checkpoint.py class PeriodicCheckpointerWithCleanup (line 14) | class PeriodicCheckpointerWithCleanup(PeriodicCheckpointer): method does_write (line 16) | def does_write(self) -> bool: method save_best (line 20) | def save_best(self, **kwargs: Any) -> None: method has_checkpoint (line 24) | def has_checkpoint(self) -> bool: method get_checkpoint_file (line 27) | def get_checkpoint_file(self) -> str: # returns "" if the file does n... method load (line 30) | def load(self, path: str, checkpointables=None) -> dict[str, Any]: method step (line 33) | def step(self, iteration: int, **kwargs: Any) -> None: function resume_or_load (line 39) | def resume_or_load(checkpointer: Checkpointer, path: str, *, resume: boo... function build_periodic_checkpointer (line 52) | def build_periodic_checkpointer( FILE: dinov2/utils/cluster.py class ClusterType (line 12) | class ClusterType(Enum): function _guess_cluster_type (line 18) | def _guess_cluster_type() -> ClusterType: function get_cluster_type (line 31) | def get_cluster_type(cluster_type: Optional[ClusterType] = None) -> Opti... function get_checkpoint_path (line 38) | def get_checkpoint_path(cluster_type: Optional[ClusterType] = None) -> O... function get_user_checkpoint_path (line 51) | def get_user_checkpoint_path(cluster_type: Optional[ClusterType] = None)... function get_slurm_partition (line 61) | def get_slurm_partition(cluster_type: Optional[ClusterType] = None) -> O... function get_slurm_executor_parameters (line 74) | def get_slurm_executor_parameters( FILE: dinov2/utils/config.py function apply_scaling_rules_to_cfg (line 21) | def apply_scaling_rules_to_cfg(cfg): # to fix function write_config (line 32) | def write_config(cfg, output_dir, name="config.yaml"): function get_cfg_from_args (line 40) | def get_cfg_from_args(args): function default_setup (line 49) | def default_setup(args): function setup (line 63) | def setup(args): FILE: dinov2/utils/dtype.py function as_torch_dtype (line 31) | def as_torch_dtype(dtype: TypeSpec) -> torch.dtype: FILE: dinov2/utils/param_groups.py function get_vit_lr_decay_rate (line 13) | def get_vit_lr_decay_rate(name, lr_decay_rate=1.0, num_layers=12, force_... function get_params_groups_with_decay (line 51) | def get_params_groups_with_decay(model, lr_decay_rate=1.0, patch_embed_l... function fuse_params_groups (line 92) | def fuse_params_groups(all_params_groups, keys=("lr_multiplier", "wd_mul... FILE: dinov2/utils/utils.py function load_pretrained_weights (line 20) | def load_pretrained_weights(model, pretrained_weights, checkpoint_key): function fix_random_seeds (line 36) | def fix_random_seeds(seed=31): function get_sha (line 46) | def get_sha(): class CosineScheduler (line 67) | class CosineScheduler(object): method __init__ (line 68) | def __init__(self, base_value, final_value, total_iters, warmup_iters=... method __getitem__ (line 83) | def __getitem__(self, it): function has_batchnorms (line 90) | def has_batchnorms(model): FILE: setup.py function get_requirements (line 29) | def get_requirements(path: str = HERE / "requirements.txt") -> Tuple[Lis... function get_package_version (line 42) | def get_package_version() -> str: