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,200
pytorch/vision
pytorch_vision/torchvision/datasets/widerface.py
torchvision.datasets.widerface.WIDERFace
from .utils import download_and_extract_archive, download_file_from_google_drive, extract_archive, verify_str_arg from .vision import VisionDataset from typing import Any, Callable, Optional, Union from PIL import Image from pathlib import Path import os from os.path import abspath, expanduser import torch class WIDER...
class WIDERFace(VisionDataset): '''`WIDERFace <http://shuoyang1213.me/WIDERFACE/>`_ Dataset. Args: root (str or ``pathlib.Path``): Root directory where images and annotations are downloaded to. Expects the following folder structure if download=False: .. code:: <...
9
2
17
1
14
2
3
0.31
1
8
0
0
8
3
8
18
183
26
121
48
105
38
85
38
76
7
3
4
25
18,201
pytorch/vision
pytorch_vision/torchvision/io/_video_opt.py
torchvision.io._video_opt.Timebase
class Timebase: __annotations__ = {'numerator': int, 'denominator': int} __slots__ = ['numerator', 'denominator'] def __init__(self, numerator: int, denominator: int) -> None: self.numerator = numerator self.denominator = denominator
class Timebase: def __init__(self, numerator: int, denominator: int) -> None: pass
2
0
7
0
7
0
1
0
0
1
0
0
1
2
1
1
11
1
10
10
4
0
6
6
4
1
0
0
1
18,202
pytorch/vision
pytorch_vision/torchvision/io/_video_opt.py
torchvision.io._video_opt.VideoMetaData
class VideoMetaData: __annotations__ = {'has_video': bool, 'video_timebase': Timebase, 'video_duration': float, 'video_fps': float, 'has_audio': bool, 'audio_timebase': Timebase, 'audio_duration': float, 'audio_sample_rate': float} __slots__ = ['has_video', 'video_timebase', 'video_duration', 'video_fps', 'has_...
class VideoMetaData: def __init__(self) -> None: pass
2
0
9
0
9
0
1
0
0
1
1
0
1
8
1
1
31
1
30
12
28
0
12
12
10
1
0
0
1
18,203
pytorch/vision
pytorch_vision/torchvision/io/image.py
torchvision.io.image.ImageReadMode
from enum import Enum class ImageReadMode(Enum): """Allow automatic conversion to RGB, RGBA, etc while decoding. .. note:: You don't need to use this struct, you can just pass strings to all ``mode`` parameters, e.g. ``mode="RGB"``. The different available modes are the following. -...
class ImageReadMode(Enum): '''Allow automatic conversion to RGB, RGBA, etc while decoding. .. note:: You don't need to use this struct, you can just pass strings to all ``mode`` parameters, e.g. ``mode="RGB"``. The different available modes are the following. - UNCHANGED: loads the imag...
1
1
0
0
0
0
0
2.14
1
0
0
0
0
0
0
49
28
7
7
7
6
15
7
7
6
0
4
0
0
18,204
pytorch/vision
pytorch_vision/torchvision/io/video_reader.py
torchvision.io.video_reader.VideoReader
from ..utils import _log_api_usage_once from typing import Any import torch from collections.abc import Iterator import warnings from ._video_deprecation_warning import _raise_video_deprecation_warning import io class VideoReader: """[DEPRECATED] Fine-grained video-reading API. Supports frame-by-frame reading ...
class VideoReader: '''[DEPRECATED] Fine-grained video-reading API. Supports frame-by-frame reading of various streams from a single video container. Much like previous video_reader API it supports the following backends: video_reader, pyav, and cuda. Backends can be set via `torchvision.set_video_b...
7
5
28
3
18
7
6
0.89
0
12
0
0
6
4
6
6
248
39
111
30
98
99
87
25
79
14
0
4
36
18,205
pytorch/vision
pytorch_vision/torchvision/models/_api.py
torchvision.models._api.Weights
from dataclasses import dataclass from typing import Any, Callable, get_args, Optional, TypeVar, Union from functools import partial @dataclass class Weights: """ This class is used to group important attributes associated with the pre-trained weights. Args: url (str): The location where we find t...
@dataclass class Weights: ''' This class is used to group important attributes associated with the pre-trained weights. Args: url (str): The location where we find the weights. transforms (Callable): A callable that constructs the preprocessing method (or validation preset transforms) ...
3
1
25
3
15
7
5
1.05
0
3
0
0
1
0
1
1
45
6
19
2
17
20
14
2
12
5
0
1
5
18,206
pytorch/vision
pytorch_vision/torchvision/models/_api.py
torchvision.models._api.WeightsEnum
from typing import Any, Callable, get_args, Optional, TypeVar, Union from collections.abc import Iterable, Mapping from .._internally_replaced_utils import load_state_dict_from_url from enum import Enum class WeightsEnum(Enum): """ This class is the parent class of all model weights. Each model building method...
class WeightsEnum(Enum): ''' This class is the parent class of all model weights. Each model building method receives an optional `weights` parameter with its associated pre-trained weights. It inherits from `Enum` and its values should be of type `Weights`. Args: value (Weights): The data ...
11
1
3
0
3
0
2
0.29
1
4
0
125
5
0
6
55
38
7
24
11
13
7
17
7
10
4
4
2
9
18,207
pytorch/vision
pytorch_vision/torchvision/models/_utils.py
torchvision.models._utils.IntermediateLayerGetter
from torch import nn from collections import OrderedDict class IntermediateLayerGetter(nn.ModuleDict): """ Module wrapper that returns intermediate layers from a model It has a strong assumption that the modules have been registered into the model in the same order as they are used. This means tha...
class IntermediateLayerGetter(nn.ModuleDict): ''' Module wrapper that returns intermediate layers from a model It has a strong assumption that the modules have been registered into the model in the same order as they are used. This means that one should **not** reuse the same nn.Module twice in...
3
1
12
1
11
0
4
0.93
1
5
0
0
2
1
2
2
61
9
27
13
24
25
25
12
22
5
1
2
8
18,208
pytorch/vision
pytorch_vision/torchvision/models/_utils.py
torchvision.models._utils._ModelURLs
import warnings class _ModelURLs(dict): def __getitem__(self, item): warnings.warn('Accessing the model URLs via the internal dictionary of the module is deprecated since 0.13 and may be removed in the future. Please access them via the appropriate Weights Enum instead.') return super().__getitem_...
class _ModelURLs(dict): def __getitem__(self, item): pass
2
0
6
0
6
0
1
0
1
1
0
0
1
0
1
28
7
0
7
2
5
0
4
2
2
1
2
0
1
18,209
pytorch/vision
pytorch_vision/torchvision/models/alexnet.py
torchvision.models.alexnet.AlexNet
import torch from ..utils import _log_api_usage_once import torch.nn as nn class AlexNet(nn.Module): def __init__(self, num_classes: int=1000, dropout: float=0.5) -> None: super().__init__() _log_api_usage_once(self) self.features = nn.Sequential(nn.Conv2d(3, 64, kernel_size=11, stride=4, ...
class AlexNet(nn.Module): def __init__(self, num_classes: int=1000, dropout: float=0.5) -> None: pass def forward(self, x: torch.Tensor) -> torch.Tensor: pass
3
0
17
0
17
0
1
0
1
4
0
0
2
3
2
12
36
1
35
6
32
0
13
6
10
1
1
0
2
18,210
pytorch/vision
pytorch_vision/torchvision/models/alexnet.py
torchvision.models.alexnet.AlexNet_Weights
from ._api import register_model, Weights, WeightsEnum from ._meta import _IMAGENET_CATEGORIES from functools import partial from ..transforms._presets import ImageClassification class AlexNet_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/alexnet-owt-7be5be79.pth', transfor...
class AlexNet_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.04
1
0
0
0
0
0
0
55
23
0
23
3
22
1
3
3
2
0
5
0
0
18,211
pytorch/vision
pytorch_vision/torchvision/models/convnext.py
torchvision.models.convnext.CNBlock
from typing import Any, Callable, Optional from torch import nn, Tensor from ..ops.misc import Conv2dNormActivation, Permute import torch from functools import partial from ..ops.stochastic_depth import StochasticDepth class CNBlock(nn.Module): def __init__(self, dim, layer_scale: float, stochastic_depth_prob: fl...
class CNBlock(nn.Module): def __init__(self, dim, layer_scale: float, stochastic_depth_prob: float, norm_layer: Optional[Callable[..., nn.Module]]=None) -> None: pass def forward(self, input: Tensor) -> Tensor: pass
3
0
14
1
13
0
2
0
1
6
2
0
2
3
2
12
29
2
27
13
18
0
13
7
10
2
1
1
3
18,212
pytorch/vision
pytorch_vision/torchvision/models/convnext.py
torchvision.models.convnext.CNBlockConfig
from typing import Any, Callable, Optional class CNBlockConfig: def __init__(self, input_channels: int, out_channels: Optional[int], num_layers: int) -> None: self.input_channels = input_channels self.out_channels = out_channels self.num_layers = num_layers def __repr__(self) -> str: ...
class CNBlockConfig: def __init__(self, input_channels: int, out_channels: Optional[int], num_layers: int) -> None: pass def __repr__(self) -> str: pass
3
0
8
0
8
0
1
0.06
0
2
0
0
2
3
2
2
19
1
17
12
9
1
12
7
9
1
0
0
2
18,213
pytorch/vision
pytorch_vision/torchvision/models/convnext.py
torchvision.models.convnext.ConvNeXt
from ..ops.misc import Conv2dNormActivation, Permute from torch import nn, Tensor from collections.abc import Sequence from functools import partial from typing import Any, Callable, Optional from ..utils import _log_api_usage_once class ConvNeXt(nn.Module): def __init__(self, block_setting: list[CNBlockConfig], ...
class ConvNeXt(nn.Module): def __init__(self, block_setting: list[CNBlockConfig], stochastic_depth_prob: float=0.0, layer_scale: float=1e-06, num_classes: int=1000, block: Optional[Callable[..., nn.Module]]=None, norm_layer: Optional[Callable[..., nn.Module]]=None, **kwargs: Any) -> None: pass def _f...
4
0
28
3
24
1
5
0.06
1
13
4
0
3
3
3
13
87
11
72
26
59
4
42
17
38
12
1
3
14
18,214
pytorch/vision
pytorch_vision/torchvision/models/convnext.py
torchvision.models.convnext.ConvNeXt_Base_Weights
from ._api import register_model, Weights, WeightsEnum from ..transforms._presets import ImageClassification from functools import partial class ConvNeXt_Base_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/convnext_base-6075fbad.pth', transforms=partial(ImageClassification, ...
class ConvNeXt_Base_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
18
0
18
3
17
0
3
3
2
0
5
0
0
18,215
pytorch/vision
pytorch_vision/torchvision/models/convnext.py
torchvision.models.convnext.ConvNeXt_Large_Weights
from ._api import register_model, Weights, WeightsEnum from functools import partial from ..transforms._presets import ImageClassification class ConvNeXt_Large_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/convnext_large-ea097f82.pth', transforms=partial(ImageClassification...
class ConvNeXt_Large_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
18
0
18
3
17
0
3
3
2
0
5
0
0
18,216
pytorch/vision
pytorch_vision/torchvision/models/convnext.py
torchvision.models.convnext.ConvNeXt_Small_Weights
from functools import partial from ._api import register_model, Weights, WeightsEnum from ..transforms._presets import ImageClassification class ConvNeXt_Small_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/convnext_small-0c510722.pth', transforms=partial(ImageClassification...
class ConvNeXt_Small_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
18
0
18
3
17
0
3
3
2
0
5
0
0
18,217
pytorch/vision
pytorch_vision/torchvision/models/convnext.py
torchvision.models.convnext.ConvNeXt_Tiny_Weights
from functools import partial from ..transforms._presets import ImageClassification from ._api import register_model, Weights, WeightsEnum class ConvNeXt_Tiny_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/convnext_tiny-983f1562.pth', transforms=partial(ImageClassification, ...
class ConvNeXt_Tiny_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
18
0
18
3
17
0
3
3
2
0
5
0
0
18,218
pytorch/vision
pytorch_vision/torchvision/models/convnext.py
torchvision.models.convnext.LayerNorm2d
from torch import nn, Tensor from torch.nn import functional as F class LayerNorm2d(nn.LayerNorm): def forward(self, x: Tensor) -> Tensor: x = x.permute(0, 2, 3, 1) x = F.layer_norm(x, self.normalized_shape, self.weight, self.bias, self.eps) x = x.permute(0, 3, 1, 2) return x
class LayerNorm2d(nn.LayerNorm): def forward(self, x: Tensor) -> Tensor: pass
2
0
5
0
5
0
1
0
1
1
0
0
1
0
1
1
6
0
6
2
4
0
6
2
4
1
1
0
1
18,219
pytorch/vision
pytorch_vision/torchvision/models/densenet.py
torchvision.models.densenet.DenseNet
from collections import OrderedDict from ..utils import _log_api_usage_once import torch.nn.functional as F from torch import Tensor import torch.utils.checkpoint as cp import torch.nn as nn import torch class DenseNet(nn.Module): """Densenet-BC model class, based on `"Densely Connected Convolutional Networks"...
class DenseNet(nn.Module): '''Densenet-BC model class, based on `"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_. Args: growth_rate (int) - how many filters to add each layer (`k` in paper) block_config (list of 4 ints) - how many layers in each pooling b...
3
1
33
3
28
3
4
0.32
1
9
2
0
2
2
2
12
83
9
56
21
44
18
29
12
26
7
1
2
8
18,220
pytorch/vision
pytorch_vision/torchvision/models/densenet.py
torchvision.models.densenet.DenseNet121_Weights
from functools import partial from ._api import register_model, Weights, WeightsEnum from ..transforms._presets import ImageClassification class DenseNet121_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/densenet121-a639ec97.pth', transforms=partial(ImageClassification, crop...
class DenseNet121_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
18
0
18
3
17
0
3
3
2
0
5
0
0
18,221
pytorch/vision
pytorch_vision/torchvision/models/densenet.py
torchvision.models.densenet.DenseNet161_Weights
from functools import partial from ..transforms._presets import ImageClassification from ._api import register_model, Weights, WeightsEnum class DenseNet161_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/densenet161-8d451a50.pth', transforms=partial(ImageClassification, crop...
class DenseNet161_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
18
0
18
3
17
0
3
3
2
0
5
0
0
18,222
pytorch/vision
pytorch_vision/torchvision/models/densenet.py
torchvision.models.densenet.DenseNet169_Weights
from functools import partial from ._api import register_model, Weights, WeightsEnum from ..transforms._presets import ImageClassification class DenseNet169_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/densenet169-b2777c0a.pth', transforms=partial(ImageClassification, crop...
class DenseNet169_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
18
0
18
3
17
0
3
3
2
0
5
0
0
18,223
pytorch/vision
pytorch_vision/torchvision/models/densenet.py
torchvision.models.densenet.DenseNet201_Weights
from ..transforms._presets import ImageClassification from functools import partial from ._api import register_model, Weights, WeightsEnum class DenseNet201_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/densenet201-c1103571.pth', transforms=partial(ImageClassification, crop...
class DenseNet201_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
18
0
18
3
17
0
3
3
2
0
5
0
0
18,224
pytorch/vision
pytorch_vision/torchvision/models/densenet.py
torchvision.models.densenet._DenseBlock
import torch.utils.checkpoint as cp import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor class _DenseBlock(nn.ModuleDict): _version = 2 def __init__(self, num_layers: int, num_input_features: int, bn_size: int, growth_rate: int, drop_rate: float, memory_efficient: bool=F...
class _DenseBlock(nn.ModuleDict): def __init__(self, num_layers: int, num_input_features: int, bn_size: int, growth_rate: int, drop_rate: float, memory_efficient: bool=False) -> None: pass def forward(self, init_features: Tensor) -> Tensor: pass
3
0
13
0
13
0
2
0
1
7
1
0
2
0
2
2
29
2
27
17
16
0
13
9
10
2
1
1
4
18,225
pytorch/vision
pytorch_vision/torchvision/models/densenet.py
torchvision.models.densenet._DenseLayer
import torch from torch import Tensor import torch.nn.functional as F import torch.nn as nn import torch.utils.checkpoint as cp class _DenseLayer(nn.Module): def __init__(self, num_input_features: int, growth_rate: int, bn_size: int, drop_rate: float, memory_efficient: bool=False) -> None: super().__init_...
class _DenseLayer(nn.Module): def __init__(self, num_input_features: int, growth_rate: int, bn_size: int, drop_rate: float, memory_efficient: bool=False) -> None: pass def bn_function(self, inputs: list[Tensor]) -> Tensor: pass def any_requires_grad(self, input: list[Tensor]) -> bool: ...
12
0
7
1
6
1
2
0.21
1
6
0
0
7
8
7
17
63
12
48
28
34
10
41
23
32
5
1
2
14
18,226
pytorch/vision
pytorch_vision/torchvision/models/densenet.py
torchvision.models.densenet._Transition
import torch.nn as nn class _Transition(nn.Sequential): def __init__(self, num_input_features: int, num_output_features: int) -> None: super().__init__() self.norm = nn.BatchNorm2d(num_input_features) self.relu = nn.ReLU(inplace=True) self.conv = nn.Conv2d(num_input_features, num_o...
class _Transition(nn.Sequential): def __init__(self, num_input_features: int, num_output_features: int) -> None: pass
2
0
6
0
6
0
1
0
1
2
0
0
1
4
1
1
7
0
7
6
5
0
7
6
5
1
1
0
1
18,227
pytorch/vision
pytorch_vision/torchvision/models/detection/_utils.py
torchvision.models.detection._utils.BalancedPositiveNegativeSampler
import torch from torch import nn, Tensor class BalancedPositiveNegativeSampler: """ This class samples batches, ensuring that they contain a fixed proportion of positives """ def __init__(self, batch_size_per_image: int, positive_fraction: float) -> None: """ Args: batch_s...
class BalancedPositiveNegativeSampler: ''' This class samples batches, ensuring that they contain a fixed proportion of positives ''' def __init__(self, batch_size_per_image: int, positive_fraction: float) -> None: ''' Args: batch_size_per_image (int): number of element...
3
3
28
5
12
11
2
1
0
3
0
0
2
2
2
2
61
11
25
18
22
25
25
18
22
2
0
1
3
18,228
pytorch/vision
pytorch_vision/torchvision/models/detection/_utils.py
torchvision.models.detection._utils.BoxCoder
from torch import nn, Tensor import torch import math class BoxCoder: """ This class encodes and decodes a set of bounding boxes into the representation used for training the regressors. """ def __init__(self, weights: tuple[float, float, float, float], bbox_xform_clip: float=math.log(1000.0 / 16)...
class BoxCoder: ''' This class encodes and decodes a set of bounding boxes into the representation used for training the regressors. ''' def __init__(self, weights: tuple[float, float, float, float], bbox_xform_clip: float=math.log(1000.0 / 16)) -> None: ''' Args: weigh...
6
4
19
2
12
4
2
0.4
0
4
0
0
5
2
5
5
103
15
63
41
55
25
55
39
49
4
0
1
8
18,229
pytorch/vision
pytorch_vision/torchvision/models/detection/_utils.py
torchvision.models.detection._utils.BoxLinearCoder
from torch import nn, Tensor import torch class BoxLinearCoder: """ The linear box-to-box transform defined in FCOS. The transformation is parameterized by the distance from the center of (square) src box to 4 edges of the target box. """ def __init__(self, normalize_by_size: bool=True) -> None: ...
class BoxLinearCoder: ''' The linear box-to-box transform defined in FCOS. The transformation is parameterized by the distance from the center of (square) src box to 4 edges of the target box. ''' def __init__(self, normalize_by_size: bool=True) -> None: ''' Args: norma...
4
4
26
6
11
9
2
0.88
0
2
0
0
3
1
3
3
85
21
34
25
30
30
32
25
28
2
0
1
5
18,230
pytorch/vision
pytorch_vision/torchvision/models/detection/_utils.py
torchvision.models.detection._utils.Matcher
import torch from torch import nn, Tensor class Matcher: """ This class assigns to each predicted "element" (e.g., a box) a ground-truth element. Each predicted element will have exactly zero or one matches; each ground-truth element may be assigned to zero or more predicted elements. Matching is ...
class Matcher: ''' This class assigns to each predicted "element" (e.g., a box) a ground-truth element. Each predicted element will have exactly zero or one matches; each ground-truth element may be assigned to zero or more predicted elements. Matching is based on the MxN match_quality_matrix, that...
4
4
26
2
11
14
3
1.3
0
4
0
1
3
3
3
3
104
13
40
17
36
52
34
17
30
6
0
2
8
18,231
pytorch/vision
pytorch_vision/torchvision/models/detection/_utils.py
torchvision.models.detection._utils.SSDMatcher
import torch from torch import nn, Tensor class SSDMatcher(Matcher): def __init__(self, threshold: float) -> None: super().__init__(threshold, threshold, allow_low_quality_matches=False) def __call__(self, match_quality_matrix: Tensor) -> Tensor: matches = super().__call__(match_quality_matri...
class SSDMatcher(Matcher): def __init__(self, threshold: float) -> None: pass def __call__(self, match_quality_matrix: Tensor) -> Tensor: pass
3
0
6
1
5
1
1
0.1
1
3
0
0
2
0
2
5
14
3
10
5
7
1
8
5
5
1
1
0
2
18,232
pytorch/vision
pytorch_vision/torchvision/models/detection/anchor_utils.py
torchvision.models.detection.anchor_utils.AnchorGenerator
from .image_list import ImageList from torch import nn, Tensor import torch class AnchorGenerator(nn.Module): """ Module that generates anchors for a set of feature maps and image sizes. The module support computing anchors at multiple sizes and aspect ratios per feature map. This module assumes a...
class AnchorGenerator(nn.Module): ''' Module that generates anchors for a set of feature maps and image sizes. The module support computing anchors at multiple sizes and aspect ratios per feature map. This module assumes aspect ratio = height / width for each anchor. sizes and aspect_ratios...
7
1
15
1
13
1
2
0.31
1
9
1
0
6
3
6
16
124
19
80
44
63
25
54
34
47
3
1
1
10
18,233
pytorch/vision
pytorch_vision/torchvision/models/detection/anchor_utils.py
torchvision.models.detection.anchor_utils.DefaultBoxGenerator
from .image_list import ImageList from torch import nn, Tensor import math from typing import Optional import torch class DefaultBoxGenerator(nn.Module): """ This module generates the default boxes of SSD for a set of feature maps and image sizes. Args: aspect_ratios (List[List[int]]): A list with...
class DefaultBoxGenerator(nn.Module): ''' This module generates the default boxes of SSD for a set of feature maps and image sizes. Args: aspect_ratios (List[List[int]]): A list with all the aspect ratios used in each feature map. min_ratio (float): The minimum scale :math:` ext{s}_{ ...
7
1
18
2
16
1
3
0.23
1
10
1
0
6
5
6
16
133
17
94
55
75
22
66
43
59
4
1
2
15
18,234
pytorch/vision
pytorch_vision/torchvision/models/detection/backbone_utils.py
torchvision.models.detection.backbone_utils.BackboneWithFPN
from torch import nn, Tensor from torchvision.ops.feature_pyramid_network import ExtraFPNBlock, FeaturePyramidNetwork, LastLevelMaxPool from typing import Callable, Optional, Union from .._utils import handle_legacy_interface, IntermediateLayerGetter class BackboneWithFPN(nn.Module): """ Adds a FPN on top of a...
class BackboneWithFPN(nn.Module): ''' Adds a FPN on top of a model. Internally, it uses torchvision.models._utils.IntermediateLayerGetter to extract a submodel that returns the feature maps specified in return_layers. The same limitations of IntermediateLayerGetter apply here. Args: bac...
3
1
13
1
12
0
2
0.72
1
8
4
0
2
3
2
12
47
4
25
14
14
18
12
6
9
2
1
1
3
18,235
pytorch/vision
pytorch_vision/torchvision/models/detection/faster_rcnn.py
torchvision.models.detection.faster_rcnn.FastRCNNConvFCHead
from typing import Any, Callable, Optional, Union from ...ops import misc as misc_nn_ops from torch import nn class FastRCNNConvFCHead(nn.Sequential): def __init__(self, input_size: tuple[int, int, int], conv_layers: list[int], fc_layers: list[int], norm_layer: Optional[Callable[..., nn.Module]]=None): ""...
class FastRCNNConvFCHead(nn.Sequential): def __init__(self, input_size: tuple[int, int, int], conv_layers: list[int], fc_layers: list[int], norm_layer: Optional[Callable[..., nn.Module]]=None): ''' Args: input_size (Tuple[int, int, int]): the input size in CHW format. conv_...
2
1
34
2
25
7
6
0.27
1
3
1
0
1
0
1
1
35
2
26
13
18
7
20
7
18
6
1
3
6
18,236
pytorch/vision
pytorch_vision/torchvision/models/detection/faster_rcnn.py
torchvision.models.detection.faster_rcnn.FastRCNNPredictor
import torch.nn.functional as F import torch from torch import nn class FastRCNNPredictor(nn.Module): """ Standard classification + bounding box regression layers for Fast R-CNN. Args: in_channels (int): number of input channels num_classes (int): number of output classes (including ba...
class FastRCNNPredictor(nn.Module): ''' Standard classification + bounding box regression layers for Fast R-CNN. Args: in_channels (int): number of input channels num_classes (int): number of output classes (including background) ''' def __init__(self, in_channels, num_...
3
1
8
1
7
0
2
0.47
1
2
0
0
2
2
2
12
26
4
15
7
12
7
12
7
9
2
1
1
3
18,237
pytorch/vision
pytorch_vision/torchvision/models/detection/faster_rcnn.py
torchvision.models.detection.faster_rcnn.FasterRCNN
from .anchor_utils import AnchorGenerator from .roi_heads import RoIHeads from torchvision.ops import MultiScaleRoIAlign from .generalized_rcnn import GeneralizedRCNN from .transform import GeneralizedRCNNTransform from .rpn import RegionProposalNetwork, RPNHead class FasterRCNN(GeneralizedRCNN): """ Implement...
class FasterRCNN(GeneralizedRCNN): ''' Implements Faster R-CNN. The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each image, and should be in 0-1 range. Different images can have different sizes. The behavior of the model changes depending on if it is in ...
2
1
117
13
100
4
14
1.17
1
13
8
2
1
0
1
14
241
22
101
42
67
118
37
10
35
14
2
2
14
18,238
pytorch/vision
pytorch_vision/torchvision/models/detection/faster_rcnn.py
torchvision.models.detection.faster_rcnn.FasterRCNN_MobileNet_V3_Large_320_FPN_Weights
from ...transforms._presets import ObjectDetection from .._api import register_model, Weights, WeightsEnum class FasterRCNN_MobileNet_V3_Large_320_FPN_Weights(WeightsEnum): COCO_V1 = Weights(url='https://download.pytorch.org/models/fasterrcnn_mobilenet_v3_large_320_fpn-907ea3f9.pth', transforms=ObjectDetection, me...
class FasterRCNN_MobileNet_V3_Large_320_FPN_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
19
0
19
3
18
1
3
3
2
0
5
0
0
18,239
pytorch/vision
pytorch_vision/torchvision/models/detection/faster_rcnn.py
torchvision.models.detection.faster_rcnn.FasterRCNN_MobileNet_V3_Large_FPN_Weights
from .._api import register_model, Weights, WeightsEnum from ...transforms._presets import ObjectDetection class FasterRCNN_MobileNet_V3_Large_FPN_Weights(WeightsEnum): COCO_V1 = Weights(url='https://download.pytorch.org/models/fasterrcnn_mobilenet_v3_large_fpn-fb6a3cc7.pth', transforms=ObjectDetection, meta={**_C...
class FasterRCNN_MobileNet_V3_Large_FPN_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
19
0
19
3
18
1
3
3
2
0
5
0
0
18,240
pytorch/vision
pytorch_vision/torchvision/models/detection/faster_rcnn.py
torchvision.models.detection.faster_rcnn.FasterRCNN_ResNet50_FPN_V2_Weights
from ...transforms._presets import ObjectDetection from .._api import register_model, Weights, WeightsEnum class FasterRCNN_ResNet50_FPN_V2_Weights(WeightsEnum): COCO_V1 = Weights(url='https://download.pytorch.org/models/fasterrcnn_resnet50_fpn_v2_coco-dd69338a.pth', transforms=ObjectDetection, meta={**_COMMON_MET...
class FasterRCNN_ResNet50_FPN_V2_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
19
0
19
3
18
0
3
3
2
0
5
0
0
18,241
pytorch/vision
pytorch_vision/torchvision/models/detection/faster_rcnn.py
torchvision.models.detection.faster_rcnn.FasterRCNN_ResNet50_FPN_Weights
from ...transforms._presets import ObjectDetection from .._api import register_model, Weights, WeightsEnum class FasterRCNN_ResNet50_FPN_Weights(WeightsEnum): COCO_V1 = Weights(url='https://download.pytorch.org/models/fasterrcnn_resnet50_fpn_coco-258fb6c6.pth', transforms=ObjectDetection, meta={**_COMMON_META, 'nu...
class FasterRCNN_ResNet50_FPN_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
19
0
19
3
18
1
3
3
2
0
5
0
0
18,242
pytorch/vision
pytorch_vision/torchvision/models/detection/faster_rcnn.py
torchvision.models.detection.faster_rcnn.TwoMLPHead
from torch import nn import torch.nn.functional as F class TwoMLPHead(nn.Module): """ Standard heads for FPN-based models Args: in_channels (int): number of input channels representation_size (int): size of the intermediate representation """ def __init__(self, in_channels, repres...
class TwoMLPHead(nn.Module): ''' Standard heads for FPN-based models Args: in_channels (int): number of input channels representation_size (int): size of the intermediate representation ''' def __init__(self, in_channels, representation_size): pass def forward(self, x)...
3
1
6
2
5
0
1
0.6
1
1
0
0
2
2
2
12
22
6
10
5
7
6
10
5
7
1
1
0
2
18,243
pytorch/vision
pytorch_vision/torchvision/models/detection/fcos.py
torchvision.models.detection.fcos.FCOS
from collections import OrderedDict from typing import Any, Callable, Optional from . import _utils as det_utils from ...ops import boxes as box_ops, generalized_box_iou_loss, misc as misc_nn_ops, sigmoid_focal_loss from torch import nn, Tensor from ...utils import _log_api_usage_once from .anchor_utils import AnchorGe...
class FCOS(nn.Module): ''' Implements FCOS. The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each image, and should be in 0-1 range. Different images can have different sizes. The behavior of the model changes depending on if it is in training or evaluati...
7
2
57
8
42
8
6
0.56
1
17
4
0
5
11
5
15
383
55
216
107
179
122
147
76
141
14
1
3
30
18,244
pytorch/vision
pytorch_vision/torchvision/models/detection/fcos.py
torchvision.models.detection.fcos.FCOSClassificationHead
from torch import nn, Tensor import math from typing import Any, Callable, Optional import torch from functools import partial class FCOSClassificationHead(nn.Module): """ A classification head for use in FCOS. Args: in_channels (int): number of channels of the input feature. num_anchors (...
class FCOSClassificationHead(nn.Module): ''' A classification head for use in FCOS. Args: in_channels (int): number of channels of the input feature. num_anchors (int): number of anchors to be predicted. num_classes (int): number of classes to be predicted. num_convs (Option...
3
1
24
5
19
1
4
0.31
1
6
0
0
2
4
2
12
62
12
39
22
28
12
31
14
28
5
1
2
7
18,245
pytorch/vision
pytorch_vision/torchvision/models/detection/fcos.py
torchvision.models.detection.fcos.FCOSHead
import torch from torch import nn, Tensor from ...ops import boxes as box_ops, generalized_box_iou_loss, misc as misc_nn_ops, sigmoid_focal_loss from typing import Any, Callable, Optional from . import _utils as det_utils class FCOSHead(nn.Module): """ A regression and classification head for use in FCOS. ...
class FCOSHead(nn.Module): ''' A regression and classification head for use in FCOS. Args: in_channels (int): number of channels of the input feature num_anchors (int): number of anchors to be predicted num_classes (int): number of classes to be predicted num_convs (Optional...
4
1
29
4
23
3
2
0.24
1
8
3
0
3
3
3
13
104
16
74
35
64
18
43
29
39
4
1
2
6
18,246
pytorch/vision
pytorch_vision/torchvision/models/detection/fcos.py
torchvision.models.detection.fcos.FCOSRegressionHead
from torch import nn, Tensor from typing import Any, Callable, Optional import torch from functools import partial class FCOSRegressionHead(nn.Module): """ A regression head for use in FCOS, which combines regression branch and center-ness branch. This can obtain better performance. Reference: `FCOS: ...
class FCOSRegressionHead(nn.Module): ''' A regression head for use in FCOS, which combines regression branch and center-ness branch. This can obtain better performance. Reference: `FCOS: A simple and strong anchor-free object detector <https://arxiv.org/abs/2006.09214>`_. Args: in_channels ...
3
1
26
4
21
2
4
0.3
1
5
0
0
2
3
2
12
67
12
43
22
34
13
37
16
34
6
1
2
8
18,247
pytorch/vision
pytorch_vision/torchvision/models/detection/fcos.py
torchvision.models.detection.fcos.FCOS_ResNet50_FPN_Weights
from .._api import register_model, Weights, WeightsEnum from ...transforms._presets import ObjectDetection from .._meta import _COCO_CATEGORIES class FCOS_ResNet50_FPN_Weights(WeightsEnum): COCO_V1 = Weights(url='https://download.pytorch.org/models/fcos_resnet50_fpn_coco-99b0c9b7.pth', transforms=ObjectDetection, ...
class FCOS_ResNet50_FPN_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
20
0
20
3
19
1
3
3
2
0
5
0
0
18,248
pytorch/vision
pytorch_vision/torchvision/models/detection/generalized_rcnn.py
torchvision.models.detection.generalized_rcnn.GeneralizedRCNN
from typing import Optional, Union import torch from ...utils import _log_api_usage_once from collections import OrderedDict from torch import nn import warnings class GeneralizedRCNN(nn.Module): """ Main class for Generalized R-CNN. Args: backbone (nn.Module): rpn (nn.Module): roi...
class GeneralizedRCNN(nn.Module): ''' Main class for Generalized R-CNN. Args: backbone (nn.Module): rpn (nn.Module): roi_heads (nn.Module): takes the features + the proposals from the RPN and computes detections / masks from it. transform (nn.Module): performs th...
5
2
29
3
21
6
5
0.42
1
7
0
1
3
5
3
13
104
13
65
23
60
27
51
22
47
12
1
4
15
18,249
pytorch/vision
pytorch_vision/torchvision/models/detection/image_list.py
torchvision.models.detection.image_list.ImageList
from torch import Tensor import torch class ImageList: """ Structure that holds a list of images (of possibly varying sizes) as a single tensor. This works by padding the images to the same size, and storing in a field the original sizes of each image Args: tensors (tensor): Tensor con...
class ImageList: ''' Structure that holds a list of images (of possibly varying sizes) as a single tensor. This works by padding the images to the same size, and storing in a field the original sizes of each image Args: tensors (tensor): Tensor containing images. image_sizes (li...
3
1
3
0
3
0
1
1.29
0
2
0
0
2
2
2
2
19
3
7
6
4
9
7
6
4
1
0
0
2
18,250
pytorch/vision
pytorch_vision/torchvision/models/detection/keypoint_rcnn.py
torchvision.models.detection.keypoint_rcnn.KeypointRCNN
from .faster_rcnn import FasterRCNN from torchvision.ops import MultiScaleRoIAlign class KeypointRCNN(FasterRCNN): """ Implements Keypoint R-CNN. The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each image, and should be in 0-1 range. Different images can ha...
class KeypointRCNN(FasterRCNN): ''' Implements Keypoint R-CNN. The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each image, and should be in 0-1 range. Different images can have different sizes. The behavior of the model changes depending on if it is in t...
2
1
107
8
92
8
8
1.45
1
9
3
0
1
0
1
15
246
19
93
41
55
135
23
5
21
8
3
2
8
18,251
pytorch/vision
pytorch_vision/torchvision/models/detection/keypoint_rcnn.py
torchvision.models.detection.keypoint_rcnn.KeypointRCNNHeads
from torch import nn class KeypointRCNNHeads(nn.Sequential): def __init__(self, in_channels, layers): d = [] next_feature = in_channels for out_channels in layers: d.append(nn.Conv2d(next_feature, out_channels, 3, stride=1, padding=1)) d.append(nn.ReLU(inplace=True)...
class KeypointRCNNHeads(nn.Sequential): def __init__(self, in_channels, layers): pass
2
0
12
0
12
0
4
0
1
1
0
0
1
0
1
1
13
0
13
6
11
0
13
6
11
4
1
2
4
18,252
pytorch/vision
pytorch_vision/torchvision/models/detection/keypoint_rcnn.py
torchvision.models.detection.keypoint_rcnn.KeypointRCNNPredictor
from torch import nn import torch class KeypointRCNNPredictor(nn.Module): def __init__(self, in_channels, num_keypoints): super().__init__() input_features = in_channels deconv_kernel = 4 self.kps_score_lowres = nn.ConvTranspose2d(input_features, num_keypoints, deconv_kernel, strid...
class KeypointRCNNPredictor(nn.Module): def __init__(self, in_channels, num_keypoints): pass def forward(self, x): pass
3
0
10
0
10
0
1
0
1
2
0
0
2
3
2
12
22
1
21
8
18
0
13
8
10
1
1
0
2
18,253
pytorch/vision
pytorch_vision/torchvision/models/detection/keypoint_rcnn.py
torchvision.models.detection.keypoint_rcnn.KeypointRCNN_ResNet50_FPN_Weights
from .._api import register_model, Weights, WeightsEnum from ...transforms._presets import ObjectDetection class KeypointRCNN_ResNet50_FPN_Weights(WeightsEnum): COCO_LEGACY = Weights(url='https://download.pytorch.org/models/keypointrcnn_resnet50_fpn_coco-9f466800.pth', transforms=ObjectDetection, meta={**_COMMON_M...
class KeypointRCNN_ResNet50_FPN_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.02
1
0
0
0
0
0
0
55
41
0
41
4
40
1
4
4
3
0
5
0
0
18,254
pytorch/vision
pytorch_vision/torchvision/models/detection/mask_rcnn.py
torchvision.models.detection.mask_rcnn.MaskRCNN
from .faster_rcnn import _default_anchorgen, FasterRCNN, FastRCNNConvFCHead, RPNHead from torchvision.ops import MultiScaleRoIAlign class MaskRCNN(FasterRCNN): """ Implements Mask R-CNN. The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each image, and should...
class MaskRCNN(FasterRCNN): ''' Implements Mask R-CNN. The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each image, and should be in 0-1 range. Different images can have different sizes. The behavior of the model changes depending on if it is in training ...
2
1
104
8
89
8
7
1.51
1
7
3
0
1
0
1
15
242
17
90
42
53
136
22
7
20
7
3
2
7
18,255
pytorch/vision
pytorch_vision/torchvision/models/detection/mask_rcnn.py
torchvision.models.detection.mask_rcnn.MaskRCNNHeads
from ...ops import misc as misc_nn_ops from torch import nn from typing import Any, Callable, Optional class MaskRCNNHeads(nn.Sequential): _version = 2 def __init__(self, in_channels, layers, dilation, norm_layer: Optional[Callable[..., nn.Module]]=None): """ Args: in_channels (int...
class MaskRCNNHeads(nn.Sequential): def __init__(self, in_channels, layers, dilation, norm_layer: Optional[Callable[..., nn.Module]]=None): ''' Args: in_channels (int): number of input channels layers (list): feature dimensions of each FCN layer dilation (int): ...
3
1
30
2
25
4
5
0.13
1
3
1
0
2
0
2
2
64
5
52
23
40
7
25
14
22
5
1
4
10
18,256
pytorch/vision
pytorch_vision/torchvision/models/detection/mask_rcnn.py
torchvision.models.detection.mask_rcnn.MaskRCNNPredictor
from collections import OrderedDict from torch import nn class MaskRCNNPredictor(nn.Sequential): def __init__(self, in_channels, dim_reduced, num_classes): super().__init__(OrderedDict([('conv5_mask', nn.ConvTranspose2d(in_channels, dim_reduced, 2, 2, 0)), ('relu', nn.ReLU(inplace=True)), ('mask_fcn_logit...
class MaskRCNNPredictor(nn.Sequential): def __init__(self, in_channels, dim_reduced, num_classes): pass
2
0
14
1
13
0
3
0
1
2
0
0
1
0
1
1
15
1
14
3
12
0
6
3
4
3
1
2
3
18,257
pytorch/vision
pytorch_vision/torchvision/models/detection/mask_rcnn.py
torchvision.models.detection.mask_rcnn.MaskRCNN_ResNet50_FPN_V2_Weights
from ...transforms._presets import ObjectDetection from .._api import register_model, Weights, WeightsEnum class MaskRCNN_ResNet50_FPN_V2_Weights(WeightsEnum): COCO_V1 = Weights(url='https://download.pytorch.org/models/maskrcnn_resnet50_fpn_v2_coco-73cbd019.pth', transforms=ObjectDetection, meta={**_COMMON_META, '...
class MaskRCNN_ResNet50_FPN_V2_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
20
0
20
3
19
0
3
3
2
0
5
0
0
18,258
pytorch/vision
pytorch_vision/torchvision/models/detection/mask_rcnn.py
torchvision.models.detection.mask_rcnn.MaskRCNN_ResNet50_FPN_Weights
from ...transforms._presets import ObjectDetection from .._api import register_model, Weights, WeightsEnum class MaskRCNN_ResNet50_FPN_Weights(WeightsEnum): COCO_V1 = Weights(url='https://download.pytorch.org/models/maskrcnn_resnet50_fpn_coco-bf2d0c1e.pth', transforms=ObjectDetection, meta={**_COMMON_META, 'num_pa...
class MaskRCNN_ResNet50_FPN_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
20
0
20
3
19
1
3
3
2
0
5
0
0
18,259
pytorch/vision
pytorch_vision/torchvision/models/detection/retinanet.py
torchvision.models.detection.retinanet.RetinaNet
from .anchor_utils import AnchorGenerator from ...utils import _log_api_usage_once from ...ops import boxes as box_ops, misc as misc_nn_ops, sigmoid_focal_loss import torch from collections import OrderedDict import warnings from torch import nn, Tensor from .transform import GeneralizedRCNNTransform from . import _uti...
class RetinaNet(nn.Module): ''' Implements RetinaNet. The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each image, and should be in 0-1 range. Different images can have different sizes. The behavior of the model changes depending on if it is in training o...
7
2
51
8
36
7
6
0.6
1
18
5
0
5
11
5
15
353
53
188
84
163
112
131
65
125
15
1
3
31
18,260
pytorch/vision
pytorch_vision/torchvision/models/detection/retinanet.py
torchvision.models.detection.retinanet.RetinaNetClassificationHead
from torch import nn, Tensor import torch from ...ops import boxes as box_ops, misc as misc_nn_ops, sigmoid_focal_loss from typing import Any, Callable, Optional import math from . import _utils as det_utils class RetinaNetClassificationHead(nn.Module): """ A classification head for use in RetinaNet. Args...
class RetinaNetClassificationHead(nn.Module): ''' A classification head for use in RetinaNet. Args: in_channels (int): number of channels of the input feature num_anchors (int): number of anchors to be predicted num_classes (int): number of classes to be predicted norm_layer...
5
1
26
4
20
3
3
0.24
1
5
2
0
4
5
4
14
121
23
80
42
59
19
46
26
41
5
1
3
11
18,261
pytorch/vision
pytorch_vision/torchvision/models/detection/retinanet.py
torchvision.models.detection.retinanet.RetinaNetHead
from torch import nn, Tensor from typing import Any, Callable, Optional class RetinaNetHead(nn.Module): """ A regression and classification head for use in RetinaNet. Args: in_channels (int): number of channels of the input feature num_anchors (int): number of anchors to be predicted ...
class RetinaNetHead(nn.Module): ''' A regression and classification head for use in RetinaNet. Args: in_channels (int): number of channels of the input feature num_anchors (int): number of anchors to be predicted num_classes (int): number of classes to be predicted norm_laye...
4
1
5
0
4
1
1
0.71
1
3
2
0
3
2
3
13
28
4
14
6
10
10
9
6
5
1
1
0
3
18,262
pytorch/vision
pytorch_vision/torchvision/models/detection/retinanet.py
torchvision.models.detection.retinanet.RetinaNetRegressionHead
from typing import Any, Callable, Optional from . import _utils as det_utils from torch import nn, Tensor from ._utils import _box_loss, overwrite_eps from ...ops import boxes as box_ops, misc as misc_nn_ops, sigmoid_focal_loss import torch class RetinaNetRegressionHead(nn.Module): """ A regression head for us...
class RetinaNetRegressionHead(nn.Module): ''' A regression head for use in RetinaNet. Args: in_channels (int): number of channels of the input feature num_anchors (int): number of anchors to be predicted norm_layer (callable, optional): Module specifying the normalization layer to u...
5
1
23
4
18
2
3
0.18
1
5
2
0
4
4
4
14
111
22
76
34
62
14
46
25
41
5
1
3
11
18,263
pytorch/vision
pytorch_vision/torchvision/models/detection/retinanet.py
torchvision.models.detection.retinanet.RetinaNet_ResNet50_FPN_V2_Weights
from ...transforms._presets import ObjectDetection from .._api import register_model, Weights, WeightsEnum class RetinaNet_ResNet50_FPN_V2_Weights(WeightsEnum): COCO_V1 = Weights(url='https://download.pytorch.org/models/retinanet_resnet50_fpn_v2_coco-5905b1c5.pth', transforms=ObjectDetection, meta={**_COMMON_META,...
class RetinaNet_ResNet50_FPN_V2_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
19
0
19
3
18
0
3
3
2
0
5
0
0
18,264
pytorch/vision
pytorch_vision/torchvision/models/detection/retinanet.py
torchvision.models.detection.retinanet.RetinaNet_ResNet50_FPN_Weights
from .._api import register_model, Weights, WeightsEnum from ...transforms._presets import ObjectDetection class RetinaNet_ResNet50_FPN_Weights(WeightsEnum): COCO_V1 = Weights(url='https://download.pytorch.org/models/retinanet_resnet50_fpn_coco-eeacb38b.pth', transforms=ObjectDetection, meta={**_COMMON_META, 'num_...
class RetinaNet_ResNet50_FPN_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
19
0
19
3
18
1
3
3
2
0
5
0
0
18,265
pytorch/vision
pytorch_vision/torchvision/models/detection/roi_heads.py
torchvision.models.detection.roi_heads.RoIHeads
from . import _utils as det_utils from torch import nn import torch from torchvision.ops import boxes as box_ops, roi_align from typing import Optional import torch.nn.functional as F class RoIHeads(nn.Module): __annotations__ = {'box_coder': det_utils.BoxCoder, 'proposal_matcher': det_utils.Matcher, 'fg_bg_sample...
class RoIHeads(nn.Module): def __init__(self, box_roi_pool, box_head, box_predictor, fg_iou_thresh, bg_iou_thresh, batch_size_per_image, positive_fraction, bbox_reg_weights, score_thresh, nms_thresh, detections_per_img, mask_roi_pool=None, mask_head=None, mask_predictor=None, keypoint_roi_pool=None, keypoint_head...
11
1
37
5
29
5
6
0.16
1
13
3
0
10
16
10
20
385
57
291
134
245
48
228
99
217
28
1
4
56
18,266
pytorch/vision
pytorch_vision/torchvision/models/detection/rpn.py
torchvision.models.detection.rpn.RPNHead
from torch import nn, Tensor from torchvision.ops import boxes as box_ops, Conv2dNormActivation import torch class RPNHead(nn.Module): """ Adds a simple RPN Head with classification and regression heads Args: in_channels (int): number of channels of the input feature num_anchors (int): num...
class RPNHead(nn.Module): ''' Adds a simple RPN Head with classification and regression heads Args: in_channels (int): number of channels of the input feature num_anchors (int): number of anchors to be predicted conv_depth (int, optional): number of convolutions ''' def __i...
4
1
17
1
16
1
4
0.18
1
5
1
0
3
3
3
13
64
8
49
28
36
9
32
19
28
5
1
3
11
18,267
pytorch/vision
pytorch_vision/torchvision/models/detection/rpn.py
torchvision.models.detection.rpn.RegionProposalNetwork
from torchvision.ops import boxes as box_ops, Conv2dNormActivation from torch.nn import functional as F import torch from .image_list import ImageList from typing import Optional from .anchor_utils import AnchorGenerator from torch import nn, Tensor from . import _utils as det_utils class RegionProposalNetwork(torch.n...
class RegionProposalNetwork(torch.nn.Module): ''' Implements Region Proposal Network (RPN). Args: anchor_generator (AnchorGenerator): module that generates the anchors for a set of feature maps. head (nn.Module): module that computes the objectness and regression deltas ...
9
3
30
4
20
6
2
0.43
1
14
5
0
8
11
8
18
276
44
162
91
126
70
114
64
105
3
1
2
16
18,268
pytorch/vision
pytorch_vision/torchvision/models/detection/ssd.py
torchvision.models.detection.ssd.SSD
import warnings from torch import nn, Tensor from ...utils import _log_api_usage_once from ...ops import boxes as box_ops from .transform import GeneralizedRCNNTransform import torch from . import _utils as det_utils from .anchor_utils import DefaultBoxGenerator from collections import OrderedDict from typing import An...
class SSD(nn.Module): ''' Implements SSD architecture from `"SSD: Single Shot MultiBox Detector" <https://arxiv.org/abs/1512.02325>`_. The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each image, and should be in 0-1 range. Different images can have different...
7
1
55
8
43
4
6
0.29
1
18
5
0
5
12
5
15
338
52
223
106
188
64
143
73
137
16
1
4
29
18,269
pytorch/vision
pytorch_vision/torchvision/models/detection/ssd.py
torchvision.models.detection.ssd.SSD300_VGG16_Weights
from .._meta import _COCO_CATEGORIES from .._api import register_model, Weights, WeightsEnum from ...transforms._presets import ObjectDetection class SSD300_VGG16_Weights(WeightsEnum): COCO_V1 = Weights(url='https://download.pytorch.org/models/ssd300_vgg16_coco-b556d3b4.pth', transforms=ObjectDetection, meta={'num...
class SSD300_VGG16_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
20
0
20
3
19
1
3
3
2
0
5
0
0
18,270
pytorch/vision
pytorch_vision/torchvision/models/detection/ssd.py
torchvision.models.detection.ssd.SSDClassificationHead
from torch import nn, Tensor class SSDClassificationHead(SSDScoringHead): def __init__(self, in_channels: list[int], num_anchors: list[int], num_classes: int): cls_logits = nn.ModuleList() for channels, anchors in zip(in_channels, num_anchors): cls_logits.append(nn.Conv2d(channels, num...
class SSDClassificationHead(SSDScoringHead): def __init__(self, in_channels: list[int], num_anchors: list[int], num_classes: int): pass
2
0
6
0
6
0
2
0
1
3
0
0
1
0
1
14
7
0
7
4
5
0
7
4
5
2
2
1
2
18,271
pytorch/vision
pytorch_vision/torchvision/models/detection/ssd.py
torchvision.models.detection.ssd.SSDFeatureExtractorVGG
from torch import nn, Tensor import torch.nn.functional as F from collections import OrderedDict import torch class SSDFeatureExtractorVGG(nn.Module): def __init__(self, backbone: nn.Module, highres: bool): super().__init__() _, _, maxpool3_pos, maxpool4_pos, _ = (i for i, layer in enumerate(backb...
class SSDFeatureExtractorVGG(nn.Module): def __init__(self, backbone: nn.Module, highres: bool): pass def forward(self, x: Tensor) -> dict[str, Tensor]: pass
3
0
42
4
34
9
2
0.25
1
6
0
0
2
3
2
12
85
9
69
12
66
17
23
12
20
2
1
1
4
18,272
pytorch/vision
pytorch_vision/torchvision/models/detection/ssd.py
torchvision.models.detection.ssd.SSDHead
from torch import nn, Tensor class SSDHead(nn.Module): def __init__(self, in_channels: list[int], num_anchors: list[int], num_classes: int): super().__init__() self.classification_head = SSDClassificationHead(in_channels, num_anchors, num_classes) self.regression_head = SSDRegressionHead(i...
class SSDHead(nn.Module): def __init__(self, in_channels: list[int], num_anchors: list[int], num_classes: int): pass def forward(self, x: list[Tensor]) -> dict[str, Tensor]: pass
3
0
5
0
5
0
1
0
1
6
2
0
2
2
2
12
11
1
10
5
7
0
7
5
4
1
1
0
2
18,273
pytorch/vision
pytorch_vision/torchvision/models/detection/ssd.py
torchvision.models.detection.ssd.SSDRegressionHead
from torch import nn, Tensor class SSDRegressionHead(SSDScoringHead): def __init__(self, in_channels: list[int], num_anchors: list[int]): bbox_reg = nn.ModuleList() for channels, anchors in zip(in_channels, num_anchors): bbox_reg.append(nn.Conv2d(channels, 4 * anchors, kernel_size=3, p...
class SSDRegressionHead(SSDScoringHead): def __init__(self, in_channels: list[int], num_anchors: list[int]): pass
2
0
6
0
6
0
2
0
1
3
0
0
1
0
1
14
7
0
7
4
5
0
7
4
5
2
2
1
2
18,274
pytorch/vision
pytorch_vision/torchvision/models/detection/ssd.py
torchvision.models.detection.ssd.SSDScoringHead
from torch import nn, Tensor import torch import torch.nn.functional as F class SSDScoringHead(nn.Module): def __init__(self, module_list: nn.ModuleList, num_columns: int): super().__init__() self.module_list = module_list self.num_columns = num_columns def _get_result_from_module_lis...
class SSDScoringHead(nn.Module): def __init__(self, module_list: nn.ModuleList, num_columns: int): pass def _get_result_from_module_list(self, x: Tensor, idx: int) -> Tensor: ''' This is equivalent to self.module_list[idx](x), but torchscript doesn't support this yet '...
4
1
11
1
8
2
2
0.25
1
4
0
4
3
2
3
13
35
6
24
13
20
6
24
13
20
4
1
2
7
18,275
pytorch/vision
pytorch_vision/torchvision/models/detection/ssdlite.py
torchvision.models.detection.ssdlite.SSDLite320_MobileNet_V3_Large_Weights
from ...transforms._presets import ObjectDetection from .._meta import _COCO_CATEGORIES from .._api import register_model, Weights, WeightsEnum class SSDLite320_MobileNet_V3_Large_Weights(WeightsEnum): COCO_V1 = Weights(url='https://download.pytorch.org/models/ssdlite320_mobilenet_v3_large_coco-a79551df.pth', tran...
class SSDLite320_MobileNet_V3_Large_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
20
0
20
3
19
1
3
3
2
0
5
0
0
18,276
pytorch/vision
pytorch_vision/torchvision/models/detection/ssdlite.py
torchvision.models.detection.ssdlite.SSDLiteClassificationHead
from .ssd import SSD, SSDScoringHead from typing import Any, Callable, Optional, Union from torch import nn, Tensor class SSDLiteClassificationHead(SSDScoringHead): def __init__(self, in_channels: list[int], num_anchors: list[int], num_classes: int, norm_layer: Callable[..., nn.Module]): cls_logits = nn.M...
class SSDLiteClassificationHead(SSDScoringHead): def __init__(self, in_channels: list[int], num_anchors: list[int], num_classes: int, norm_layer: Callable[..., nn.Module]): pass
2
0
8
0
8
0
2
0
1
3
0
0
1
0
1
14
9
0
9
6
5
0
7
4
5
2
2
1
2
18,277
pytorch/vision
pytorch_vision/torchvision/models/detection/ssdlite.py
torchvision.models.detection.ssdlite.SSDLiteFeatureExtractorMobileNet
from typing import Any, Callable, Optional, Union from ...utils import _log_api_usage_once from torch import nn, Tensor from collections import OrderedDict class SSDLiteFeatureExtractorMobileNet(nn.Module): def __init__(self, backbone: nn.Module, c4_pos: int, norm_layer: Callable[..., nn.Module], width_mult: floa...
class SSDLiteFeatureExtractorMobileNet(nn.Module): def __init__(self, backbone: nn.Module, c4_pos: int, norm_layer: Callable[..., nn.Module], width_mult: float=1.0, min_depth: int=16): pass def get_depth(d): pass def forward(self, x: Tensor) -> dict[str, Tensor]: pass
4
0
22
3
18
3
3
0.14
1
8
0
0
2
2
2
12
46
7
37
16
27
5
20
9
17
3
1
1
5
18,278
pytorch/vision
pytorch_vision/torchvision/models/detection/ssdlite.py
torchvision.models.detection.ssdlite.SSDLiteHead
from typing import Any, Callable, Optional, Union from torch import nn, Tensor class SSDLiteHead(nn.Module): def __init__(self, in_channels: list[int], num_anchors: list[int], num_classes: int, norm_layer: Callable[..., nn.Module]): super().__init__() self.classification_head = SSDLiteClassificati...
class SSDLiteHead(nn.Module): def __init__(self, in_channels: list[int], num_anchors: list[int], num_classes: int, norm_layer: Callable[..., nn.Module]): pass def forward(self, x: list[Tensor]) -> dict[str, Tensor]: pass
3
0
6
0
6
0
1
0
1
6
2
0
2
2
2
12
13
1
12
7
7
0
7
5
4
1
1
0
2
18,279
pytorch/vision
pytorch_vision/torchvision/models/detection/ssdlite.py
torchvision.models.detection.ssdlite.SSDLiteRegressionHead
from typing import Any, Callable, Optional, Union from .ssd import SSD, SSDScoringHead from torch import nn, Tensor class SSDLiteRegressionHead(SSDScoringHead): def __init__(self, in_channels: list[int], num_anchors: list[int], norm_layer: Callable[..., nn.Module]): bbox_reg = nn.ModuleList() for ...
class SSDLiteRegressionHead(SSDScoringHead): def __init__(self, in_channels: list[int], num_anchors: list[int], norm_layer: Callable[..., nn.Module]): pass
2
0
6
0
6
0
2
0
1
3
0
0
1
0
1
14
7
0
7
4
5
0
7
4
5
2
2
1
2
18,280
pytorch/vision
pytorch_vision/torchvision/models/detection/transform.py
torchvision.models.detection.transform.GeneralizedRCNNTransform
from .image_list import ImageList import torch import torchvision import math from typing import Any, Optional from torch import nn, Tensor from .roi_heads import paste_masks_in_image class GeneralizedRCNNTransform(nn.Module): """ Performs input / target transformation before feeding the data to a GeneralizedR...
class GeneralizedRCNNTransform(nn.Module): ''' Performs input / target transformation before feeding the data to a GeneralizedRCNN model. The transformations it performs are: - input normalization (mean subtraction and std division) - input / target resizing to match min_size / max_size...
12
2
18
1
15
1
3
0.15
1
14
1
0
10
7
10
20
200
23
154
79
122
23
126
58
115
9
1
3
34
18,281
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.EfficientNet
from ..ops.misc import Conv2dNormActivation, SqueezeExcitation from ..utils import _log_api_usage_once import torch from collections.abc import Sequence from torch import nn, Tensor import copy from typing import Any, Callable, Optional, Union import math class EfficientNet(nn.Module): def __init__(self, inverted...
class EfficientNet(nn.Module): def __init__(self, inverted_residual_setting: Sequence[Union[MBConvConfig, FusedMBConvConfig]], dropout: float, stochastic_depth_prob: float=0.2, num_classes: int=1000, norm_layer: Optional[Callable[..., nn.Module]]=None, last_channel: Optional[int]=None) -> None: ''' ...
4
1
36
5
26
5
5
0.21
1
11
4
0
3
3
3
13
112
18
78
27
66
16
49
19
45
13
1
3
15
18,282
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.EfficientNet_B0_Weights
from ._api import register_model, Weights, WeightsEnum from ..transforms._presets import ImageClassification, InterpolationMode from functools import partial class EfficientNet_B0_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/efficientnet_b0_rwightman-7f5810bc.pth', transfo...
class EfficientNet_B0_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
22
0
21
3
20
1
3
3
2
0
5
0
0
18,283
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.EfficientNet_B1_Weights
from ..transforms._presets import ImageClassification, InterpolationMode from ._api import register_model, Weights, WeightsEnum from functools import partial class EfficientNet_B1_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/efficientnet_b1_rwightman-bac287d4.pth', transfo...
class EfficientNet_B1_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.04
1
0
0
0
0
0
0
55
46
0
45
4
44
2
4
4
3
0
5
0
0
18,284
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.EfficientNet_B2_Weights
from ._api import register_model, Weights, WeightsEnum from ..transforms._presets import ImageClassification, InterpolationMode from functools import partial class EfficientNet_B2_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/efficientnet_b2_rwightman-c35c1473.pth', transfo...
class EfficientNet_B2_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
22
0
21
3
20
1
3
3
2
0
5
0
0
18,285
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.EfficientNet_B3_Weights
from ._api import register_model, Weights, WeightsEnum from functools import partial from ..transforms._presets import ImageClassification, InterpolationMode class EfficientNet_B3_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/efficientnet_b3_rwightman-b3899882.pth', transfo...
class EfficientNet_B3_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
22
0
21
3
20
1
3
3
2
0
5
0
0
18,286
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.EfficientNet_B4_Weights
from ._api import register_model, Weights, WeightsEnum from functools import partial from ..transforms._presets import ImageClassification, InterpolationMode class EfficientNet_B4_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/efficientnet_b4_rwightman-23ab8bcd.pth', transfo...
class EfficientNet_B4_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
22
0
21
3
20
1
3
3
2
0
5
0
0
18,287
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.EfficientNet_B5_Weights
from functools import partial from ._api import register_model, Weights, WeightsEnum from ..transforms._presets import ImageClassification, InterpolationMode class EfficientNet_B5_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/efficientnet_b5_lukemelas-1a07897c.pth', transfo...
class EfficientNet_B5_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
22
0
21
3
20
1
3
3
2
0
5
0
0
18,288
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.EfficientNet_B6_Weights
from ..transforms._presets import ImageClassification, InterpolationMode from functools import partial from ._api import register_model, Weights, WeightsEnum class EfficientNet_B6_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/efficientnet_b6_lukemelas-24a108a5.pth', transfo...
class EfficientNet_B6_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
22
0
21
3
20
1
3
3
2
0
5
0
0
18,289
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.EfficientNet_B7_Weights
from ..transforms._presets import ImageClassification, InterpolationMode from ._api import register_model, Weights, WeightsEnum from functools import partial class EfficientNet_B7_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/efficientnet_b7_lukemelas-c5b4e57e.pth', transfo...
class EfficientNet_B7_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.05
1
0
0
0
0
0
0
55
22
0
21
3
20
1
3
3
2
0
5
0
0
18,290
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.EfficientNet_V2_L_Weights
from ..transforms._presets import ImageClassification, InterpolationMode from functools import partial from ._api import register_model, Weights, WeightsEnum class EfficientNet_V2_L_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/efficientnet_v2_l-59c71312.pth', transforms=pa...
class EfficientNet_V2_L_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0.04
1
0
0
0
0
0
0
55
27
0
26
3
25
1
3
3
2
0
5
0
0
18,291
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.EfficientNet_V2_M_Weights
from ..transforms._presets import ImageClassification, InterpolationMode from functools import partial from ._api import register_model, Weights, WeightsEnum class EfficientNet_V2_M_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/efficientnet_v2_m-dc08266a.pth', transforms=pa...
class EfficientNet_V2_M_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
28
0
28
3
27
0
3
3
2
0
5
0
0
18,292
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.EfficientNet_V2_S_Weights
from functools import partial from ._api import register_model, Weights, WeightsEnum from ..transforms._presets import ImageClassification, InterpolationMode class EfficientNet_V2_S_Weights(WeightsEnum): IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/efficientnet_v2_s-dd5fe13b.pth', transforms=pa...
class EfficientNet_V2_S_Weights(WeightsEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
28
0
28
3
27
0
3
3
2
0
5
0
0
18,293
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.FusedMBConv
from ..ops.misc import Conv2dNormActivation, SqueezeExcitation from typing import Any, Callable, Optional, Union from torch import nn, Tensor from torchvision.ops import StochasticDepth class FusedMBConv(nn.Module): def __init__(self, cnf: FusedMBConvConfig, stochastic_depth_prob: float, norm_layer: Callable[...,...
class FusedMBConv(nn.Module): def __init__(self, cnf: FusedMBConvConfig, stochastic_depth_prob: float, norm_layer: Callable[..., nn.Module]) -> None: pass def forward(self, input: Tensor) -> Tensor: pass
3
0
29
3
25
1
3
0.04
1
7
3
0
2
4
2
12
59
7
50
16
42
2
22
11
19
3
1
1
5
18,294
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.FusedMBConvConfig
from typing import Any, Callable, Optional, Union from torch import nn, Tensor class FusedMBConvConfig(_MBConvConfig): def __init__(self, expand_ratio: float, kernel: int, stride: int, input_channels: int, out_channels: int, num_layers: int, block: Optional[Callable[..., nn.Module]]=None) -> None: if bloc...
class FusedMBConvConfig(_MBConvConfig): def __init__(self, expand_ratio: float, kernel: int, stride: int, input_channels: int, out_channels: int, num_layers: int, block: Optional[Callable[..., nn.Module]]=None) -> None: pass
2
0
13
0
13
0
2
0.07
1
4
1
0
1
0
1
2
15
0
14
11
3
1
5
2
3
2
1
1
2
18,295
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.MBConv
from functools import partial from ..ops.misc import Conv2dNormActivation, SqueezeExcitation from typing import Any, Callable, Optional, Union from torchvision.ops import StochasticDepth from torch import nn, Tensor class MBConv(nn.Module): def __init__(self, cnf: MBConvConfig, stochastic_depth_prob: float, norm_...
class MBConv(nn.Module): def __init__(self, cnf: MBConvConfig, stochastic_depth_prob: float, norm_layer: Callable[..., nn.Module], se_layer: Callable[..., nn.Module]=SqueezeExcitation) -> None: pass def forward(self, input: Tensor) -> Tensor: pass
3
0
32
4
26
2
3
0.08
1
9
4
0
2
4
2
12
65
9
52
18
43
4
24
12
21
3
1
1
5
18,296
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet.MBConvConfig
import math from typing import Any, Callable, Optional, Union from torch import nn, Tensor class MBConvConfig(_MBConvConfig): def __init__(self, expand_ratio: float, kernel: int, stride: int, input_channels: int, out_channels: int, num_layers: int, width_mult: float=1.0, depth_mult: float=1.0, block: Optional[Cal...
class MBConvConfig(_MBConvConfig): def __init__(self, expand_ratio: float, kernel: int, stride: int, input_channels: int, out_channels: int, num_layers: int, width_mult: float=1.0, depth_mult: float=1.0, block: Optional[Callable[..., nn.Module]]=None) -> None: pass @staticmethod def adjust_depth(n...
4
0
10
0
10
0
2
0.05
1
4
1
0
1
0
2
3
24
1
22
15
7
1
10
3
7
2
1
1
3
18,297
pytorch/vision
pytorch_vision/torchvision/models/efficientnet.py
torchvision.models.efficientnet._MBConvConfig
from torch import nn, Tensor from ._utils import _make_divisible, _ovewrite_named_param, handle_legacy_interface from dataclasses import dataclass from typing import Any, Callable, Optional, Union @dataclass class _MBConvConfig: expand_ratio: float kernel: int stride: int input_channels: int out_ch...
@dataclass class _MBConvConfig: @staticmethod def adjust_channels(channels: int, width_mult: float, min_value: Optional[int]=None) -> int: pass
4
0
2
0
2
0
1
0
0
2
0
2
0
0
1
1
12
1
11
3
8
0
10
2
8
1
0
0
1
18,298
pytorch/vision
pytorch_vision/torchvision/models/feature_extraction.py
torchvision.models.feature_extraction.DualGraphModule
from torch.fx.graph_module import _CodeOnlyModule, _copy_attr, _USER_PRESERVED_ATTRIBUTES_KEY from itertools import chain import torch import copy from torch import fx, nn class DualGraphModule(fx.GraphModule): """ A derivative of `fx.GraphModule`. Differs in the following ways: - Requires a train and eval...
class DualGraphModule(fx.GraphModule): ''' A derivative of `fx.GraphModule`. Differs in the following ways: - Requires a train and eval version of the underlying graph - Copies submodules according to the nodes of both train and eval graphs. - Calling train(mode) switches between train graph and ev...
5
3
22
2
13
8
4
0.73
1
7
0
0
4
4
4
40
98
10
51
17
44
37
39
15
34
6
2
3
15
18,299
pytorch/vision
pytorch_vision/torchvision/models/feature_extraction.py
torchvision.models.feature_extraction.LeafModuleAwareTracer
from torch import fx, nn class LeafModuleAwareTracer(fx.Tracer): """ An fx.Tracer that allows the user to specify a set of leaf modules, i.e. modules that are not to be traced through. The resulting graph ends up having single nodes referencing calls to the leaf modules' forward methods. """ d...
class LeafModuleAwareTracer(fx.Tracer): ''' An fx.Tracer that allows the user to specify a set of leaf modules, i.e. modules that are not to be traced through. The resulting graph ends up having single nodes referencing calls to the leaf modules' forward methods. ''' def __init__(self, *args, ...
3
1
5
0
5
0
2
0.45
1
4
0
1
2
1
2
21
18
2
11
5
8
5
11
5
8
2
2
1
4