repo stringlengths 1 99 | file stringlengths 13 215 | code stringlengths 12 59.2M | file_length int64 12 59.2M | avg_line_length float64 3.82 1.48M | max_line_length int64 12 2.51M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/detectors/yolo.py | # Copyright (c) OpenMMLab. All rights reserved.
# Copyright (c) 2019 Western Digital Corporation or its affiliates.
import torch
from ..builder import DETECTORS
from .single_stage import SingleStageDetector
@DETECTORS.register_module()
class YOLOV3(SingleStageDetector):
def __init__(self,
backb... | 1,382 | 31.162791 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/detectors/kd_one_stage.py | # Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import torch
from mmcv.runner import load_checkpoint
from .. import build_detector
from ..builder import DETECTORS
from .single_stage import SingleStageDetector
@DETECTORS.register_module()
class KnowledgeDistillationSingleStageDetector(SingleStageDetector)... | 4,150 | 39.696078 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/detectors/yolact.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmdet.core import bbox2result
from ..builder import DETECTORS, build_head
from .single_stage import SingleStageDetector
@DETECTORS.register_module()
class YOLACT(SingleStageDetector):
"""Implementation of `YOLACT <https://arxiv.org/abs/1904.02689>... | 4,585 | 37.864407 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/detectors/rpn.py | # Copyright (c) OpenMMLab. All rights reserved.
import warnings
import mmcv
import torch
from mmcv.image import tensor2imgs
from mmdet.core import bbox_mapping
from ..builder import DETECTORS, build_backbone, build_head, build_neck
from .base import BaseDetector
@DETECTORS.register_module()
class RPN(BaseDetector):... | 5,955 | 37.179487 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/detectors/panoptic_two_stage_segmentor.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmdet.core import bbox2roi, multiclass_nms
from ..builder import DETECTORS, build_head
from ..roi_heads.mask_heads.fcn_mask_head import _do_paste_mask
from .two_stage import TwoStageDetector
@DETECTORS.register_module()
class TwoStagePanopticSegmentor... | 7,725 | 36.872549 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/detectors/centernet.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmdet.core import bbox2result
from mmdet.models.builder import DETECTORS
from ...core.utils import flip_tensor
from .single_stage import SingleStageDetector
@DETECTORS.register_module()
class CenterNet(SingleStageDetector):
"""Implementation of Ce... | 4,206 | 36.5625 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/detectors/cornernet.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmdet.core import bbox2result, bbox_mapping_back
from ..builder import DETECTORS
from .single_stage import SingleStageDetector
@DETECTORS.register_module()
class CornerNet(SingleStageDetector):
"""CornerNet.
This detector is the implementatio... | 3,668 | 36.438776 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/detectors/sparse_rcnn.py | # Copyright (c) OpenMMLab. All rights reserved.
from ..builder import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module()
class SparseRCNN(TwoStageDetector):
r"""Implementation of `Sparse R-CNN: End-to-End Object Detection with
Learnable Proposals <https://arxiv.org/abs/2011.12450>`... | 4,469 | 38.910714 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/seg_heads/base_semantic_head.py | # Copyright (c) OpenMMLab. All rights reserved.
from abc import ABCMeta, abstractmethod
import torch.nn.functional as F
from mmcv.runner import BaseModule, force_fp32
from ..builder import build_loss
from ..utils import interpolate_as
class BaseSemanticHead(BaseModule, metaclass=ABCMeta):
"""Base module of Sema... | 2,969 | 32.75 | 77 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/seg_heads/panoptic_fpn_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.runner import ModuleList
from ..builder import HEADS
from ..utils import ConvUpsample
from .base_semantic_head import BaseSemanticHead
@HEADS.register_module()
class PanopticFPNHead(BaseSemanticHead):
"""PanopticFPNHead ... | 4,382 | 37.787611 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/seg_heads/panoptic_fusion_heads/heuristic_fusion_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmdet.datasets.coco_panoptic import INSTANCE_OFFSET
from mmdet.models.builder import HEADS
from .base_panoptic_fusion_head import BasePanopticFusionHead
@HEADS.register_module()
class HeuristicFusionHead(BasePanopticFusionHead):
"""Fusion Head wit... | 4,474 | 34.23622 | 77 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/plugins/dropblock.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import PLUGIN_LAYERS
eps = 1e-6
@PLUGIN_LAYERS.register_module()
class DropBlock(nn.Module):
"""Randomly drop some regions of feature maps.
Please refer to the method proposed in... | 2,767 | 32.756098 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/yolox_pafpn.py | # Copyright (c) OpenMMLab. All rights reserved.
import math
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule, DepthwiseSeparableConvModule
from mmcv.runner import BaseModule
from ..builder import NECKS
from ..utils import CSPLayer
@NECKS.register_module()
class YOLOXPAFPN(BaseModule):
"""Path ... | 5,647 | 34.974522 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/ssd_neck.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule, DepthwiseSeparableConvModule
from mmcv.runner import BaseModule
from ..builder import NECKS
@NECKS.register_module()
class SSDNeck(BaseModule):
"""Extra layers of SSD backbone to generate multi-sca... | 4,891 | 36.630769 | 77 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/rfp.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import constant_init, xavier_init
from mmcv.runner import BaseModule, ModuleList
from ..builder import NECKS, build_backbone
from .fpn import FPN
class ASPP(BaseModule):
"""ASPP (Atrou... | 5,052 | 36.154412 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/dilated_encoder.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from mmcv.cnn import (ConvModule, caffe2_xavier_init, constant_init, is_norm,
normal_init)
from torch.nn import BatchNorm2d
from ..builder import NECKS
class Bottleneck(nn.Module):
"""Bottleneck block for DilatedEncoder u... | 3,868 | 34.495413 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/fpg.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
from ..builder import NECKS
class Transition(BaseModule):
"""Base class for transition.
Args:
in_channels (int): Number of input ch... | 16,338 | 39.144963 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/pafpn.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import auto_fp16
from ..builder import NECKS
from .fpn import FPN
@NECKS.register_module()
class PAFPN(FPN):
"""Path Aggregation Network for Instance Segmentation... | 6,251 | 38.320755 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/nasfcos_fpn.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, caffe2_xavier_init
from mmcv.ops.merge_cells import ConcatCell
from mmcv.runner import BaseModule
from ..builder import NECKS
@NECKS.register_module()
class NASFCOS_FPN(BaseModule):
... | 6,591 | 37.776471 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/fpn_carafe.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from mmcv.cnn import ConvModule, build_upsample_layer, xavier_init
from mmcv.ops.carafe import CARAFEPack
from mmcv.runner import BaseModule, ModuleList
from ..builder import NECKS
@NECKS.register_module()
class FPN_CARAFE(BaseModule):
"""FPN_... | 11,100 | 39.221014 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/ct_resnet_neck.py | # Copyright (c) OpenMMLab. All rights reserved.
import math
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule, auto_fp16
from mmdet.models.builder import NECKS
@NECKS.register_module()
class CTResNetNeck(BaseModule):
"""The neck used in `CenterNet <https://arxiv.org/abs/19... | 3,642 | 37.347368 | 77 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/fpn.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule, auto_fp16
from ..builder import NECKS
@NECKS.register_module()
class FPN(BaseModule):
r"""Feature Pyramid Network.
This is an implementati... | 8,671 | 41.509804 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/nas_fpn.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.ops.merge_cells import GlobalPoolingCell, SumCell
from mmcv.runner import BaseModule, ModuleList
from ..builder import NECKS
@NECKS.register_module()
class NASFPN(BaseModule):
"""NAS-FPN.
Implemen... | 6,577 | 40.371069 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/bfp.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.cnn.bricks import NonLocal2d
from mmcv.runner import BaseModule
from ..builder import NECKS
@NECKS.register_module()
class BFP(BaseModule):
"""BFP (Balanced Feature Pyramids)
BFP takes m... | 3,777 | 35.679612 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/yolo_neck.py | # Copyright (c) OpenMMLab. All rights reserved.
# Copyright (c) 2019 Western Digital Corporation or its affiliates.
import torch
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
from ..builder import NECKS
class DetectionBlock(BaseModule):
"""Detection block in ... | 5,431 | 37.524823 | 77 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/channel_mapper.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
from ..builder import NECKS
@NECKS.register_module()
class ChannelMapper(BaseModule):
r"""Channel Mapper to reduce/increase channels of backbone features.
This is used to ... | 3,975 | 38.366337 | 77 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/necks/hrfpn.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
from torch.utils.checkpoint import checkpoint
from ..builder import NECKS
@NECKS.register_module()
class HRFPN(BaseModule):
"""HRFP... | 3,509 | 33.752475 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/nasfcos_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import torch.nn as nn
from mmcv.cnn import ConvModule, Scale
from mmdet.models.dense_heads.fcos_head import FCOSHead
from ..builder import HEADS
@HEADS.register_module()
class NASFCOSHead(FCOSHead):
"""Anchor-free head used in `NASFCOS <https://arxiv.o... | 2,908 | 34.91358 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/reppoints_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.ops import DeformConv2d
from mmdet.core import (build_assigner, build_sampler, images_to_levels,
multi_apply, multiclass_nms, unmap)
from mmdet.core.an... | 34,404 | 44.81225 | 101 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/cascade_rpn_head.py | # Copyright (c) OpenMMLab. All rights reserved.
from __future__ import division
import copy
import warnings
import torch
import torch.nn as nn
from mmcv import ConfigDict
from mmcv.ops import DeformConv2d, batched_nms
from mmcv.runner import BaseModule, ModuleList
from mmdet.core import (RegionAssigner, build_assigne... | 33,254 | 41.363057 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/vfnet_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule, Scale
from mmcv.ops import DeformConv2d
from mmcv.runner import force_fp32
from mmdet.core import (bbox2distance, bbox_overlaps, build_anchor_generator,
build_a... | 34,936 | 43.056747 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/centernet_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.cnn import bias_init_with_prob, normal_init
from mmcv.ops import batched_nms
from mmcv.runner import force_fp32
from mmdet.core import multi_apply
from mmdet.models import HEADS, build_loss
from mmdet.models.utils import gauss... | 16,590 | 42.318538 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/fsaf_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
from mmcv.runner import force_fp32
from mmdet.core import (anchor_inside_flags, images_to_levels, multi_apply,
unmap)
from ..builder import HEADS
from ..losses.accuracy import accuracy
from ..losses.utils import wei... | 19,338 | 43.559908 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/atss_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule, Scale
from mmcv.runner import force_fp32
from mmdet.core import (anchor_inside_flags, build_assigner, build_sampler,
images_to_levels, multi_apply, multiclass_nms,
... | 30,397 | 43.311953 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/detr_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import Conv2d, Linear, build_activation_layer
from mmcv.cnn.bricks.transformer import FFN, build_positional_encoding
from mmcv.runner import force_fp32
from mmdet.core import (bbox_cxcywh_to... | 39,708 | 45.992899 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/rpn_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.ops import batched_nms
from mmcv.runner import force_fp32
from ..builder import HEADS
from .anchor_head import AnchorHead
import ipdb
@HEADS.register_module()
class RPNHead(AnchorH... | 14,198 | 43.233645 | 106 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/anchor_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.runner import force_fp32
from mmdet.core import (anchor_inside_flags, build_anchor_generator,
build_assigner, build_bbox_coder, build_sampler,
images_to_levels, multi_apply, mult... | 34,536 | 45.110814 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/yolox_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import (ConvModule, DepthwiseSeparableConvModule,
bias_init_with_prob)
from mmcv.ops.nms import batched_nms
from mmcv.runner import force_fp32
from mmdet.c... | 20,438 | 41.849057 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/retina_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmdet.core import (anchor_inside_flags, build_anchor_generator,
build_assigner, build_bbox_coder, build_sampler,
images_to_levels, multi_apply, multicla... | 4,283 | 35 | 77 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/ga_rpn_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import warnings
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv import ConfigDict
from mmcv.ops import nms
from ..builder import HEADS
from .guided_anchor_head import GuidedAnchorHead
@HEADS.register_module()
class GARPNHead(Gu... | 7,052 | 38.623596 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/deformable_detr_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import Linear, bias_init_with_prob, constant_init
from mmcv.runner import force_fp32
from mmdet.core import multi_apply
from mmdet.models.utils.transformer import inverse_sigmoi... | 13,728 | 42.037618 | 98 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/ga_retina_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.ops import MaskedConv2d
from ..builder import HEADS
from .guided_anchor_head import FeatureAdaption, GuidedAnchorHead
@HEADS.register_module()
class GARetinaHead(GuidedAnchorHead):
"""Guided-Anchor-bas... | 3,923 | 33.421053 | 77 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/ld_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmcv.runner import force_fp32
from mmdet.core import (bbox2distance, bbox_overlaps, distance2bbox,
multi_apply, reduce_mean)
from ..builder import HEADS, build_loss
from .gfl_head import GFLHead
@HEADS.register_module()
class L... | 10,689 | 39.646388 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/ssd_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, DepthwiseSeparableConvModule
from mmcv.runner import force_fp32
from mmdet.core import (build_anchor_generator, build_assigner,
build_bbox_coder, b... | 14,204 | 40.656891 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/fcos_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import Scale
from mmcv.runner import force_fp32
from mmdet.core import distance2bbox, multi_apply, multiclass_nms, reduce_mean
from ..builder import HEADS, build_loss
from .anchor_free_head ... | 29,448 | 44.306154 | 113 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/yolo_head.py | # Copyright (c) OpenMMLab. All rights reserved.
# Copyright (c) 2019 Western Digital Corporation or its affiliates.
import warnings
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import (ConvModule, bias_init_with_prob, constant_init, is_norm,
normal_init)
from ... | 25,798 | 41.855482 | 106 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/centripetal_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from mmcv.cnn import ConvModule, normal_init
from mmcv.ops import DeformConv2d
from mmdet.core import multi_apply
from ..builder import HEADS, build_loss
from .corner_head import CornerHead
@HEADS.register_module()
class CentripetalHead(CornerHead... | 19,811 | 45.28972 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/paa_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
from mmcv.runner import force_fp32
from mmdet.core import multi_apply, multiclass_nms
from mmdet.core.bbox.iou_calculators import bbox_overlaps
from mmdet.models import HEADS
from mmdet.models.dense_heads import ATSSHead
EPS = 1e-12
try:
... | 29,875 | 43.260741 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/ssl_retina_head.py | import torch
from mmdet.models import HEADS
from mmdet.models.dense_heads import RetinaHead
from mmdet.core import anchor_inside_flags, unmap, bbox_overlaps
import ipdb
@HEADS.register_module()
class RetinaHead_SSL(RetinaHead):
def _get_targets_single(self,
flat_anchors,
... | 4,676 | 40.026316 | 94 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/retina_sepbn_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init
from ..builder import HEADS
from .anchor_head import AnchorHead
@HEADS.register_module()
class RetinaSepBNHead(AnchorHead):
""""RetinaHead with separate BN.
In RetinaHead, ... | 4,558 | 37.310924 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/anchor_free_head.py | # Copyright (c) OpenMMLab. All rights reserved.
from abc import abstractmethod
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.runner import force_fp32
from mmdet.core import multi_apply
from ..builder import HEADS, build_loss
from .base_dense_head import BaseDenseHead
from .dense_test_mi... | 13,560 | 38.652047 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/pisa_ssd_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmdet.core import multi_apply
from ..builder import HEADS
from ..losses import CrossEntropyLoss, SmoothL1Loss, carl_loss, isr_p
from .ssd_head import SSDHead
# TODO: add loss evaluator for SSD
@HEADS.register_module()
class PISASSDHead(SSDHead):
... | 5,599 | 38.716312 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/embedding_rpn_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.runner import BaseModule
from mmdet.models.builder import HEADS
from ...core import bbox_cxcywh_to_xyxy
@HEADS.register_module()
class EmbeddingRPNHead(BaseModule):
"""RPNHead in the `Sparse R-CNN <https://arxiv.org/abs/... | 4,629 | 38.57265 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/autoassign_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import bias_init_with_prob, normal_init
from mmcv.runner import force_fp32
from mmdet.core import distance2bbox, multi_apply
from mmdet.core.bbox import bbox_overlaps
from mmdet.models impor... | 22,339 | 42.632813 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/pisa_retinanet_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmcv.runner import force_fp32
from mmdet.core import images_to_levels
from ..builder import HEADS
from ..losses import carl_loss, isr_p
from .retina_head import RetinaHead
@HEADS.register_module()
class PISARetinaHead(RetinaHead):
"""PISA Retinane... | 6,268 | 39.185897 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/gfl_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, Scale
from mmcv.runner import force_fp32
from mmdet.core import (anchor_inside_flags, bbox2distance, bbox_overlaps,
build_assigner, build_sampler, ... | 28,157 | 42.32 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/corner_head.py | # Copyright (c) OpenMMLab. All rights reserved.
from logging import warning
from math import ceil, log
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule, bias_init_with_prob
from mmcv.ops import CornerPool, batched_nms
from mmcv.runner import BaseModule
from mmdet.core import multi_apply
from ..build... | 46,938 | 43.534156 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/yolact_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule, ModuleList, force_fp32
from mmdet.core import build_sampler, fast_nms, images_to_levels, multi_apply
from ..builder i... | 43,490 | 41.680079 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/base_dense_head.py | # Copyright (c) OpenMMLab. All rights reserved.
from abc import ABCMeta, abstractmethod
from mmcv.runner import BaseModule
class BaseDenseHead(BaseModule, metaclass=ABCMeta):
"""Base class for DenseHeads."""
def __init__(self, init_cfg=None):
super(BaseDenseHead, self).__init__(init_cfg)
@abstr... | 2,982 | 36.2875 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/free_anchor_retina_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn.functional as F
from mmdet.core import bbox_overlaps
from ..builder import HEADS
from .retina_head import RetinaHead
EPS = 1e-12
@HEADS.register_module()
class FreeAnchorRetinaHead(RetinaHead):
"""FreeAnchor RetinaHead used in https://... | 11,197 | 40.169118 | 94 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/guided_anchor_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.ops import DeformConv2d, MaskedConv2d
from mmcv.runner import BaseModule, force_fp32
from mmdet.core import (anchor_inside_flags, build_anchor_generator,
build_assigner, build_bbox_coder, build_sampler,... | 37,052 | 42.084884 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/yolof_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.cnn import (ConvModule, bias_init_with_prob, constant_init, is_norm,
normal_init)
from mmcv.runner import force_fp32
from mmdet.core import anchor_inside_flags, multi_apply, reduce_mean, unmap
from ..buil... | 17,398 | 40.724221 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/sabl_retina_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.runner import force_fp32
from mmdet.core import (build_anchor_generator, build_assigner,
build_bbox_coder, build_sampler, images_to_levels,
... | 27,274 | 42.709936 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/fovea_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.ops import DeformConv2d
from mmcv.runner import BaseModule
from mmdet.core import multi_apply, multiclass_nms
from ..builder import HEADS
from .anchor_free_head import AnchorFreeHead
INF = 1e8
... | 14,824 | 41.357143 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/dense_heads/dense_test_mixins.py | # Copyright (c) OpenMMLab. All rights reserved.
import sys
from inspect import signature
import torch
from mmdet.core import bbox_mapping_back, merge_aug_proposals, multiclass_nms
if sys.version_info >= (3, 7):
from mmdet.utils.contextmanagers import completed
class BBoxTestMixin(object):
"""Mixin class fo... | 8,336 | 40.272277 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/utils/csp_layer.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule, DepthwiseSeparableConvModule
from mmcv.runner import BaseModule
class DarknetBottleneck(BaseModule):
"""The basic bottleneck block used in Darknet.
Each ResBlock consists of two ConvModules and... | 5,079 | 32.642384 | 77 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/utils/se_layer.py | # Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
class SELayer(BaseModule):
"""Squeeze-and-Excitation Module.
Args:
channels (int): The input (and output) channels of the SE layer.
ratio (int):... | 2,175 | 35.881356 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/utils/gaussian_target.py | # Copyright (c) OpenMMLab. All rights reserved.
from math import sqrt
import torch
import torch.nn.functional as F
def gaussian2D(radius, sigma=1, dtype=torch.float32, device='cpu'):
"""Generate 2D gaussian kernel.
Args:
radius (int): Radius of gaussian kernel.
sigma (int): Sigma of gaussian... | 8,393 | 30.204461 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/utils/normed_predictor.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import CONV_LAYERS
from .builder import LINEAR_LAYERS
@LINEAR_LAYERS.register_module(name='NormedLinear')
class NormedLinear(nn.Linear):
"""Normalized Linear Layer.
Args:
... | 2,998 | 32.696629 | 77 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/utils/conv_upsample.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule, ModuleList
class ConvUpsample(BaseModule):
"""ConvUpsample performs 2x upsampling after Conv.
There are several `ConvModule` layers. In the first few layers, ups... | 2,653 | 38.029412 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/utils/misc.py | # Copyright (c) OpenMMLab. All rights reserved.
from torch.nn import functional as F
def interpolate_as(source, target, mode='bilinear', align_corners=False):
"""Interpolate the `source` to the shape of the `target`.
The `source` must be a Tensor, but the `target` can be a Tensor or a
np.ndarray with the... | 1,655 | 37.511628 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/utils/res_layer.py | # Copyright (c) OpenMMLab. All rights reserved.
from mmcv.cnn import build_conv_layer, build_norm_layer
from mmcv.runner import BaseModule, Sequential
from torch import nn as nn
class ResLayer(Sequential):
"""ResLayer to build ResNet style backbone.
Args:
block (nn.Module): block used to build ResLay... | 6,392 | 32.471204 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/utils/brick_wrappers.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn.bricks.wrappers import NewEmptyTensorOp, obsolete_torch_version
if torch.__version__ == 'parrots':
TORCH_VERSION = torch.__version__
else:
# torch.__version__ could be 1.3.1+cu92, we only need the first two
# for comparison
... | 1,808 | 34.470588 | 77 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/utils/transformer.py | # Copyright (c) OpenMMLab. All rights reserved.
import math
import warnings
from typing import Sequence
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import (build_activation_layer, build_conv_layer,
build_norm_layer, xavier_init)
from mmcv.cnn.bricks.registry i... | 44,858 | 38.839254 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/utils/positional_encoding.py | # Copyright (c) OpenMMLab. All rights reserved.
import math
import torch
import torch.nn as nn
from mmcv.cnn.bricks.transformer import POSITIONAL_ENCODING
from mmcv.runner import BaseModule
@POSITIONAL_ENCODING.register_module()
class SinePositionalEncoding(BaseModule):
"""Position encoding with sine and cosine ... | 6,568 | 39.054878 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/utils/inverted_residual.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.utils.checkpoint as cp
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
from .se_layer import SELayer
class InvertedResidual(BaseModule):
"""Inverted Residual Block.
Args:
in_channels (int): The input channels of this Mod... | 4,094 | 31.76 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/utils/builder.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from mmcv.utils import Registry, build_from_cfg
TRANSFORMER = Registry('Transformer')
LINEAR_LAYERS = Registry('linear layers')
def build_transformer(cfg, default_args=None):
"""Builder for Transformer."""
return build_from_cfg(cfg, TRANSF... | 1,535 | 31 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/standard_roi_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import numpy as np
from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler
from ..builder import HEADS, build_head, build_roi_extractor
from .base_roi_head import BaseRoIHead
from .test_mixins import BBoxTestMixin, MaskTestMixin
import ipd... | 17,781 | 42.160194 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/grid_roi_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
from mmdet.core import bbox2result, bbox2roi
from ..builder import HEADS, build_head, build_roi_extractor
from .standard_roi_head import StandardRoIHead
@HEADS.register_module()
class GridRoIHead(StandardRoIHead):
"""Grid roi head fo... | 6,961 | 39.71345 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/scnet_roi_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn.functional as F
from mmdet.core import (bbox2result, bbox2roi, bbox_mapping, merge_aug_bboxes,
merge_aug_masks, multiclass_nms)
from ..builder import HEADS, build_head, build_roi_extractor
from ..uti... | 25,683 | 41.382838 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/sparse_roi_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
from mmdet.core import bbox2result, bbox2roi, bbox_xyxy_to_cxcywh
from mmdet.core.bbox.samplers import PseudoSampler
from ..builder import HEADS
from .cascade_roi_head import CascadeRoIHead
@HEADS.register_module()
class SparseRoIHead(Ca... | 14,911 | 44.325228 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/cascade_roi_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn
from mmcv.runner import ModuleList
from mmdet.core import (bbox2result, bbox2roi, bbox_mapping, build_assigner,
build_sampler, merge_aug_bboxes, merge_aug_masks,
multicl... | 27,668 | 42.780063 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/trident_roi_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmcv.ops import batched_nms
from mmdet.core import (bbox2result, bbox2roi, bbox_mapping, merge_aug_bboxes,
multiclass_nms)
from mmdet.models.roi_heads.standard_roi_head import StandardRoIHead
from ..builder import HEADS
@HEADS.... | 5,321 | 42.983471 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/dynamic_roi_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
from mmdet.core import bbox2roi
from mmdet.models.losses import SmoothL1Loss
from ..builder import HEADS
from .standard_roi_head import StandardRoIHead
EPS = 1e-15
@HEADS.register_module()
class DynamicRoIHead(StandardRoIHead):
"""R... | 6,654 | 41.660256 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/point_rend_roi_head.py | # Copyright (c) OpenMMLab. All rights reserved.
# Modified from https://github.com/facebookresearch/detectron2/tree/master/projects/PointRend # noqa
import os
import warnings
import numpy as np
import torch
import torch.nn.functional as F
from mmcv.ops import point_sample, rel_roi_point_to_rel_img_point
from mmdet.c... | 18,743 | 46.573604 | 101 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/mask_scoring_roi_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmdet.core import bbox2roi
from ..builder import HEADS, build_head
from .standard_roi_head import StandardRoIHead
@HEADS.register_module()
class MaskScoringRoIHead(StandardRoIHead):
"""Mask Scoring RoIHead for Mask Scoring RCNN.
https://arxiv... | 5,230 | 44.885965 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/htc_roi_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn.functional as F
from mmdet.core import (bbox2result, bbox2roi, bbox_mapping, merge_aug_bboxes,
merge_aug_masks, multiclass_nms)
from ..builder import HEADS, build_head, build_roi_extractor
from ..uti... | 27,630 | 42.928458 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/test_mixins.py | # Copyright (c) OpenMMLab. All rights reserved.
import sys
import warnings
import numpy as np
import torch
from mmdet.core import (bbox2roi, bbox_mapping, merge_aug_bboxes,
merge_aug_masks, multiclass_nms)
if sys.version_info >= (3, 7):
from mmdet.utils.contextmanagers import completed
... | 13,573 | 42.092063 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/roi_extractors/base_roi_extractor.py | # Copyright (c) OpenMMLab. All rights reserved.
from abc import ABCMeta, abstractmethod
import torch
import torch.nn as nn
from mmcv import ops
from mmcv.runner import BaseModule
class BaseRoIExtractor(BaseModule, metaclass=ABCMeta):
"""Base class for RoI extractor.
Args:
roi_layer (dict): Specify R... | 3,002 | 32.741573 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/roi_extractors/single_level_roi_extractor.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmcv.runner import force_fp32
from mmdet.models.builder import ROI_EXTRACTORS
from .base_roi_extractor import BaseRoIExtractor
import ipdb
@ROI_EXTRACTORS.register_module()
class SingleRoIExtractor(BaseRoIExtractor):
"""Extract RoI features from a ... | 4,876 | 41.408696 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/bbox_heads/bbox_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.runner import BaseModule, auto_fp16, force_fp32
from torch.nn.modules.utils import _pair
from mmdet.core import build_bbox_coder, multi_apply, multiclass_nms
from mmdet.models.builder import HEA... | 26,377 | 41.821429 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/bbox_heads/sabl_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule, force_fp32
from mmdet.core import build_bbox_coder, multi_apply, multiclass_nms
from mmdet.models.builder import HEAD... | 25,073 | 41.861538 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/bbox_heads/dii_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.cnn import (bias_init_with_prob, build_activation_layer,
build_norm_layer)
from mmcv.cnn.bricks.transformer import FFN, MultiheadAttention
from mmcv.runner import auto_fp16, force_fp32
from mmdet.core imp... | 19,027 | 43.983452 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/bbox_heads/convfc_bbox_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmdet.models.builder import HEADS
from mmdet.models.utils import build_linear_layer
from .bbox_head import BBoxHead
import ipdb
@HEADS.register_module()
class ConvFCBBoxHead(BBoxHead):
r"""Mor... | 8,087 | 34.473684 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/bbox_heads/double_bbox_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule, ModuleList
from mmdet.models.backbones.resnet import Bottleneck
from mmdet.models.builder import HEADS
from .bbox_head import BBoxHead
class BasicResBlock(BaseModule):
"""Basi... | 5,733 | 31.03352 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/shared_heads/res_layer.py | # Copyright (c) OpenMMLab. All rights reserved.
import warnings
import torch.nn as nn
from mmcv.runner import BaseModule, auto_fp16
from mmdet.models.backbones import ResNet
from mmdet.models.builder import SHARED_HEADS
from mmdet.models.utils import ResLayer as _ResLayer
@SHARED_HEADS.register_module()
class ResLa... | 2,587 | 30.950617 | 76 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/mask_heads/grid_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
from mmdet.models.builder import HEADS, build_loss
@HEADS.register_module()
class GridHead(BaseModule):
def __i... | 15,579 | 41.802198 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/mask_heads/maskiou_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import Conv2d, Linear, MaxPool2d
from mmcv.runner import BaseModule, force_fp32
from torch.nn.modules.utils import _pair
from mmdet.models.builder import HEADS, build_loss
@HEADS.register_module()
clas... | 7,382 | 39.125 | 79 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/mask_heads/feature_relay_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from mmcv.runner import BaseModule, auto_fp16
from mmdet.models.builder import HEADS
@HEADS.register_module()
class FeatureRelayHead(BaseModule):
"""Feature Relay Head used in `SCNet <https://arxiv.org/abs/2012.10150>`_.
Args:
in_... | 1,930 | 34.759259 | 78 | py |
PseCo | PseCo-master/thirdparty/mmdetection/mmdet/models/roi_heads/mask_heads/global_context_head.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule, auto_fp16, force_fp32
from mmdet.models.builder import HEADS
from mmdet.models.utils import ResLayer, SimplifiedBasicBlock
@HEADS.register_module()
class GlobalContextHead(BaseMod... | 3,774 | 36.009804 | 79 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.