id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18,500 | pytorch/vision | pytorch_vision/torchvision/models/vision_transformer.py | torchvision.models.vision_transformer.MLPBlock | import torch.nn as nn
from ..ops.misc import Conv2dNormActivation, MLP
class MLPBlock(MLP):
"""Transformer MLP block."""
_version = 2
def __init__(self, in_dim: int, mlp_dim: int, dropout: float):
super().__init__(in_dim, [mlp_dim, in_dim], activation_layer=nn.GELU, inplace=None, dropout=dropout)
... |
class MLPBlock(MLP):
'''Transformer MLP block.'''
def __init__(self, in_dim: int, mlp_dim: int, dropout: float):
pass
def _load_from_state_dict(self, state_dict, prefix, local_metadata, strict, missing_keys, unexpected_keys, error_msgs):
pass | 3 | 1 | 19 | 2 | 17 | 1 | 5 | 0.06 | 1 | 4 | 0 | 0 | 2 | 0 | 2 | 3 | 44 | 6 | 36 | 19 | 24 | 2 | 19 | 10 | 16 | 5 | 2 | 4 | 9 |
18,501 | pytorch/vision | pytorch_vision/torchvision/models/vision_transformer.py | torchvision.models.vision_transformer.ViT_B_16_Weights | from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification, InterpolationMode
from functools import partial
class ViT_B_16_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/vit_b_16-c867db91.pth', transforms=partial(ImageClassif... |
class ViT_B_16_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 77 | 0 | 77 | 5 | 76 | 1 | 5 | 5 | 4 | 0 | 5 | 0 | 0 |
18,502 | pytorch/vision | pytorch_vision/torchvision/models/vision_transformer.py | torchvision.models.vision_transformer.ViT_B_32_Weights | from functools import partial
from ..transforms._presets import ImageClassification, InterpolationMode
from ._api import register_model, Weights, WeightsEnum
class ViT_B_32_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/vit_b_32-d86f8d99.pth', transforms=partial(ImageClassif... |
class ViT_B_32_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 24 | 0 | 24 | 3 | 23 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,503 | pytorch/vision | pytorch_vision/torchvision/models/vision_transformer.py | torchvision.models.vision_transformer.ViT_H_14_Weights | from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification, InterpolationMode
from functools import partial
class ViT_H_14_Weights(WeightsEnum):
IMAGENET1K_SWAG_E2E_V1 = Weights(url='https://download.pytorch.org/models/vit_h_14_swag-80465313.pth', transforms=partia... |
class ViT_H_14_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 55 | 0 | 55 | 4 | 54 | 0 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,504 | pytorch/vision | pytorch_vision/torchvision/models/vision_transformer.py | torchvision.models.vision_transformer.ViT_L_16_Weights | from functools import partial
from ..transforms._presets import ImageClassification, InterpolationMode
from ._api import register_model, Weights, WeightsEnum
class ViT_L_16_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/vit_l_16-852ce7e3.pth', transforms=partial(ImageClassif... |
class ViT_L_16_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 78 | 0 | 78 | 5 | 77 | 1 | 5 | 5 | 4 | 0 | 5 | 0 | 0 |
18,505 | pytorch/vision | pytorch_vision/torchvision/models/vision_transformer.py | torchvision.models.vision_transformer.ViT_L_32_Weights | from ..transforms._presets import ImageClassification, InterpolationMode
from functools import partial
from ._api import register_model, Weights, WeightsEnum
class ViT_L_32_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/vit_l_32-c7638314.pth', transforms=partial(ImageClassif... |
class ViT_L_32_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 24 | 0 | 24 | 3 | 23 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,506 | pytorch/vision | pytorch_vision/torchvision/models/vision_transformer.py | torchvision.models.vision_transformer.VisionTransformer | from typing import Any, Callable, NamedTuple, Optional
from functools import partial
import torch
from collections import OrderedDict
from ..utils import _log_api_usage_once
from ..ops.misc import Conv2dNormActivation, MLP
import torch.nn as nn
import math
class VisionTransformer(nn.Module):
"""Vision Transformer ... |
class VisionTransformer(nn.Module):
'''Vision Transformer as per https://arxiv.org/abs/2010.11929.'''
def __init__(self, image_size: int, patch_size: int, num_layers: int, num_heads: int, hidden_dim: int, mlp_dim: int, dropout: float=0.0, attention_dropout: float=0.0, num_classes: int=1000, representation_siz... | 4 | 1 | 47 | 6 | 37 | 4 | 4 | 0.13 | 1 | 11 | 3 | 0 | 3 | 14 | 3 | 13 | 146 | 20 | 112 | 44 | 94 | 14 | 70 | 30 | 66 | 10 | 1 | 2 | 12 |
18,507 | pytorch/vision | pytorch_vision/torchvision/ops/deform_conv.py | torchvision.ops.deform_conv.DeformConv2d | import torch
from torch import nn, Tensor
from torch.nn import init
from typing import Optional
from torch.nn.parameter import Parameter
from ..utils import _log_api_usage_once
import math
from torch.nn.modules.utils import _pair
class DeformConv2d(nn.Module):
"""
See :func:`deform_conv2d`.
"""
def __... |
class DeformConv2d(nn.Module):
'''
See :func:`deform_conv2d`.
'''
def __init__(self, in_channels: int, out_channels: int, kernel_size: int, stride: int=1, padding: int=0, dilation: int=1, groups: int=1, bias: bool=True):
pass
def reset_parameters(self) -> None:
pass
def f... | 5 | 2 | 20 | 2 | 16 | 2 | 3 | 0.17 | 1 | 7 | 0 | 0 | 4 | 9 | 4 | 14 | 86 | 11 | 64 | 27 | 49 | 11 | 36 | 17 | 31 | 5 | 1 | 1 | 12 |
18,508 | pytorch/vision | pytorch_vision/torchvision/ops/drop_block.py | torchvision.ops.drop_block.DropBlock2d | from torch import nn, Tensor
class DropBlock2d(nn.Module):
"""
See :func:`drop_block2d`.
"""
def __init__(self, p: float, block_size: int, inplace: bool=False, eps: float=1e-06) -> None:
super().__init__()
self.p = p
self.block_size = block_size
self.inplace = inplace
... |
class DropBlock2d(nn.Module):
'''
See :func:`drop_block2d`.
'''
def __init__(self, p: float, block_size: int, inplace: bool=False, eps: float=1e-06) -> None:
pass
def forward(self, input: Tensor) -> Tensor:
'''
Args:
input (Tensor): Input feature map on which s... | 4 | 2 | 6 | 0 | 4 | 2 | 1 | 0.83 | 1 | 6 | 0 | 1 | 3 | 4 | 3 | 13 | 26 | 4 | 12 | 9 | 8 | 10 | 12 | 9 | 8 | 1 | 1 | 0 | 3 |
18,509 | pytorch/vision | pytorch_vision/torchvision/ops/drop_block.py | torchvision.ops.drop_block.DropBlock3d | from torch import nn, Tensor
class DropBlock3d(DropBlock2d):
"""
See :func:`drop_block3d`.
"""
def __init__(self, p: float, block_size: int, inplace: bool=False, eps: float=1e-06) -> None:
super().__init__(p, block_size, inplace, eps)
def forward(self, input: Tensor) -> Tensor:
""... |
class DropBlock3d(DropBlock2d):
'''
See :func:`drop_block3d`.
'''
def __init__(self, p: float, block_size: int, inplace: bool=False, eps: float=1e-06) -> None:
pass
def forward(self, input: Tensor) -> Tensor:
'''
Args:
input (Tensor): Input feature map on which... | 3 | 2 | 6 | 0 | 2 | 4 | 1 | 2 | 1 | 5 | 0 | 0 | 2 | 0 | 2 | 15 | 17 | 2 | 5 | 3 | 2 | 10 | 5 | 3 | 2 | 1 | 2 | 0 | 2 |
18,510 | pytorch/vision | pytorch_vision/torchvision/ops/feature_pyramid_network.py | torchvision.ops.feature_pyramid_network.ExtraFPNBlock | from torch import nn, Tensor
class ExtraFPNBlock(nn.Module):
"""
Base class for the extra block in the FPN.
Args:
results (List[Tensor]): the result of the FPN
x (List[Tensor]): the original feature maps
names (List[str]): the names for each one of the
original feature ... |
class ExtraFPNBlock(nn.Module):
'''
Base class for the extra block in the FPN.
Args:
results (List[Tensor]): the result of the FPN
x (List[Tensor]): the original feature maps
names (List[str]): the names for each one of the
original feature maps
Returns:
resu... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 1.5 | 1 | 2 | 0 | 2 | 1 | 0 | 1 | 11 | 23 | 3 | 8 | 7 | 1 | 12 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
18,511 | pytorch/vision | pytorch_vision/torchvision/ops/feature_pyramid_network.py | torchvision.ops.feature_pyramid_network.FeaturePyramidNetwork | import torch.nn.functional as F
from torch import nn, Tensor
from typing import Callable, Optional
from ..utils import _log_api_usage_once
from ..ops.misc import Conv2dNormActivation
from collections import OrderedDict
class FeaturePyramidNetwork(nn.Module):
"""
Module that adds a FPN from on top of a set of f... |
class FeaturePyramidNetwork(nn.Module):
'''
Module that adds a FPN from on top of a set of feature maps. This is based on
`"Feature Pyramid Network for Object Detection" <https://arxiv.org/abs/1612.03144>`_.
The feature maps are currently supposed to be in increasing depth
order.
The input to t... | 6 | 4 | 25 | 2 | 19 | 4 | 5 | 0.52 | 1 | 14 | 2 | 0 | 5 | 3 | 5 | 15 | 169 | 23 | 96 | 50 | 75 | 50 | 69 | 35 | 63 | 8 | 1 | 5 | 25 |
18,512 | pytorch/vision | pytorch_vision/torchvision/ops/feature_pyramid_network.py | torchvision.ops.feature_pyramid_network.LastLevelMaxPool | import torch.nn.functional as F
from torch import nn, Tensor
class LastLevelMaxPool(ExtraFPNBlock):
"""
Applies a max_pool2d (not actual max_pool2d, we just subsample) on top of the last feature map
"""
def forward(self, x: list[Tensor], y: list[Tensor], names: list[str]) -> tuple[list[Tensor], list[s... |
class LastLevelMaxPool(ExtraFPNBlock):
'''
Applies a max_pool2d (not actual max_pool2d, we just subsample) on top of the last feature map
'''
def forward(self, x: list[Tensor], y: list[Tensor], names: list[str]) -> tuple[list[Tensor], list[str]]:
pass | 2 | 1 | 10 | 0 | 9 | 1 | 1 | 0.4 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 12 | 15 | 1 | 10 | 7 | 3 | 4 | 5 | 2 | 3 | 1 | 2 | 0 | 1 |
18,513 | pytorch/vision | pytorch_vision/torchvision/ops/feature_pyramid_network.py | torchvision.ops.feature_pyramid_network.LastLevelP6P7 | from torch import nn, Tensor
import torch.nn.functional as F
class LastLevelP6P7(ExtraFPNBlock):
"""
This module is used in RetinaNet to generate extra layers, P6 and P7.
"""
def __init__(self, in_channels: int, out_channels: int):
super().__init__()
self.p6 = nn.Conv2d(in_channels, ou... |
class LastLevelP6P7(ExtraFPNBlock):
'''
This module is used in RetinaNet to generate extra layers, P6 and P7.
'''
def __init__(self, in_channels: int, out_channels: int):
pass
def forward(self, p: list[Tensor], c: list[Tensor], names: list[str]) -> tuple[list[Tensor], list[str]]:
... | 3 | 1 | 11 | 0 | 11 | 0 | 2 | 0.14 | 1 | 4 | 0 | 0 | 2 | 3 | 2 | 13 | 27 | 2 | 22 | 16 | 14 | 3 | 17 | 11 | 14 | 2 | 2 | 1 | 4 |
18,514 | pytorch/vision | pytorch_vision/torchvision/ops/misc.py | torchvision.ops.misc.Conv2dNormActivation | import torch
from typing import Callable, Optional, Union
class Conv2dNormActivation(ConvNormActivation):
"""
Configurable block used for Convolution2d-Normalization-Activation blocks.
Args:
in_channels (int): Number of channels in the input image
out_channels (int): Number of channels pro... |
class Conv2dNormActivation(ConvNormActivation):
'''
Configurable block used for Convolution2d-Normalization-Activation blocks.
Args:
in_channels (int): Number of channels in the input image
out_channels (int): Number of channels produced by the Convolution-Normalization-Activation block
... | 2 | 1 | 29 | 1 | 28 | 0 | 1 | 0.52 | 1 | 4 | 0 | 1 | 1 | 0 | 1 | 2 | 48 | 4 | 29 | 15 | 14 | 15 | 3 | 2 | 1 | 1 | 2 | 0 | 1 |
18,515 | pytorch/vision | pytorch_vision/torchvision/ops/misc.py | torchvision.ops.misc.Conv3dNormActivation | from typing import Callable, Optional, Union
import torch
class Conv3dNormActivation(ConvNormActivation):
"""
Configurable block used for Convolution3d-Normalization-Activation blocks.
Args:
in_channels (int): Number of channels in the input video.
out_channels (int): Number of channels pr... |
class Conv3dNormActivation(ConvNormActivation):
'''
Configurable block used for Convolution3d-Normalization-Activation blocks.
Args:
in_channels (int): Number of channels in the input video.
out_channels (int): Number of channels produced by the Convolution-Normalization-Activation block
... | 2 | 1 | 29 | 1 | 28 | 0 | 1 | 0.52 | 1 | 4 | 0 | 0 | 1 | 0 | 1 | 2 | 47 | 3 | 29 | 15 | 14 | 15 | 3 | 2 | 1 | 1 | 2 | 0 | 1 |
18,516 | pytorch/vision | pytorch_vision/torchvision/ops/misc.py | torchvision.ops.misc.ConvNormActivation | from typing import Callable, Optional, Union
import warnings
import torch
from collections.abc import Sequence
from ..utils import _log_api_usage_once, _make_ntuple
class ConvNormActivation(torch.nn.Sequential):
def __init__(self, in_channels: int, out_channels: int, kernel_size: Union[int, tuple[int, ...]]=3, st... |
class ConvNormActivation(torch.nn.Sequential):
def __init__(self, in_channels: int, out_channels: int, kernel_size: Union[int, tuple[int, ...]]=3, stride: Union[int, tuple[int, ...]]=1, padding: Optional[Union[int, tuple[int, ...], str]]=None, groups: int=1, norm_layer: Optional[Callable[..., torch.nn.Module]]=to... | 2 | 0 | 54 | 5 | 49 | 0 | 9 | 0 | 1 | 6 | 0 | 2 | 1 | 1 | 1 | 1 | 55 | 5 | 50 | 20 | 34 | 0 | 22 | 6 | 20 | 9 | 1 | 2 | 9 |
18,517 | pytorch/vision | pytorch_vision/torchvision/ops/misc.py | torchvision.ops.misc.FrozenBatchNorm2d | import torch
from ..utils import _log_api_usage_once, _make_ntuple
from torch import Tensor
class FrozenBatchNorm2d(torch.nn.Module):
"""
BatchNorm2d where the batch statistics and the affine parameters are fixed
Args:
num_features (int): Number of features ``C`` from an expected input of size ``(... |
class FrozenBatchNorm2d(torch.nn.Module):
'''
BatchNorm2d where the batch statistics and the affine parameters are fixed
Args:
num_features (int): Number of features ``C`` from an expected input of size ``(N, C, H, W)``
eps (float): a value added to the denominator for numerical stability. ... | 5 | 1 | 10 | 0 | 10 | 1 | 1 | 0.21 | 1 | 7 | 0 | 0 | 4 | 1 | 4 | 14 | 53 | 6 | 39 | 26 | 21 | 8 | 24 | 13 | 19 | 2 | 1 | 1 | 5 |
18,518 | pytorch/vision | pytorch_vision/torchvision/ops/misc.py | torchvision.ops.misc.MLP | import torch
from ..utils import _log_api_usage_once, _make_ntuple
from typing import Callable, Optional, Union
class MLP(torch.nn.Sequential):
"""This block implements the multi-layer perceptron (MLP) module.
Args:
in_channels (int): Number of channels of the input
hidden_channels (List[int])... |
class MLP(torch.nn.Sequential):
'''This block implements the multi-layer perceptron (MLP) module.
Args:
in_channels (int): Number of channels of the input
hidden_channels (List[int]): List of the hidden channel dimensions
norm_layer (Callable[..., torch.nn.Module], optional): Norm layer... | 2 | 1 | 29 | 3 | 24 | 2 | 4 | 0.52 | 1 | 4 | 0 | 1 | 1 | 0 | 1 | 1 | 43 | 5 | 25 | 15 | 14 | 13 | 16 | 6 | 14 | 4 | 1 | 2 | 4 |
18,519 | pytorch/vision | pytorch_vision/torchvision/ops/misc.py | torchvision.ops.misc.Permute | import torch
from torch import Tensor
class Permute(torch.nn.Module):
"""This module returns a view of the tensor input with its dimensions permuted.
Args:
dims (List[int]): The desired ordering of dimensions
"""
def __init__(self, dims: list[int]):
super().__init__()
self.dim... |
class Permute(torch.nn.Module):
'''This module returns a view of the tensor input with its dimensions permuted.
Args:
dims (List[int]): The desired ordering of dimensions
'''
def __init__(self, dims: list[int]):
pass
def forward(self, x: Tensor) -> Tensor:
pass | 3 | 1 | 3 | 0 | 3 | 0 | 1 | 0.67 | 1 | 3 | 0 | 0 | 2 | 1 | 2 | 12 | 13 | 3 | 6 | 4 | 3 | 4 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
18,520 | pytorch/vision | pytorch_vision/torchvision/ops/misc.py | torchvision.ops.misc.SqueezeExcitation | from ..utils import _log_api_usage_once, _make_ntuple
import torch
from typing import Callable, Optional, Union
from torch import Tensor
class SqueezeExcitation(torch.nn.Module):
"""
This block implements the Squeeze-and-Excitation block from https://arxiv.org/abs/1709.01507 (see Fig. 1).
Parameters ``acti... |
class SqueezeExcitation(torch.nn.Module):
'''
This block implements the Squeeze-and-Excitation block from https://arxiv.org/abs/1709.01507 (see Fig. 1).
Parameters ``activation``, and ``scale_activation`` correspond to ``delta`` and ``sigma`` in eq. 3.
Args:
input_channels (int): Number of chan... | 4 | 1 | 8 | 0 | 8 | 0 | 1 | 0.38 | 1 | 3 | 0 | 1 | 3 | 5 | 3 | 13 | 37 | 4 | 24 | 17 | 14 | 9 | 18 | 11 | 14 | 1 | 1 | 0 | 3 |
18,521 | pytorch/vision | pytorch_vision/torchvision/ops/poolers.py | torchvision.ops.poolers.LevelMapper | import torch
from torch import nn, Tensor
import torch.fx
from torchvision.ops.boxes import box_area
class LevelMapper:
"""Determine which FPN level each RoI in a set of RoIs should map to based
on the heuristic in the FPN paper.
Args:
k_min (int)
k_max (int)
canonical_scale (int)
... |
class LevelMapper:
'''Determine which FPN level each RoI in a set of RoIs should map to based
on the heuristic in the FPN paper.
Args:
k_min (int)
k_max (int)
canonical_scale (int)
canonical_level (int)
eps (float)
'''
def __init__(self, k_min: int, k_max: i... | 3 | 2 | 13 | 1 | 9 | 3 | 1 | 0.79 | 0 | 3 | 0 | 0 | 2 | 5 | 2 | 2 | 38 | 4 | 19 | 17 | 9 | 15 | 12 | 10 | 9 | 1 | 0 | 0 | 2 |
18,522 | pytorch/vision | pytorch_vision/torchvision/ops/poolers.py | torchvision.ops.poolers.MultiScaleRoIAlign | from typing import Optional, Union
from ..utils import _log_api_usage_once
from torch import nn, Tensor
class MultiScaleRoIAlign(nn.Module):
"""
Multi-scale RoIAlign pooling, which is useful for detection with or without FPN.
It infers the scale of the pooling via the heuristics specified in eq. 1
of ... |
class MultiScaleRoIAlign(nn.Module):
'''
Multi-scale RoIAlign pooling, which is useful for detection with or without FPN.
It infers the scale of the pooling via the heuristics specified in eq. 1
of the `Feature Pyramid Network paper <https://arxiv.org/abs/1612.03144>`_.
They keyword-only parameters... | 4 | 2 | 19 | 0 | 15 | 4 | 2 | 0.91 | 1 | 5 | 0 | 0 | 3 | 7 | 3 | 13 | 98 | 10 | 46 | 26 | 29 | 42 | 21 | 13 | 17 | 2 | 1 | 1 | 5 |
18,523 | pytorch/vision | pytorch_vision/torchvision/ops/ps_roi_align.py | torchvision.ops.ps_roi_align.PSRoIAlign | from torch import nn, Tensor
from ..utils import _log_api_usage_once
class PSRoIAlign(nn.Module):
"""
See :func:`ps_roi_align`.
"""
def __init__(self, output_size: int, spatial_scale: float, sampling_ratio: int):
super().__init__()
_log_api_usage_once(self)
self.output_size = o... |
class PSRoIAlign(nn.Module):
'''
See :func:`ps_roi_align`.
'''
def __init__(self, output_size: int, spatial_scale: float, sampling_ratio: int):
pass
def forward(self, input: Tensor, rois: Tensor) -> Tensor:
pass
def __repr__(self) -> str:
pass | 4 | 1 | 7 | 0 | 7 | 0 | 1 | 0.13 | 1 | 5 | 0 | 0 | 3 | 3 | 3 | 13 | 29 | 3 | 23 | 13 | 14 | 3 | 12 | 8 | 8 | 1 | 1 | 0 | 3 |
18,524 | pytorch/vision | pytorch_vision/torchvision/ops/ps_roi_pool.py | torchvision.ops.ps_roi_pool.PSRoIPool | from torch import nn, Tensor
from ..utils import _log_api_usage_once
class PSRoIPool(nn.Module):
"""
See :func:`ps_roi_pool`.
"""
def __init__(self, output_size: int, spatial_scale: float):
super().__init__()
_log_api_usage_once(self)
self.output_size = output_size
self... |
class PSRoIPool(nn.Module):
'''
See :func:`ps_roi_pool`.
'''
def __init__(self, output_size: int, spatial_scale: float):
pass
def forward(self, input: Tensor, rois: Tensor) -> Tensor:
pass
def __repr__(self) -> str:
pass | 4 | 1 | 3 | 0 | 3 | 0 | 1 | 0.27 | 1 | 5 | 0 | 0 | 3 | 2 | 3 | 13 | 17 | 3 | 11 | 7 | 7 | 3 | 11 | 7 | 7 | 1 | 1 | 0 | 3 |
18,525 | pytorch/vision | pytorch_vision/torchvision/ops/roi_align.py | torchvision.ops.roi_align.RoIAlign | from torch import nn, Tensor
from torch.jit.annotations import BroadcastingList2
from ..utils import _log_api_usage_once
from typing import Union
class RoIAlign(nn.Module):
"""
See :func:`roi_align`.
"""
def __init__(self, output_size: BroadcastingList2[int], spatial_scale: float, sampling_ratio: int,... |
class RoIAlign(nn.Module):
'''
See :func:`roi_align`.
'''
def __init__(self, output_size: BroadcastingList2[int], spatial_scale: float, sampling_ratio: int, aligned: bool=False):
pass
def forward(self, input: Tensor, rois: Union[Tensor, list[Tensor]]) -> Tensor:
pass
def __re... | 4 | 1 | 8 | 0 | 8 | 0 | 1 | 0.12 | 1 | 6 | 0 | 0 | 3 | 4 | 3 | 13 | 32 | 3 | 26 | 15 | 16 | 3 | 13 | 9 | 9 | 1 | 1 | 0 | 3 |
18,526 | pytorch/vision | pytorch_vision/torchvision/ops/roi_pool.py | torchvision.ops.roi_pool.RoIPool | from torch.jit.annotations import BroadcastingList2
from typing import Union
from ..utils import _log_api_usage_once
from torch import nn, Tensor
class RoIPool(nn.Module):
"""
See :func:`roi_pool`.
"""
def __init__(self, output_size: BroadcastingList2[int], spatial_scale: float):
super().__ini... |
class RoIPool(nn.Module):
'''
See :func:`roi_pool`.
'''
def __init__(self, output_size: BroadcastingList2[int], spatial_scale: float):
pass
def forward(self, input: Tensor, rois: Union[Tensor, list[Tensor]]) -> Tensor:
pass
def __repr__(self) -> str:
pass | 4 | 1 | 3 | 0 | 3 | 0 | 1 | 0.27 | 1 | 5 | 0 | 0 | 3 | 2 | 3 | 13 | 17 | 3 | 11 | 7 | 7 | 3 | 11 | 7 | 7 | 1 | 1 | 0 | 3 |
18,527 | pytorch/vision | pytorch_vision/torchvision/ops/stochastic_depth.py | torchvision.ops.stochastic_depth.StochasticDepth | from torch import nn, Tensor
from ..utils import _log_api_usage_once
class StochasticDepth(nn.Module):
"""
See :func:`stochastic_depth`.
"""
def __init__(self, p: float, mode: str) -> None:
super().__init__()
_log_api_usage_once(self)
self.p = p
self.mode = mode
de... |
class StochasticDepth(nn.Module):
'''
See :func:`stochastic_depth`.
'''
def __init__(self, p: float, mode: str) -> None:
pass
def forward(self, input: Tensor) -> Tensor:
pass
def __repr__(self) -> str:
pass | 4 | 1 | 3 | 0 | 3 | 0 | 1 | 0.27 | 1 | 4 | 0 | 0 | 3 | 2 | 3 | 13 | 17 | 3 | 11 | 7 | 7 | 3 | 11 | 7 | 7 | 1 | 1 | 0 | 3 |
18,528 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/caltech.py | torchvision.prototype.datasets._builtin.caltech.Caltech101 | from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling, INFINITE_BUFFER_SIZE, read_categories_file, read_mat
from .._api import register_dataset, register_info
import re
import numpy as np
from torchvision.tv_tensors import BoundingBoxes
import torch
from typing import Any, BinaryIO, U... | @register_dataset('caltech101')
class Caltech101(Dataset):
'''
- **homepage**: https://data.caltech.edu/records/20086
- **dependencies**:
- <scipy `https://scipy.org/`>_
'''
def __init__(self, root: Union[str, pathlib.Path], skip_integrity_check: bool=False) -> None:
pass
def _... | 12 | 1 | 10 | 1 | 9 | 0 | 1 | 0.07 | 1 | 13 | 5 | 0 | 10 | 1 | 10 | 37 | 123 | 24 | 94 | 40 | 77 | 7 | 52 | 33 | 41 | 2 | 5 | 1 | 11 |
18,529 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/caltech.py | torchvision.prototype.datasets._builtin.caltech.Caltech256 | from typing import Any, BinaryIO, Union
from torchdata.datapipes.iter import Filter, IterDataPipe, IterKeyZipper, Mapper
from torchvision.prototype.tv_tensors import Label
from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling, INFINITE_BUFFER_SIZE, read_categories_file, read_mat
from ... | @register_dataset('caltech256')
class Caltech256(Dataset):
'''
- **homepage**: https://data.caltech.edu/records/20087
'''
def __init__(self, root: Union[str, pathlib.Path], skip_integrity_check: bool=False) -> None:
pass
def _resources(self) -> list[OnlineResource]:
pass
def _... | 9 | 1 | 6 | 1 | 5 | 0 | 1 | 0.08 | 1 | 12 | 4 | 0 | 7 | 1 | 7 | 34 | 53 | 11 | 39 | 19 | 27 | 3 | 25 | 15 | 17 | 1 | 5 | 0 | 7 |
18,530 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/celeba.py | torchvision.prototype.datasets._builtin.celeba.CelebA | import torch
from typing import Any, BinaryIO, Optional, Union
import pathlib
from torchvision.tv_tensors import BoundingBoxes
from .._api import register_dataset, register_info
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, GDriveResource, OnlineResource
from torchvision.prototype.datasets.uti... | @register_dataset(NAME)
class CelebA(Dataset):
'''
- **homepage**: https://mmlab.ie.cuhk.edu.hk/projects/CelebA.html
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
pass
def _resources(self) -> list[OnlineResource]:
... | 8 | 1 | 21 | 1 | 20 | 0 | 1 | 0.03 | 1 | 14 | 6 | 0 | 6 | 1 | 6 | 33 | 135 | 12 | 120 | 39 | 96 | 3 | 34 | 22 | 27 | 1 | 5 | 0 | 6 |
18,531 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/celeba.py | torchvision.prototype.datasets._builtin.celeba.CelebACSVParser | from collections.abc import Iterator, Sequence
import csv
from torchdata.datapipes.iter import Filter, IterDataPipe, IterKeyZipper, Mapper, Zipper
from typing import Any, BinaryIO, Optional, Union
class CelebACSVParser(IterDataPipe[tuple[str, dict[str, str]]]):
def __init__(self, datapipe: IterDataPipe[tuple[Any,... |
class CelebACSVParser(IterDataPipe[tuple[str, dict[str, str]]]):
def __init__(self, datapipe: IterDataPipe[tuple[Any, BinaryIO]], *, fieldnames: Optional[Sequence[str]]=None) -> None:
pass
def __iter__(self) -> Iterator[tuple[str, dict[str, str]]]:
pass | 3 | 0 | 15 | 2 | 12 | 2 | 3 | 0.17 | 1 | 4 | 0 | 0 | 2 | 2 | 2 | 2 | 32 | 4 | 24 | 13 | 16 | 4 | 17 | 8 | 14 | 5 | 1 | 4 | 6 |
18,532 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/cifar.py | torchvision.prototype.datasets._builtin.cifar.Cifar10 | from .._api import register_dataset, register_info
import pathlib
from typing import Any, BinaryIO, cast, Optional, Union
@register_dataset('cifar10')
class Cifar10(_CifarBase):
"""
- **homepage**: https://www.cs.toronto.edu/~kriz/cifar.html
"""
_FILE_NAME = 'cifar-10-python.tar.gz'
_SHA256 = '6d95... | @register_dataset('cifar10')
class Cifar10(_CifarBase):
'''
- **homepage**: https://www.cs.toronto.edu/~kriz/cifar.html
'''
def _is_data_file(self, data: tuple[str, Any]) -> bool:
pass | 3 | 1 | 3 | 0 | 3 | 0 | 2 | 0.3 | 1 | 4 | 0 | 0 | 1 | 0 | 1 | 36 | 15 | 2 | 10 | 9 | 8 | 3 | 10 | 9 | 8 | 2 | 6 | 0 | 2 |
18,533 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/cifar.py | torchvision.prototype.datasets._builtin.cifar.Cifar100 | from typing import Any, BinaryIO, cast, Optional, Union
from .._api import register_dataset, register_info
import pathlib
@register_dataset('cifar100')
class Cifar100(_CifarBase):
"""
- **homepage**: https://www.cs.toronto.edu/~kriz/cifar.html
"""
_FILE_NAME = 'cifar-100-python.tar.gz'
_SHA256 = '8... | @register_dataset('cifar100')
class Cifar100(_CifarBase):
'''
- **homepage**: https://www.cs.toronto.edu/~kriz/cifar.html
'''
def _is_data_file(self, data: tuple[str, Any]) -> bool:
pass | 3 | 1 | 3 | 0 | 3 | 0 | 1 | 0.3 | 1 | 4 | 0 | 0 | 1 | 0 | 1 | 36 | 15 | 2 | 10 | 9 | 8 | 3 | 10 | 9 | 8 | 1 | 6 | 0 | 1 |
18,534 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/cifar.py | torchvision.prototype.datasets._builtin.cifar.CifarFileReader | from torchdata.datapipes.iter import Filter, IterDataPipe, Mapper
from collections.abc import Iterator
from typing import Any, BinaryIO, cast, Optional, Union
import numpy as np
class CifarFileReader(IterDataPipe[tuple[np.ndarray, int]]):
def __init__(self, datapipe: IterDataPipe[dict[str, Any]], *, labels_key: s... |
class CifarFileReader(IterDataPipe[tuple[np.ndarray, int]]):
def __init__(self, datapipe: IterDataPipe[dict[str, Any]], *, labels_key: str) -> None:
pass
def __iter__(self) -> Iterator[tuple[np.ndarray, int]]:
pass | 3 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 1 | 4 | 0 | 0 | 2 | 2 | 2 | 2 | 10 | 1 | 9 | 8 | 6 | 0 | 9 | 8 | 6 | 2 | 1 | 1 | 3 |
18,535 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/cifar.py | torchvision.prototype.datasets._builtin.cifar._CifarBase | from torchvision.tv_tensors import Image
import abc
import io
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling, path_comparator, read_categories_file
import numpy as np
from torchvision.prototy... |
class _CifarBase(Dataset):
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
pass
@abc.abstractmethod
def _is_data_file(self, data: tuple[str, BinaryIO]) -> Optional[int]:
pass
def _resources(self) -> list[OnlineResour... | 10 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 1 | 13 | 5 | 2 | 8 | 1 | 8 | 35 | 63 | 10 | 53 | 23 | 37 | 0 | 38 | 16 | 29 | 2 | 5 | 0 | 9 |
18,536 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/clevr.py | torchvision.prototype.datasets._builtin.clevr.CLEVR | from typing import Any, BinaryIO, Optional, Union
import pathlib
from torchdata.datapipes.iter import Demultiplexer, Filter, IterDataPipe, IterKeyZipper, JsonParser, Mapper, UnBatcher
from torchvision.prototype.tv_tensors import Label
from torchvision.prototype.datasets.utils._internal import getitem, hint_sharding, hi... | @register_dataset(NAME)
class CLEVR(Dataset):
'''
- **homepage**: https://cs.stanford.edu/people/jcjohns/clevr/
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
pass
def _resources(self) -> list[OnlineResource]:
... | 10 | 1 | 9 | 1 | 8 | 0 | 2 | 0.05 | 1 | 12 | 4 | 0 | 8 | 1 | 8 | 35 | 81 | 14 | 64 | 21 | 53 | 3 | 40 | 19 | 31 | 3 | 5 | 2 | 14 |
18,537 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/coco.py | torchvision.prototype.datasets._builtin.coco.Coco | from collections import defaultdict, OrderedDict
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
import re
from .._api import register_dataset, register_info
import pathlib
import torch
from torchvision.prototype.tv_tensors import Label
from typing import Any, Binary... | @register_dataset(NAME)
class Coco(Dataset):
'''
- **homepage**: https://cocodataset.org/
- **dependencies**:
- <pycocotools `https://github.com/cocodataset/cocoapi`>_
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', year: str='2017', annotations: Optional[str]=... | 14 | 1 | 16 | 1 | 14 | 1 | 1 | 0.06 | 1 | 20 | 7 | 0 | 12 | 5 | 12 | 39 | 232 | 34 | 187 | 63 | 160 | 12 | 89 | 49 | 75 | 3 | 5 | 1 | 17 |
18,538 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/country211.py | torchvision.prototype.datasets._builtin.country211.Country211 | from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from typing import Any, Union
import pathlib
from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling, path_comparator, read_categories_file
from .._api import register_dataset, register_... | @register_dataset(NAME)
class Country211(Dataset):
'''
- **homepage**: https://github.com/openai/CLIP/blob/main/data/country211.md
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
pass
def _resources(self) -> list[Onli... | 9 | 1 | 7 | 0 | 6 | 0 | 1 | 0.07 | 1 | 11 | 4 | 0 | 7 | 3 | 7 | 34 | 57 | 9 | 45 | 23 | 31 | 3 | 26 | 16 | 18 | 2 | 5 | 0 | 8 |
18,539 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/cub200.py | torchvision.prototype.datasets._builtin.cub200.CUB200 | import functools
from typing import Any, BinaryIO, Callable, Optional, Union
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, GDriveResource, OnlineResource
from torchvision.prototype.tv_tensors import Label
from torchvision.tv_tensors import BoundingBoxes
from .._api import register_dataset, reg... | @register_dataset(NAME)
class CUB200(Dataset):
'''
- **homepage**: http://www.vision.caltech.edu/visipedia/CUB-200.html
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', year: str='2011', skip_integrity_check: bool=False) -> None:
pass
def _resources(self) -> li... | 16 | 1 | 14 | 1 | 13 | 0 | 1 | 0.04 | 1 | 15 | 5 | 0 | 14 | 3 | 14 | 41 | 220 | 30 | 185 | 58 | 154 | 7 | 86 | 42 | 71 | 5 | 5 | 1 | 20 |
18,540 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/dtd.py | torchvision.prototype.datasets._builtin.dtd.DTD | from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from .._api import register_dataset, register_info
from torchvision.prototype.tv_tensors import Label
from torchvision.prototype.datasets.utils._internal import getitem, hint_sharding, hint_shuffling, INFINITE_BUFFER_SI... | @register_dataset(NAME)
class DTD(Dataset):
'''DTD Dataset.
homepage="https://www.robots.ox.ac.uk/~vgg/data/dtd/",
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', fold: int=1, skip_validation_check: bool=False) -> None:
pass
def _resources(self) -> list[Online... | 11 | 1 | 10 | 1 | 9 | 0 | 1 | 0.06 | 1 | 14 | 5 | 0 | 9 | 3 | 9 | 36 | 105 | 21 | 80 | 32 | 63 | 5 | 48 | 24 | 38 | 4 | 5 | 2 | 13 |
18,541 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/dtd.py | torchvision.prototype.datasets._builtin.dtd.DTDDemux | import enum
class DTDDemux(enum.IntEnum):
SPLIT = 0
JOINT_CATEGORIES = 1
IMAGES = 2 |
class DTDDemux(enum.IntEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 3 | 0 | 0 |
18,542 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/eurosat.py | torchvision.prototype.datasets._builtin.eurosat.EuroSAT | from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from typing import Any, Union
from torchvision.prototype.tv_tensors import Label
from torchdata.datapipes.iter import IterDataPipe, Mapper
import pathlib
from torchvision.prototype.datasets.utils._internal import hint_s... | @register_dataset(NAME)
class EuroSAT(Dataset):
'''EuroSAT Dataset.
homepage="https://github.com/phelber/eurosat",
'''
def __init__(self, root: Union[str, pathlib.Path], *, skip_integrity_check: bool=False) -> None:
pass
def _resources(self) -> list[OnlineResource]:
pass
def _... | 7 | 1 | 5 | 0 | 5 | 0 | 1 | 0.12 | 1 | 11 | 4 | 0 | 5 | 1 | 5 | 32 | 34 | 5 | 26 | 10 | 20 | 3 | 17 | 10 | 11 | 1 | 5 | 0 | 5 |
18,543 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/fer2013.py | torchvision.prototype.datasets._builtin.fer2013.FER2013 | from torchdata.datapipes.iter import CSVDictParser, IterDataPipe, Mapper
from torchvision.prototype.tv_tensors import Label
from torchvision.prototype.datasets.utils import Dataset, KaggleDownloadResource, OnlineResource
import torch
from .._api import register_dataset, register_info
from torchvision.tv_tensors import ... | @register_dataset(NAME)
class FER2013(Dataset):
'''FER 2013 Dataset
homepage="https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge"
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
... | 7 | 1 | 6 | 0 | 5 | 0 | 1 | 0.09 | 1 | 11 | 4 | 0 | 5 | 2 | 5 | 32 | 43 | 8 | 32 | 14 | 24 | 3 | 20 | 12 | 14 | 2 | 5 | 0 | 7 |
18,544 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/food101.py | torchvision.prototype.datasets._builtin.food101.Food101 | from typing import Any, BinaryIO, Optional, Union
from torchvision.prototype.datasets.utils._internal import getitem, hint_sharding, hint_shuffling, INFINITE_BUFFER_SIZE, path_comparator, read_categories_file
from .._api import register_dataset, register_info
from torchvision.prototype.datasets.utils import Dataset, En... | @register_dataset(NAME)
class Food101(Dataset):
'''Food 101 dataset
homepage="https://data.vision.ee.ethz.ch/cvl/datasets_extra/food-101",
'''
def __init__(self, root: Union[str, Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
pass
def _resources(self) -> list[Onli... | 10 | 1 | 7 | 0 | 7 | 0 | 1 | 0.05 | 1 | 13 | 4 | 0 | 8 | 2 | 8 | 35 | 70 | 11 | 56 | 19 | 47 | 3 | 36 | 19 | 27 | 3 | 5 | 1 | 11 |
18,545 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/gtsrb.py | torchvision.prototype.datasets._builtin.gtsrb.GTSRB | from typing import Any, Optional, Union
from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling, INFINITE_BUFFER_SIZE, path_comparator
from torchvision.prototype.tv_tensors import Label
from torchdata.datapipes.iter import CSVDictParser, Demultiplexer, Filter, IterDataPipe, Mapper, Zipp... | @register_dataset(NAME)
class GTSRB(Dataset):
'''GTSRB Dataset
homepage="https://benchmark.ini.rub.de"
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
pass
def _resources(self) -> list[OnlineResource]:
pass
... | 8 | 1 | 10 | 1 | 9 | 0 | 2 | 0.08 | 1 | 11 | 5 | 0 | 6 | 2 | 6 | 33 | 85 | 15 | 65 | 21 | 56 | 5 | 36 | 19 | 29 | 3 | 5 | 1 | 11 |
18,546 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/imagenet.py | torchvision.prototype.datasets._builtin.imagenet.CategoryAndWordNetIDExtractor | from torchvision.prototype.datasets.utils._internal import getitem, hint_sharding, hint_shuffling, INFINITE_BUFFER_SIZE, path_accessor, read_categories_file, read_mat
from typing import Any, BinaryIO, cast, Optional, Union
from torchdata.datapipes.iter import Demultiplexer, Enumerator, Filter, IterDataPipe, IterKeyZipp... |
class CategoryAndWordNetIDExtractor(IterDataPipe):
def __init__(self, datapipe: IterDataPipe[tuple[str, BinaryIO]]) -> None:
pass
def __iter__(self) -> Iterator[tuple[str, str]]:
pass | 3 | 0 | 6 | 1 | 5 | 1 | 3 | 0.21 | 1 | 2 | 0 | 0 | 2 | 1 | 2 | 2 | 20 | 3 | 14 | 8 | 11 | 3 | 11 | 8 | 8 | 4 | 1 | 3 | 5 |
18,547 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/imagenet.py | torchvision.prototype.datasets._builtin.imagenet.ImageNet | from torchvision.prototype.datasets.utils import Dataset, EncodedImage, ManualDownloadResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import getitem, hint_sharding, hint_shuffling, INFINITE_BUFFER_SIZE, path_accessor, read_categories_file, read_mat
from typing import Any, BinaryIO, cast, Op... | @register_dataset(NAME)
class ImageNet(Dataset):
'''
- **homepage**: https://www.image-net.org/
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
pass
def _resources(self) -> list[OnlineResource]:
pass
def ... | 14 | 1 | 10 | 1 | 9 | 0 | 2 | 0.06 | 1 | 16 | 6 | 0 | 12 | 4 | 12 | 39 | 150 | 29 | 116 | 53 | 92 | 7 | 75 | 42 | 62 | 4 | 5 | 2 | 18 |
18,548 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/imagenet.py | torchvision.prototype.datasets._builtin.imagenet.ImageNetDemux | import enum
class ImageNetDemux(enum.IntEnum):
META = 0
LABEL = 1 |
class ImageNetDemux(enum.IntEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 3 | 0 | 3 | 3 | 2 | 0 | 3 | 3 | 2 | 0 | 3 | 0 | 0 |
18,549 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/imagenet.py | torchvision.prototype.datasets._builtin.imagenet.ImageNetResource | from torchvision.prototype.datasets.utils import Dataset, EncodedImage, ManualDownloadResource, OnlineResource
from typing import Any, BinaryIO, cast, Optional, Union
class ImageNetResource(ManualDownloadResource):
def __init__(self, **kwargs: Any) -> None:
super().__init__('Register on https://image-net.... |
class ImageNetResource(ManualDownloadResource):
def __init__(self, **kwargs: Any) -> None:
pass | 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 32 | 3 | 0 | 3 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
18,550 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/mnist.py | torchvision.prototype.datasets._builtin.mnist.EMNIST | from .._api import register_dataset, register_info
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
import torch
import pathlib
from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling, INFINITE_BUFFER_SIZE
from typing import Any, BinaryIO, cast, Opt... | @register_dataset('emnist')
class EMNIST(_MNISTBase):
'''
- **homepage**: https://www.westernsydney.edu.au/icns/reproducible_research/publication_support_materials/emnist
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', image_set: str='Balanced', skip_integrity_check: bool=... | 9 | 1 | 11 | 0 | 9 | 1 | 1 | 0.15 | 1 | 9 | 2 | 0 | 7 | 2 | 7 | 39 | 101 | 10 | 79 | 28 | 64 | 12 | 34 | 21 | 26 | 3 | 6 | 1 | 10 |
18,551 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/mnist.py | torchvision.prototype.datasets._builtin.mnist.FashionMNIST | from .._api import register_dataset, register_info
@register_dataset('fashionmnist')
class FashionMNIST(MNIST):
"""
- **homepage**: https://github.com/zalandoresearch/fashion-mnist
"""
_URL_BASE = 'http://fashion-mnist.s3-website.eu-central-1.amazonaws.com'
_CHECKSUMS = {'train-images-idx3-ubyte.gz... | @register_dataset('fashionmnist')
class FashionMNIST(MNIST):
'''
- **homepage**: https://github.com/zalandoresearch/fashion-mnist
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0.33 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 35 | 14 | 2 | 9 | 4 | 8 | 3 | 4 | 4 | 3 | 0 | 7 | 0 | 0 |
18,552 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/mnist.py | torchvision.prototype.datasets._builtin.mnist.KMNIST | from .._api import register_dataset, register_info
@register_dataset('kmnist')
class KMNIST(MNIST):
"""
- **homepage**: http://codh.rois.ac.jp/kmnist/index.html.en
"""
_URL_BASE = 'http://codh.rois.ac.jp/kmnist/dataset/kmnist'
_CHECKSUMS = {'train-images-idx3-ubyte.gz': '51467d22d8cc72929e2a028a042... | @register_dataset('kmnist')
class KMNIST(MNIST):
'''
- **homepage**: http://codh.rois.ac.jp/kmnist/index.html.en
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0.33 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 35 | 14 | 2 | 9 | 4 | 8 | 3 | 4 | 4 | 3 | 0 | 7 | 0 | 0 |
18,553 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/mnist.py | torchvision.prototype.datasets._builtin.mnist.MNIST | import pathlib
from typing import Any, BinaryIO, cast, Optional, Union
from collections.abc import Iterator, Sequence
from .._api import register_dataset, register_info
@register_dataset('mnist')
class MNIST(_MNISTBase):
"""
- **homepage**: http://yann.lecun.com/exdb/mnist
"""
def __init__(self, root:... | @register_dataset('mnist')
class MNIST(_MNISTBase):
'''
- **homepage**: http://yann.lecun.com/exdb/mnist
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
pass
def _files_and_checksums(self) -> tuple[tuple[str, str], tu... | 5 | 1 | 6 | 0 | 6 | 0 | 2 | 0.1 | 1 | 5 | 0 | 2 | 3 | 1 | 3 | 35 | 39 | 5 | 31 | 17 | 21 | 3 | 14 | 11 | 10 | 2 | 6 | 0 | 5 |
18,554 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/mnist.py | torchvision.prototype.datasets._builtin.mnist.MNISTFileReader | import torch
from torchdata.datapipes.iter import Decompressor, Demultiplexer, IterDataPipe, Mapper, Zipper
from typing import Any, BinaryIO, cast, Optional, Union
from torchvision.prototype.utils._internal import fromfile
import functools
from collections.abc import Iterator, Sequence
class MNISTFileReader(IterDataPi... |
class MNISTFileReader(IterDataPipe[torch.Tensor]):
def __init__(self, datapipe: IterDataPipe[tuple[Any, BinaryIO]], *, start: Optional[int], stop: Optional[int]) -> None:
pass
def __iter__(self) -> Iterator[torch.Tensor]:
pass | 3 | 0 | 15 | 3 | 13 | 0 | 5 | 0 | 1 | 6 | 0 | 0 | 2 | 3 | 2 | 2 | 41 | 7 | 34 | 20 | 29 | 0 | 24 | 18 | 21 | 8 | 1 | 3 | 9 |
18,555 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/mnist.py | torchvision.prototype.datasets._builtin.mnist.QMNIST | from .._api import register_dataset, register_info
from typing import Any, BinaryIO, cast, Optional, Union
import pathlib
import torch
@register_dataset('qmnist')
class QMNIST(_MNISTBase):
"""
- **homepage**: https://github.com/facebookresearch/qmnist
"""
def __init__(self, root: Union[str, pathlib.Pa... | @register_dataset('qmnist')
class QMNIST(_MNISTBase):
'''
- **homepage**: https://github.com/facebookresearch/qmnist
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
pass
def _files_and_checksums(self) -> tuple[tuple[s... | 7 | 1 | 11 | 0 | 10 | 0 | 2 | 0.05 | 1 | 9 | 0 | 0 | 5 | 1 | 5 | 37 | 75 | 9 | 63 | 23 | 51 | 3 | 32 | 17 | 26 | 4 | 6 | 1 | 10 |
18,556 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/mnist.py | torchvision.prototype.datasets._builtin.mnist._MNISTBase | import torch
from torchdata.datapipes.iter import Decompressor, Demultiplexer, IterDataPipe, Mapper, Zipper
from collections.abc import Iterator, Sequence
from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling, INFINITE_BUFFER_SIZE
from typing import Any, BinaryIO, cast, Optional, Unio... |
class _MNISTBase(Dataset):
@abc.abstractmethod
def _files_and_checksums(self) -> tuple[tuple[str, str], tuple[str, str]]:
pass
def _resources(self) -> list[OnlineResource]:
pass
def start_and_stop(self) -> tuple[Optional[int], Optional[int]]:
pass
def _prepare_sample(sel... | 7 | 0 | 8 | 1 | 7 | 0 | 1 | 0 | 1 | 10 | 5 | 3 | 5 | 0 | 5 | 32 | 51 | 13 | 38 | 19 | 31 | 0 | 31 | 16 | 25 | 2 | 5 | 1 | 6 |
18,557 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/oxford_iiit_pet.py | torchvision.prototype.datasets._builtin.oxford_iiit_pet.OxfordIIITPet | import pathlib
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import getitem, hint_sharding, hint_shuffling, INFINITE_BUFFER_SIZE, path_accessor, path_comparator, read_categories_file
from .._api import register_da... | @register_dataset(NAME)
class OxfordIIITPet(Dataset):
'''Oxford IIIT Pet Dataset
homepage="https://www.robots.ox.ac.uk/~vgg/data/pets/",
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='trainval', skip_integrity_check: bool=False) -> None:
pass
def _resources(self) -> ... | 12 | 1 | 10 | 1 | 9 | 0 | 1 | 0.03 | 1 | 14 | 5 | 0 | 10 | 2 | 10 | 37 | 112 | 19 | 90 | 30 | 75 | 3 | 46 | 26 | 35 | 2 | 5 | 0 | 12 |
18,558 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/oxford_iiit_pet.py | torchvision.prototype.datasets._builtin.oxford_iiit_pet.OxfordIIITPetDemux | import enum
class OxfordIIITPetDemux(enum.IntEnum):
SPLIT_AND_CLASSIFICATION = 0
SEGMENTATIONS = 1 |
class OxfordIIITPetDemux(enum.IntEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 3 | 0 | 3 | 3 | 2 | 0 | 3 | 3 | 2 | 0 | 3 | 0 | 0 |
18,559 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/pcam.py | torchvision.prototype.datasets._builtin.pcam.PCAM | from torchdata.datapipes.iter import IterDataPipe, Mapper, Zipper
from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling
from torchvision.prototype.datasets.utils import Dataset, GDriveResource, OnlineResource
from torchvision.prototype.tv_tensors import Label
from typing import Any, O... | @register_dataset(NAME)
class PCAM(Dataset):
'''PCAM Dataset
homepage="https://github.com/basveeling/pcam"
'''
def __init__(self, root: Union[str, pathlib.Path], split: str='train', *, skip_integrity_check: bool=False) -> None:
pass
def _resources(self) -> list[OnlineResource]:
pas... | 7 | 1 | 6 | 1 | 5 | 0 | 1 | 0.18 | 1 | 11 | 5 | 0 | 5 | 2 | 5 | 32 | 81 | 11 | 66 | 14 | 58 | 12 | 21 | 12 | 15 | 2 | 5 | 0 | 6 |
18,560 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/pcam.py | torchvision.prototype.datasets._builtin.pcam.PCAMH5Reader | from collections.abc import Iterator
from torchdata.datapipes.iter import IterDataPipe, Mapper, Zipper
from typing import Any, Optional, Union
import io
class PCAMH5Reader(IterDataPipe[tuple[str, io.IOBase]]):
def __init__(self, datapipe: IterDataPipe[tuple[str, io.IOBase]], key: Optional[str]=None) -> None:
... |
class PCAMH5Reader(IterDataPipe[tuple[str, io.IOBase]]):
def __init__(self, datapipe: IterDataPipe[tuple[str, io.IOBase]], key: Optional[str]=None) -> None:
pass
def __iter__(self) -> Iterator[tuple[str, io.IOBase]]:
pass | 3 | 0 | 9 | 1 | 9 | 1 | 2 | 0.06 | 1 | 2 | 0 | 0 | 2 | 2 | 2 | 2 | 20 | 2 | 18 | 12 | 10 | 1 | 13 | 7 | 9 | 3 | 1 | 4 | 4 |
18,561 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/sbd.py | torchvision.prototype.datasets._builtin.sbd.SBD | import torch
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
from typing import Any, BinaryIO, cast, Optional, Union
import numpy as np
import pathlib
import re
from torchvision.prototype.datasets.utils._internal import getitem, hint_sharding, hint_shuffling, INFINIT... | @register_dataset(NAME)
class SBD(Dataset):
'''
- **homepage**: http://home.bharathh.info/pubs/codes/SBD/download.html
- **dependencies**:
- <scipy `https://scipy.org`>_
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
... | 9 | 1 | 17 | 2 | 15 | 1 | 2 | 0.08 | 1 | 15 | 3 | 0 | 7 | 2 | 7 | 34 | 135 | 19 | 109 | 34 | 95 | 9 | 55 | 28 | 47 | 5 | 5 | 2 | 14 |
18,562 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/semeion.py | torchvision.prototype.datasets._builtin.semeion.SEMEION | import torch
from torchvision.prototype.tv_tensors import OneHotLabel
from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling
from torchdata.datapipes.iter import CSVParser, IterDataPipe, Mapper
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from ... | @register_dataset(NAME)
class SEMEION(Dataset):
'''Semeion dataset
homepage="https://archive.ics.uci.edu/ml/datasets/Semeion+Handwritten+Digit",
'''
def __init__(self, root: Union[str, pathlib.Path], *, skip_integrity_check: bool=False) -> None:
pass
def _resources(self) -> list[OnlineReso... | 7 | 1 | 5 | 0 | 5 | 0 | 1 | 0.13 | 1 | 12 | 4 | 0 | 5 | 1 | 5 | 32 | 34 | 7 | 24 | 10 | 18 | 3 | 18 | 10 | 12 | 1 | 5 | 0 | 5 |
18,563 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/stanford_cars.py | torchvision.prototype.datasets._builtin.stanford_cars.StanfordCars | from torchvision.tv_tensors import BoundingBoxes
from torchdata.datapipes.iter import Filter, IterDataPipe, Mapper, Zipper
from typing import Any, BinaryIO, Union
from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling, path_comparator, read_categories_file, read_mat
import pathlib
from... | @register_dataset(NAME)
class StanfordCars(Dataset):
'''Stanford Cars dataset.
homepage="https://ai.stanford.edu/~jkrause/cars/car_dataset.html",
dependencies=scipy
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
pass
... | 8 | 1 | 9 | 1 | 8 | 0 | 2 | 0.06 | 1 | 15 | 6 | 0 | 6 | 2 | 6 | 33 | 79 | 13 | 62 | 27 | 49 | 4 | 36 | 21 | 29 | 2 | 5 | 1 | 9 |
18,564 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/stanford_cars.py | torchvision.prototype.datasets._builtin.stanford_cars.StanfordCarsLabelReader | from typing import Any, BinaryIO, Union
from collections.abc import Iterator
from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling, path_comparator, read_categories_file, read_mat
from torchdata.datapipes.iter import Filter, IterDataPipe, Mapper, Zipper
class StanfordCarsLabelReader(... |
class StanfordCarsLabelReader(IterDataPipe[tuple[int, int, int, int, int, str]]):
def __init__(self, datapipe: IterDataPipe[dict[str, Any]]) -> None:
pass
def __iter__(self) -> Iterator[tuple[int, int, int, int, int, str]]:
pass | 3 | 0 | 4 | 0 | 4 | 1 | 2 | 0.13 | 1 | 4 | 0 | 0 | 2 | 1 | 2 | 2 | 9 | 1 | 8 | 7 | 5 | 1 | 8 | 7 | 5 | 3 | 1 | 2 | 4 |
18,565 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/svhn.py | torchvision.prototype.datasets._builtin.svhn.SVHN | from typing import Any, BinaryIO, Union
from torchdata.datapipes.iter import IterDataPipe, Mapper, UnBatcher
import numpy as np
from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
from .._api import register_dataset, register_info
from torchvision.prototype.datasets.utils._internal im... | @register_dataset(NAME)
class SVHN(Dataset):
'''SVHN Dataset.
homepage="http://ufldl.stanford.edu/housenumbers/",
dependencies = scipy
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
pass
def _resources(self) -> l... | 8 | 1 | 8 | 0 | 7 | 0 | 1 | 0.08 | 1 | 14 | 4 | 0 | 6 | 2 | 6 | 33 | 63 | 9 | 50 | 21 | 37 | 4 | 25 | 15 | 18 | 1 | 5 | 0 | 6 |
18,566 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/usps.py | torchvision.prototype.datasets._builtin.usps.USPS | from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling
from torchvision.prototype.tv_tensors import Label
import pathlib
from torchdata.datapipes.iter import Decompressor, IterDataPipe, LineReader, Mapper
from torchvision.tv_tensors import Image
import torch
from torchvision.prototype.... | @register_dataset(NAME)
class USPS(Dataset):
'''USPS Dataset
homepage="https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass.html#usps",
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', skip_integrity_check: bool=False) -> None:
pass
def _resou... | 7 | 1 | 6 | 0 | 6 | 0 | 1 | 0.08 | 1 | 11 | 3 | 0 | 5 | 2 | 5 | 32 | 49 | 8 | 38 | 19 | 26 | 3 | 22 | 13 | 16 | 2 | 5 | 0 | 6 |
18,567 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/_builtin/voc.py | torchvision.prototype.datasets._builtin.voc.VOC | from torchdata.datapipes.iter import Demultiplexer, Filter, IterDataPipe, IterKeyZipper, LineReader, Mapper
from typing import Any, BinaryIO, cast, Optional, Union
import enum
from torchvision.datasets import VOCDetection
from torchvision.prototype.datasets.utils._internal import getitem, hint_sharding, hint_shuffling,... | @register_dataset(NAME)
class VOC(Dataset):
'''
- **homepage**: http://host.robots.ox.ac.uk/pascal/VOC/
'''
def __init__(self, root: Union[str, pathlib.Path], *, split: str='train', year: str='2012', task: str='detection', skip_integrity_check: bool=False) -> None:
pass
def _resources(self... | 15 | 1 | 13 | 1 | 12 | 0 | 2 | 0.02 | 1 | 19 | 7 | 0 | 12 | 6 | 12 | 39 | 190 | 23 | 163 | 54 | 138 | 4 | 71 | 43 | 57 | 4 | 5 | 1 | 21 |
18,568 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/benchmark.py | torchvision.prototype.datasets.benchmark.DatasetBenchmark | import shutil
import pathlib
import os
from torchvision.transforms import PILToTensor
import unittest.mock
import contextlib
import torch
from torchvision.prototype import datasets as new_datasets
import os.path
from torch.utils.data.dataloader_experimental import DataLoader2
import warnings
from torchvision import dat... |
class DatasetBenchmark:
def __init__(self, name: str, *, variant=None, legacy_cls=None, new_config=None, legacy_config_map=None, legacy_special_options_map=None, prepare_legacy_root=None):
pass
def new_dataset(self, *, num_workers=0):
pass
def new_cold_start(self, *, num_workers):
... | 25 | 0 | 11 | 1 | 10 | 0 | 2 | 0 | 0 | 16 | 2 | 0 | 13 | 8 | 14 | 14 | 209 | 41 | 168 | 78 | 133 | 0 | 123 | 58 | 102 | 7 | 0 | 4 | 41 |
18,569 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/benchmark.py | torchvision.prototype.datasets.benchmark.JointTransform | import collections.abc
class JointTransform:
def __init__(self, *transforms):
self.transforms = transforms
def __call__(self, *inputs):
if len(inputs) == 1 and isinstance(inputs, collections.abc.Sequence):
inputs = inputs[0]
if len(inputs) != len(self.transforms):
... |
class JointTransform:
def __init__(self, *transforms):
pass
def __call__(self, *inputs):
pass | 3 | 0 | 6 | 1 | 5 | 0 | 2 | 0 | 0 | 4 | 0 | 0 | 2 | 1 | 2 | 2 | 14 | 3 | 11 | 5 | 8 | 0 | 9 | 4 | 6 | 3 | 0 | 1 | 4 |
18,570 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/benchmark.py | torchvision.prototype.datasets.benchmark.Measurement | import torch
import time
class Measurement:
@classmethod
def time(cls, fn, *, number):
results = Measurement._timeit(fn, number=number)
times = torch.tensor(tuple(zip(*results))[1])
return cls._format(times, unit='s')
@classmethod
def iterations_per_time(cls, fn):
num_... |
class Measurement:
@classmethod
def time(cls, fn, *, number):
pass
@classmethod
def iterations_per_time(cls, fn):
pass
class Timer:
def __init__(self):
pass
def __enter__(self):
pass
def __exit__(self, exc_type, exc_val, e... | 17 | 0 | 5 | 0 | 4 | 0 | 1 | 0.04 | 0 | 4 | 0 | 0 | 0 | 0 | 5 | 5 | 57 | 9 | 46 | 30 | 29 | 2 | 39 | 24 | 28 | 3 | 0 | 1 | 13 |
18,571 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/utils/_dataset.py | torchvision.prototype.datasets.utils._dataset.Dataset | from torchdata.datapipes.iter import IterDataPipe
from collections.abc import Collection, Iterator, Sequence
import abc
from torchvision.datasets.utils import verify_str_arg
import importlib
import pathlib
from typing import Any, Optional, Union
from ._resource import OnlineResource
class Dataset(IterDataPipe[dict[str... |
class Dataset(IterDataPipe[dict[str, Any]], abc.ABC):
@staticmethod
def _verify_str_arg(value: str, arg: Optional[str]=None, valid_values: Optional[Collection[str]]=None, *, custom_msg: Optional[str]=None) -> str:
pass
def __init__(self, root: Union[str, pathlib.Path], *, skip_integrity_check: bo... | 12 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 2 | 7 | 1 | 24 | 6 | 2 | 7 | 27 | 46 | 7 | 39 | 24 | 19 | 0 | 22 | 12 | 14 | 3 | 4 | 2 | 9 |
18,572 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/utils/_encoded.py | torchvision.prototype.datasets.utils._encoded.EncodedData | from torchvision.prototype.utils._internal import fromfile, ReadOnlyTensorBuffer
import torch
from torchvision.tv_tensors._tv_tensor import TVTensor
from typing import Any, BinaryIO, TypeVar
import os
import sys
class EncodedData(TVTensor):
@classmethod
def _wrap(cls: type[D], tensor: torch.Tensor) -> D:
... |
class EncodedData(TVTensor):
@classmethod
def _wrap(cls: type[D], tensor: torch.Tensor) -> D:
pass
def __new__(cls, data: Any, *, dtype: torch.dtype | None=None, device: torch.device | str | int | None=None, requires_grad: bool=False) -> EncodedData:
pass
@classmethod
def wrap_lik... | 10 | 0 | 4 | 0 | 4 | 0 | 1 | 0.04 | 1 | 6 | 0 | 1 | 1 | 0 | 5 | 73 | 31 | 4 | 26 | 20 | 9 | 1 | 15 | 8 | 9 | 1 | 3 | 1 | 5 |
18,573 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/utils/_encoded.py | torchvision.prototype.datasets.utils._encoded.EncodedImage | from torchvision.prototype.utils._internal import fromfile, ReadOnlyTensorBuffer
import PIL.Image
class EncodedImage(EncodedData):
@property
def spatial_size(self) -> tuple[int, int]:
if not hasattr(self, '_spatial_size'):
with PIL.Image.open(ReadOnlyTensorBuffer(self)) as image:
... |
class EncodedImage(EncodedData):
@property
def spatial_size(self) -> tuple[int, int]:
pass | 3 | 0 | 6 | 1 | 5 | 0 | 2 | 0.14 | 1 | 2 | 1 | 0 | 1 | 1 | 1 | 74 | 9 | 1 | 7 | 5 | 4 | 1 | 6 | 3 | 4 | 2 | 4 | 2 | 2 |
18,574 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/utils/_internal.py | torchvision.prototype.datasets.utils._internal.MappingIterator | from collections.abc import Iterator, Sequence, Sized
from typing import Any, BinaryIO, Callable, IO, TypeVar, Union
from torchdata.datapipes.iter import IoPathFileLister, IoPathFileOpener, IterDataPipe, ShardingFilter, Shuffler
class MappingIterator(IterDataPipe[Union[tuple[K, D], D]]):
def __init__(self, datapi... |
class MappingIterator(IterDataPipe[Union[tuple[K, D], D]]):
def __init__(self, datapipe: IterDataPipe[dict[K, D]], *, drop_key: bool=False) -> None:
pass
def __iter__(self) -> Iterator[Union[tuple[K, D], D]]:
pass | 3 | 0 | 3 | 0 | 3 | 0 | 2 | 0 | 1 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 8 | 1 | 7 | 6 | 4 | 0 | 7 | 6 | 4 | 3 | 1 | 1 | 4 |
18,575 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/utils/_internal.py | torchvision.prototype.datasets.utils._internal.PicklerDataPipe | from collections.abc import Iterator, Sequence, Sized
from torchdata.datapipes.iter import IoPathFileLister, IoPathFileOpener, IterDataPipe, ShardingFilter, Shuffler
import pickle
from typing import Any, BinaryIO, Callable, IO, TypeVar, Union
class PicklerDataPipe(IterDataPipe):
def __init__(self, source_datapipe... |
class PicklerDataPipe(IterDataPipe):
def __init__(self, source_datapipe: IterDataPipe[tuple[str, IO[bytes]]]) -> None:
pass
def __iter__(self) -> Iterator[Any]:
pass | 3 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 1 | 5 | 0 | 0 | 2 | 1 | 2 | 2 | 9 | 1 | 8 | 7 | 5 | 0 | 8 | 7 | 5 | 3 | 1 | 2 | 4 |
18,576 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/utils/_internal.py | torchvision.prototype.datasets.utils._internal.SharderDataPipe | import torch.distributed as dist
import torch
from collections.abc import Iterator, Sequence, Sized
from typing import Any, BinaryIO, Callable, IO, TypeVar, Union
from torchdata.datapipes.iter import IoPathFileLister, IoPathFileOpener, IterDataPipe, ShardingFilter, Shuffler
import torch.utils.data
class SharderDataPip... |
class SharderDataPipe(ShardingFilter):
def __init__(self, source_datapipe: IterDataPipe) -> None:
pass
def __iter__(self) -> Iterator[Any]:
pass | 3 | 0 | 9 | 0 | 9 | 0 | 2 | 0 | 1 | 2 | 0 | 0 | 2 | 2 | 2 | 2 | 19 | 1 | 18 | 8 | 15 | 0 | 18 | 8 | 15 | 2 | 1 | 1 | 4 |
18,577 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/utils/_internal.py | torchvision.prototype.datasets.utils._internal.TakerDataPipe | from collections.abc import Iterator, Sequence, Sized
from torchdata.datapipes.iter import IoPathFileLister, IoPathFileOpener, IterDataPipe, ShardingFilter, Shuffler
import torch
import torch.distributed as dist
from typing import Any, BinaryIO, Callable, IO, TypeVar, Union
import torch.utils.data
class TakerDataPipe(... |
class TakerDataPipe(IterDataPipe):
def __init__(self, source_datapipe: IterDataPipe, num_take: int) -> None:
pass
def __iter__(self) -> Iterator[Any]:
pass
def __len__(self) -> int:
pass | 4 | 0 | 9 | 1 | 8 | 1 | 3 | 0.08 | 1 | 4 | 0 | 0 | 3 | 3 | 3 | 3 | 31 | 4 | 25 | 12 | 21 | 2 | 24 | 12 | 20 | 4 | 1 | 2 | 9 |
18,578 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/utils/_resource.py | torchvision.prototype.datasets.utils._resource.GDriveResource | import pathlib
from typing import Any, Callable, IO, Literal, NoReturn, Optional, Union
from torchvision.datasets.utils import _decompress, _detect_file_type, _get_google_drive_file_id, _get_redirect_url, download_file_from_google_drive, download_url, extract_archive
class GDriveResource(OnlineResource):
def __in... |
class GDriveResource(OnlineResource):
def __init__(self, id: str, **kwargs: Any) -> None:
pass
def _download(self, root: pathlib.Path) -> None:
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 4 | 0 | 0 | 2 | 2 | 2 | 31 | 7 | 1 | 6 | 5 | 3 | 0 | 6 | 4 | 3 | 1 | 5 | 0 | 2 |
18,579 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/utils/_resource.py | torchvision.prototype.datasets.utils._resource.HttpResource | from urllib.parse import urlparse
import pathlib
from collections.abc import Sequence
from typing import Any, Callable, IO, Literal, NoReturn, Optional, Union
from torchvision.datasets.utils import _decompress, _detect_file_type, _get_google_drive_file_id, _get_redirect_url, download_file_from_google_drive, download_ur... |
class HttpResource(OnlineResource):
def __init__(self, url: str, *, file_name: Optional[str]=None, mirrors: Sequence[str]=(), **kwargs:
pass
def resolve(self) -> OnlineResource:
pass
def _download(self, root: pathlib.Path) -> None:
pass | 4 | 0 | 16 | 2 | 13 | 1 | 3 | 0.05 | 1 | 8 | 1 | 0 | 3 | 4 | 3 | 32 | 51 | 9 | 40 | 15 | 34 | 2 | 31 | 12 | 27 | 4 | 5 | 2 | 9 |
18,580 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/utils/_resource.py | torchvision.prototype.datasets.utils._resource.KaggleDownloadResource | from typing import Any, Callable, IO, Literal, NoReturn, Optional, Union
class KaggleDownloadResource(ManualDownloadResource):
def __init__(self, challenge_url: str, *, file_name: str, **kwargs: Any) -> None:
instructions = '\n'.join(('1. Register and login at https://www.kaggle.com', f'2. Navigate to {ch... |
class KaggleDownloadResource(ManualDownloadResource):
def __init__(self, challenge_url: str, *, file_name: str, **kwargs: Any) -> None:
pass | 2 | 0 | 11 | 0 | 11 | 0 | 1 | 0 | 1 | 3 | 0 | 0 | 1 | 0 | 1 | 32 | 12 | 0 | 12 | 3 | 10 | 0 | 4 | 3 | 2 | 1 | 6 | 0 | 1 |
18,581 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/utils/_resource.py | torchvision.prototype.datasets.utils._resource.ManualDownloadResource | import pathlib
from typing import Any, Callable, IO, Literal, NoReturn, Optional, Union
class ManualDownloadResource(OnlineResource):
def __init__(self, instructions: str, **kwargs: Any) -> None:
super().__init__(**kwargs)
self.instructions = instructions
def _download(self, root: pathlib.Pat... |
class ManualDownloadResource(OnlineResource):
def __init__(self, instructions: str, **kwargs: Any) -> None:
pass
def _download(self, root: pathlib.Path) -> NoReturn:
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 5 | 0 | 2 | 2 | 1 | 2 | 31 | 11 | 1 | 10 | 4 | 7 | 0 | 6 | 4 | 3 | 1 | 5 | 0 | 2 |
18,582 | pytorch/vision | pytorch_vision/torchvision/prototype/datasets/utils/_resource.py | torchvision.prototype.datasets.utils._resource.OnlineResource | from torchvision.datasets.utils import _decompress, _detect_file_type, _get_google_drive_file_id, _get_redirect_url, download_file_from_google_drive, download_url, extract_archive
from torchdata.datapipes.iter import FileLister, FileOpener, IterableWrapper, IterDataPipe, RarArchiveLoader, TarArchiveLoader, ZipArchiveLo... |
class OnlineResource(abc.ABC):
def __init__(self, *, file_name: str, sha256: Optional[str]=None, preprocess: Optional[Union[Literal['decompress', 'extract'], Callable[[pathlib.Path], None]]]=None) -> None:
pass
@staticmethod
def _extract(file: pathlib.Path) -> None:
pass
@staticmethod
... | 14 | 0 | 11 | 1 | 9 | 2 | 2 | 0.15 | 1 | 7 | 0 | 4 | 7 | 3 | 9 | 29 | 119 | 19 | 88 | 40 | 64 | 13 | 63 | 25 | 52 | 4 | 4 | 2 | 22 |
18,583 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/crestereo.py | torchvision.prototype.models.depth.stereo.crestereo.AdaptiveGroupCorrelationLayer | import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from typing import Callable, Optional
import torch
class AdaptiveGroupCorrelationLayer(nn.Module):
"""
Container for computing various correlation types between a left and right feature map.
This module does not contain any opti... |
class AdaptiveGroupCorrelationLayer(nn.Module):
'''
Container for computing various correlation types between a left and right feature map.
This module does not contain any optimisable parameters, it's solely a collection of ops.
We wrap in a nn.Module for torch.jit.script compatibility
Adaptive Gr... | 3 | 1 | 13 | 1 | 12 | 1 | 2 | 0.32 | 1 | 6 | 2 | 0 | 2 | 2 | 2 | 12 | 37 | 5 | 25 | 18 | 10 | 8 | 10 | 6 | 7 | 2 | 1 | 1 | 3 |
18,584 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/crestereo.py | torchvision.prototype.models.depth.stereo.crestereo.AttentionOffsetCorrelationLayer | from torchvision.models.optical_flow._utils import grid_sample, make_coords_grid, upsample_flow
from torch import Tensor
import torch
from typing import Callable, Optional
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
class AttentionOffsetCorrelationLayer(nn.Module):
def __init__(self, ... |
class AttentionOffsetCorrelationLayer(nn.Module):
def __init__(self, groups: int=4, attention_module: Optional[nn.Module]=None, search_window_1d: tuple[int, int]=(1, 9), search_dilate_1d:
pass
def forward(self, left_feature: Tensor, right_feature: Tensor, flow: Tensor, extra_offset: Tensor, window_ty... | 3 | 1 | 56 | 8 | 41 | 8 | 3 | 0.18 | 1 | 5 | 0 | 0 | 2 | 5 | 2 | 12 | 114 | 17 | 82 | 44 | 64 | 15 | 49 | 28 | 46 | 4 | 1 | 2 | 5 |
18,585 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/crestereo.py | torchvision.prototype.models.depth.stereo.crestereo.CREStereo | from torch import Tensor
from torchvision.ops import Conv2dNormActivation
import torch.nn.functional as F
from functools import partial
from typing import Callable, Optional
import torch
from torchvision.models.optical_flow._utils import grid_sample, make_coords_grid, upsample_flow
import numpy as np
import torchvision... |
class CREStereo(nn.Module):
'''
Implements CREStereo from the `"Practical Stereo Matching via Cascaded Recurrent Network
With Adaptive Correlation" <https://openaccess.thecvf.com/content/CVPR2022/papers/Li_Practical_Stereo_Matching_via_Cascaded_Recurrent_Network_With_Adaptive_Correlation_CVPR_2022_paper.pd... | 4 | 1 | 97 | 12 | 59 | 27 | 5 | 0.54 | 1 | 19 | 11 | 0 | 3 | 14 | 3 | 13 | 311 | 38 | 179 | 74 | 159 | 97 | 96 | 58 | 92 | 6 | 1 | 3 | 14 |
18,586 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/crestereo.py | torchvision.prototype.models.depth.stereo.crestereo.CREStereo_Base_Weights | from torchvision.models._api import register_model, Weights, WeightsEnum
from torchvision.prototype.transforms._presets import StereoMatching
class CREStereo_Base_Weights(WeightsEnum):
"""The metrics reported here are as follows.
``mae`` is the "mean-average-error" and indicates how far (in pixels) the
pr... |
class CREStereo_Base_Weights(WeightsEnum):
'''The metrics reported here are as follows.
``mae`` is the "mean-average-error" and indicates how far (in pixels) the
predicted disparity is from its true value (equivalent to ``epe``). This is averaged over all pixels
of all images. ``1px``, ``3px``, ``5px``... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.06 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 337 | 6 | 311 | 5 | 310 | 20 | 5 | 5 | 4 | 0 | 5 | 0 | 0 |
18,587 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/crestereo.py | torchvision.prototype.models.depth.stereo.crestereo.ConvexMaskPredictor | import torch.nn as nn
from torchvision.ops import Conv2dNormActivation
from torch import Tensor
class ConvexMaskPredictor(nn.Module):
def __init__(self, *, in_channels: int, hidden_size: int, upsample_factor: int, multiplier: float=0.25) -> None:
super().__init__()
self.mask_head = nn.Sequential(C... |
class ConvexMaskPredictor(nn.Module):
def __init__(self, *, in_channels: int, hidden_size: int, upsample_factor: int, multiplier: float=0.25) -> None:
pass
def forward(self, x: Tensor) -> Tensor:
pass | 3 | 0 | 11 | 1 | 9 | 1 | 1 | 0.11 | 1 | 5 | 1 | 0 | 2 | 2 | 2 | 12 | 23 | 3 | 18 | 12 | 8 | 2 | 8 | 5 | 5 | 1 | 1 | 0 | 2 |
18,588 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/crestereo.py | torchvision.prototype.models.depth.stereo.crestereo.IterativeCorrelationLayer | import torch
from torch import Tensor
from torchvision.models.optical_flow._utils import grid_sample, make_coords_grid, upsample_flow
import torch.nn.functional as F
import torch.nn as nn
import numpy as np
class IterativeCorrelationLayer(nn.Module):
def __init__(self, groups: int=4, search_window_1d: tuple[int, ... | null | 3 | 1 | 30 | 4 | 21 | 5 | 2 | 0.23 | 1 | 5 | 0 | 0 | 2 | 4 | 2 | 12 | 61 | 8 | 43 | 24 | 33 | 10 | 23 | 16 | 20 | 2 | 1 | 1 | 3 |
18,589 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/crestereo.py | torchvision.prototype.models.depth.stereo.crestereo.LinearAttention | import torch
from torch import Tensor
from typing import Callable, Optional
import torch.nn as nn
import torch.nn.functional as F
class LinearAttention(nn.Module):
"""
Linear attention operation from: https://arxiv.org/pdf/2006.16236.pdf
Canonical implementation reference: https://github.com/idiap/fast-tra... |
class LinearAttention(nn.Module):
'''
Linear attention operation from: https://arxiv.org/pdf/2006.16236.pdf
Canonical implementation reference: https://github.com/idiap/fast-transformers/blob/master/fast_transformers/attention/linear_attention.py
LoFTR implementation reference: https://github.com/zju3d... | 3 | 2 | 20 | 1 | 13 | 6 | 2 | 0.65 | 1 | 3 | 0 | 0 | 2 | 2 | 2 | 12 | 47 | 4 | 26 | 16 | 16 | 17 | 19 | 9 | 16 | 3 | 1 | 1 | 4 |
18,590 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/crestereo.py | torchvision.prototype.models.depth.stereo.crestereo.LocalFeatureEncoderLayer | import torch.nn as nn
import torch
from typing import Callable, Optional
from torch import Tensor
import torch.nn.functional as F
class LocalFeatureEncoderLayer(nn.Module):
"""
LoFTR transformer module from: https://arxiv.org/pdf/2104.00680.pdf
Canonical implementations at: https://github.com/zju3dv/LoFTR/... |
class LocalFeatureEncoderLayer(nn.Module):
'''
LoFTR transformer module from: https://arxiv.org/pdf/2104.00680.pdf
Canonical implementations at: https://github.com/zju3dv/LoFTR/blob/master/src/loftr/loftr_module/transformer.py
'''
def __init__(self, *, dim_model: int, num_heads: int, attention_mod... | 3 | 2 | 32 | 5 | 20 | 7 | 2 | 0.41 | 1 | 7 | 2 | 0 | 2 | 10 | 2 | 12 | 70 | 12 | 41 | 24 | 30 | 17 | 27 | 16 | 24 | 2 | 1 | 1 | 3 |
18,591 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/crestereo.py | torchvision.prototype.models.depth.stereo.crestereo.LocalFeatureTransformer | import torch.nn as nn
import torch.nn.functional as F
from typing import Callable, Optional
import torch
from torch import Tensor
class LocalFeatureTransformer(nn.Module):
"""
LoFTR transformer module from: https://arxiv.org/pdf/2104.00680.pdf
Canonical implementations at: https://github.com/zju3dv/LoFTR/b... |
class LocalFeatureTransformer(nn.Module):
'''
LoFTR transformer module from: https://arxiv.org/pdf/2104.00680.pdf
Canonical implementations at: https://github.com/zju3dv/LoFTR/blob/master/src/loftr/loftr_module/transformer.py
'''
def __init__(self, *, dim_model: int, num_heads: int, attention_dire... | 3 | 2 | 30 | 4 | 21 | 5 | 4 | 0.33 | 1 | 8 | 2 | 0 | 2 | 3 | 2 | 12 | 66 | 9 | 43 | 23 | 27 | 14 | 19 | 9 | 16 | 4 | 1 | 2 | 7 |
18,592 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/crestereo.py | torchvision.prototype.models.depth.stereo.crestereo.PositionalEncodingSine | import math
import torch.nn as nn
from torch import Tensor
import torch.nn.functional as F
import torch
class PositionalEncodingSine(nn.Module):
"""
Sinusoidal positional encodings
Using the scaling term from https://github.com/megvii-research/CREStereo/blob/master/nets/attention/position_encoding.py
... |
class PositionalEncodingSine(nn.Module):
'''
Sinusoidal positional encodings
Using the scaling term from https://github.com/megvii-research/CREStereo/blob/master/nets/attention/position_encoding.py
Reference implementation from https://github.com/facebookresearch/detr/blob/8a144f83a287f4d3fece4acdf073f... | 4 | 2 | 11 | 1 | 8 | 3 | 1 | 0.5 | 1 | 3 | 0 | 0 | 3 | 2 | 3 | 13 | 44 | 6 | 26 | 12 | 22 | 13 | 23 | 12 | 19 | 1 | 1 | 0 | 3 |
18,593 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/crestereo.py | torchvision.prototype.models.depth.stereo.crestereo.PyramidDownsample | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from collections.abc import Iterable
class PyramidDownsample(nn.Module):
"""
A simple wrapper that return and Avg Pool feature pyramid based on the provided scales.
Implicitly returns the input as well.
"""
... |
class PyramidDownsample(nn.Module):
'''
A simple wrapper that return and Avg Pool feature pyramid based on the provided scales.
Implicitly returns the input as well.
'''
def __init__(self, factors: Iterable[int]) -> None:
pass
def forward(self, x: torch.Tensor) -> list[Tensor]:
... | 3 | 1 | 4 | 0 | 4 | 0 | 2 | 0.44 | 1 | 3 | 0 | 0 | 2 | 1 | 2 | 12 | 15 | 2 | 9 | 6 | 6 | 4 | 9 | 6 | 6 | 2 | 1 | 1 | 3 |
18,594 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/crestereo.py | torchvision.prototype.models.depth.stereo.crestereo.SoftmaxAttention | import torch.nn as nn
import torch.nn.functional as F
import torch
from typing import Callable, Optional
from torch import Tensor
class SoftmaxAttention(nn.Module):
"""
A simple softmax attention operation
LoFTR implementation reference: https://github.com/zju3dv/LoFTR/blob/2122156015b61fbb650e28b58a958e4... |
class SoftmaxAttention(nn.Module):
'''
A simple softmax attention operation
LoFTR implementation reference: https://github.com/zju3dv/LoFTR/blob/2122156015b61fbb650e28b58a958e4d632b1058/src/loftr/loftr_module/linear_attention.py
'''
def __init__(self, dropout: float=0.0) -> None:
pass
... | 3 | 2 | 18 | 3 | 10 | 6 | 2 | 0.76 | 1 | 3 | 0 | 0 | 2 | 1 | 2 | 12 | 43 | 7 | 21 | 15 | 11 | 16 | 14 | 8 | 11 | 2 | 1 | 1 | 4 |
18,595 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/raft_stereo.py | torchvision.prototype.models.depth.stereo.raft_stereo.BaseEncoder | from torchvision.models.optical_flow.raft import FlowHead, MotionEncoder, ResidualBlock
import torchvision.models.optical_flow.raft as raft
import torch.nn as nn
from typing import Callable, Optional
class BaseEncoder(raft.FeatureEncoder):
"""Base encoder for FeatureEncoder and ContextEncoder in which weight may b... |
class BaseEncoder(raft.FeatureEncoder):
'''Base encoder for FeatureEncoder and ContextEncoder in which weight may be shared.
See the Raft-Stereo paper section 4.6 on backbone part.
'''
def __init__(self, *, block: Callable[..., nn.Module]=ResidualBlock, layers: tuple[int, int, int, int]=(64, 64, 96, 1... | 2 | 1 | 18 | 2 | 13 | 3 | 1 | 0.43 | 1 | 3 | 1 | 0 | 1 | 3 | 1 | 14 | 24 | 4 | 14 | 13 | 5 | 6 | 7 | 6 | 5 | 1 | 2 | 0 | 1 |
18,596 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/raft_stereo.py | torchvision.prototype.models.depth.stereo.raft_stereo.ConvGRU | from torch import Tensor
import torch.nn.functional as F
import torch
import torchvision.models.optical_flow.raft as raft
import torch.nn as nn
class ConvGRU(raft.ConvGRU):
"""Convolutional Gru unit."""
def forward(self, h: Tensor, x: Tensor, context: list[Tensor]) -> Tensor:
hx = torch.cat([h, x], di... |
class ConvGRU(raft.ConvGRU):
'''Convolutional Gru unit.'''
def forward(self, h: Tensor, x: Tensor, context: list[Tensor]) -> Tensor:
pass | 2 | 1 | 7 | 0 | 7 | 1 | 1 | 0.5 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 13 | 12 | 1 | 8 | 6 | 6 | 4 | 8 | 6 | 6 | 1 | 2 | 0 | 1 |
18,597 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/raft_stereo.py | torchvision.prototype.models.depth.stereo.raft_stereo.CorrBlock1d | from torchvision.models.optical_flow._utils import grid_sample, make_coords_grid, upsample_flow
from torch import Tensor
import torch
import torch.nn.functional as F
import torch.nn as nn
class CorrBlock1d(nn.Module):
"""The row-wise correlation block.
Use indexes from correlation pyramid to create correlatio... |
class CorrBlock1d(nn.Module):
'''The row-wise correlation block.
Use indexes from correlation pyramid to create correlation features.
The "indexing" of a given centroid pixel x' is done by concatenating its surrounding row neighbours
within radius
'''
def __init__(self, *, num_levels: int=4, r... | 3 | 2 | 17 | 2 | 14 | 3 | 2 | 0.36 | 1 | 3 | 0 | 0 | 2 | 2 | 2 | 12 | 42 | 7 | 28 | 16 | 25 | 10 | 23 | 16 | 20 | 2 | 1 | 1 | 3 |
18,598 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/raft_stereo.py | torchvision.prototype.models.depth.stereo.raft_stereo.CorrPyramid1d | import torch.nn.functional as F
import torch.nn as nn
import torch
from torch import Tensor
class CorrPyramid1d(nn.Module):
"""Row-wise correlation pyramid.
Create a row-wise correlation pyramid with ``num_levels`` level from the outputs of the feature encoder,
this correlation pyramid will later be used ... |
class CorrPyramid1d(nn.Module):
'''Row-wise correlation pyramid.
Create a row-wise correlation pyramid with ``num_levels`` level from the outputs of the feature encoder,
this correlation pyramid will later be used as index to create correlation features using CorrBlock1d.
'''
def __init__(self, nu... | 3 | 2 | 16 | 3 | 10 | 3 | 2 | 0.43 | 1 | 4 | 0 | 0 | 2 | 1 | 2 | 12 | 39 | 9 | 21 | 9 | 18 | 9 | 18 | 9 | 15 | 2 | 1 | 1 | 3 |
18,599 | pytorch/vision | pytorch_vision/torchvision/prototype/models/depth/stereo/raft_stereo.py | torchvision.prototype.models.depth.stereo.raft_stereo.FeatureEncoder | from torch import Tensor
from torchvision.models.optical_flow.raft import FlowHead, MotionEncoder, ResidualBlock
import torch.nn as nn
from typing import Callable, Optional
class FeatureEncoder(nn.Module):
"""Feature Encoder for Raft-Stereo (see paper section 3.1) that may have shared weight with the Context Encod... |
class FeatureEncoder(nn.Module):
'''Feature Encoder for Raft-Stereo (see paper section 3.1) that may have shared weight with the Context Encoder.
The FeatureEncoder takes concatenation of left and right image as input. It produces feature embedding that later
will be used to construct correlation volume.
... | 3 | 1 | 13 | 1 | 11 | 2 | 2 | 0.3 | 1 | 6 | 2 | 0 | 2 | 4 | 2 | 12 | 34 | 4 | 23 | 14 | 14 | 7 | 16 | 8 | 13 | 2 | 1 | 1 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.