repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/configs/fp16/faster_rcnn_r50_fpn_fp16_1x.py | configs/fp16/faster_rcnn_r50_fpn_fp16_1x.py | # fp16 settings
fp16 = dict(loss_scale=512.)
# model settings
model = dict(
type='FasterRCNN',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch'),
neck=dic... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/configs/fp16/retinanet_r50_fpn_fp16_1x.py | configs/fp16/retinanet_r50_fpn_fp16_1x.py | # fp16 settings
fp16 = dict(loss_scale=512.)
# model settings
model = dict(
type='RetinaNet',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch'),
neck=dict... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/__init__.py | mmdet/__init__.py | from .version import __version__, short_version
__all__ = ['__version__', 'short_version']
| python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/coco.py | mmdet/datasets/coco.py | import numpy as np
from pycocotools.coco import COCO
from .custom import CustomDataset
from .registry import DATASETS
@DATASETS.register_module
class CocoDataset(CustomDataset):
CLASSES = ('person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
'train', 'truck', 'boat', 'traffic_light', 'fir... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/registry.py | mmdet/datasets/registry.py | from mmdet.utils import Registry
DATASETS = Registry('dataset')
PIPELINES = Registry('pipeline')
| python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/dataset_wrappers.py | mmdet/datasets/dataset_wrappers.py | import numpy as np
from torch.utils.data.dataset import ConcatDataset as _ConcatDataset
from .registry import DATASETS
@DATASETS.register_module
class ConcatDataset(_ConcatDataset):
"""A wrapper of concatenated dataset.
Same as :obj:`torch.utils.data.dataset.ConcatDataset`, but
concat the group flag for... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/voc.py | mmdet/datasets/voc.py | from .registry import DATASETS
from .xml_style import XMLDataset
@DATASETS.register_module
class VOCDataset(XMLDataset):
CLASSES = ('aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car',
'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse',
'motorbike', 'person', 'pottedpla... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/cityscapes.py | mmdet/datasets/cityscapes.py | from .coco import CocoDataset
from .registry import DATASETS
@DATASETS.register_module
class CityscapesDataset(CocoDataset):
CLASSES = ('person', 'rider', 'car', 'truck', 'bus', 'train', 'motorcycle',
'bicycle')
| python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/extra_aug.py | mmdet/datasets/extra_aug.py | import mmcv
import numpy as np
from numpy import random
from mmdet.core.evaluation.bbox_overlaps import bbox_overlaps
class PhotoMetricDistortion(object):
def __init__(self,
brightness_delta=32,
contrast_range=(0.5, 1.5),
saturation_range=(0.5, 1.5),
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/wider_face.py | mmdet/datasets/wider_face.py | import os.path as osp
import xml.etree.ElementTree as ET
import mmcv
from .registry import DATASETS
from .xml_style import XMLDataset
@DATASETS.register_module
class WIDERFaceDataset(XMLDataset):
"""
Reader for the WIDER Face dataset in PASCAL VOC format.
Conversion scripts can be found in
https://g... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/__init__.py | mmdet/datasets/__init__.py | from .builder import build_dataset
from .cityscapes import CityscapesDataset
from .coco import CocoDataset
from .custom import CustomDataset
from .dataset_wrappers import ConcatDataset, RepeatDataset
from .extra_aug import ExtraAugmentation
from .loader import DistributedGroupSampler, GroupSampler, build_dataloader
fro... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/builder.py | mmdet/datasets/builder.py | import copy
from mmdet.utils import build_from_cfg
from .dataset_wrappers import ConcatDataset, RepeatDataset
from .registry import DATASETS
def _concat_dataset(cfg, default_args=None):
ann_files = cfg['ann_file']
img_prefixes = cfg.get('img_prefix', None)
seg_prefixes = cfg.get('seg_prefixes', None)
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/transforms.py | mmdet/datasets/transforms.py | import mmcv
import numpy as np
import torch
__all__ = [
'ImageTransform', 'BboxTransform', 'MaskTransform', 'SegMapTransform',
'Numpy2Tensor'
]
class ImageTransform(object):
"""Preprocess an image.
1. rescale the image to expected size
2. normalize the image
3. flip the image (if needed)
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/custom.py | mmdet/datasets/custom.py | import os.path as osp
import mmcv
import numpy as np
from torch.utils.data import Dataset
from .pipelines import Compose
from .registry import DATASETS
@DATASETS.register_module
class CustomDataset(Dataset):
"""Custom dataset for detection.
Annotation format:
[
{
'filename': 'a.jpg'... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/xml_style.py | mmdet/datasets/xml_style.py | import os.path as osp
import xml.etree.ElementTree as ET
import mmcv
import numpy as np
from .custom import CustomDataset
from .registry import DATASETS
@DATASETS.register_module
class XMLDataset(CustomDataset):
def __init__(self, min_size=None, **kwargs):
super(XMLDataset, self).__init__(**kwargs)
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/loader/sampler.py | mmdet/datasets/loader/sampler.py | from __future__ import division
import math
import numpy as np
import torch
from mmcv.runner.utils import get_dist_info
from torch.utils.data import DistributedSampler as _DistributedSampler
from torch.utils.data import Sampler
class DistributedSampler(_DistributedSampler):
def __init__(self, dataset, num_repli... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/loader/__init__.py | mmdet/datasets/loader/__init__.py | from .build_loader import build_dataloader
from .sampler import DistributedGroupSampler, GroupSampler
__all__ = ['GroupSampler', 'DistributedGroupSampler', 'build_dataloader']
| python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/loader/build_loader.py | mmdet/datasets/loader/build_loader.py | import platform
from functools import partial
from mmcv.parallel import collate
from mmcv.runner import get_dist_info
from torch.utils.data import DataLoader
from .sampler import DistributedGroupSampler, DistributedSampler, GroupSampler
if platform.system() != 'Windows':
# https://github.com/pytorch/pytorch/issu... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/pipelines/compose.py | mmdet/datasets/pipelines/compose.py | import collections
from mmdet.utils import build_from_cfg
from ..registry import PIPELINES
@PIPELINES.register_module
class Compose(object):
def __init__(self, transforms):
assert isinstance(transforms, collections.abc.Sequence)
self.transforms = []
for transform in transforms:
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/pipelines/formating.py | mmdet/datasets/pipelines/formating.py | from collections.abc import Sequence
import mmcv
import numpy as np
import torch
from mmcv.parallel import DataContainer as DC
from ..registry import PIPELINES
def to_tensor(data):
"""Convert objects of various python types to :obj:`torch.Tensor`.
Supported types are: :class:`numpy.ndarray`, :class:`torch.... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/pipelines/loading.py | mmdet/datasets/pipelines/loading.py | import os.path as osp
import warnings
import mmcv
import numpy as np
import pycocotools.mask as maskUtils
from ..registry import PIPELINES
@PIPELINES.register_module
class LoadImageFromFile(object):
def __init__(self, to_float32=False):
self.to_float32 = to_float32
def __call__(self, results):
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/pipelines/__init__.py | mmdet/datasets/pipelines/__init__.py | from .compose import Compose
from .formating import (Collect, ImageToTensor, ToDataContainer, ToTensor,
Transpose, to_tensor)
from .loading import LoadAnnotations, LoadImageFromFile, LoadProposals
from .test_aug import MultiScaleFlipAug
from .transforms import (Expand, MinIoURandomCrop, Normaliz... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/pipelines/transforms.py | mmdet/datasets/pipelines/transforms.py | import mmcv
import numpy as np
from imagecorruptions import corrupt
from numpy import random
from mmdet.core.evaluation.bbox_overlaps import bbox_overlaps
from ..registry import PIPELINES
@PIPELINES.register_module
class Resize(object):
"""Resize images & bbox & mask.
This transform resizes the input image ... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/datasets/pipelines/test_aug.py | mmdet/datasets/pipelines/test_aug.py | import mmcv
from ..registry import PIPELINES
from .compose import Compose
@PIPELINES.register_module
class MultiScaleFlipAug(object):
def __init__(self, transforms, img_scale, flip=False):
self.transforms = Compose(transforms)
self.img_scale = img_scale if isinstance(img_scale,
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/registry.py | mmdet/models/registry.py | from mmdet.utils import Registry
BACKBONES = Registry('backbone')
NECKS = Registry('neck')
ROI_EXTRACTORS = Registry('roi_extractor')
SHARED_HEADS = Registry('shared_head')
HEADS = Registry('head')
LOSSES = Registry('loss')
DETECTORS = Registry('detector')
| python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/__init__.py | mmdet/models/__init__.py | from .anchor_heads import * # noqa: F401,F403
from .backbones import * # noqa: F401,F403
from .bbox_heads import * # noqa: F401,F403
from .builder import (build_backbone, build_detector, build_head, build_loss,
build_neck, build_roi_extractor, build_shared_head)
from .detectors import * # noqa... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/builder.py | mmdet/models/builder.py | from torch import nn
from mmdet.utils import build_from_cfg
from .registry import (BACKBONES, DETECTORS, HEADS, LOSSES, NECKS,
ROI_EXTRACTORS, SHARED_HEADS)
def build(cfg, registry, default_args=None):
if isinstance(cfg, list):
modules = [
build_from_cfg(cfg_, registry,... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/anchor_heads/ga_rpn_head.py | mmdet/models/anchor_heads/ga_rpn_head.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import normal_init
from mmdet.core import delta2bbox
from mmdet.ops import nms
from ..registry import HEADS
from .guided_anchor_head import GuidedAnchorHead
@HEADS.register_module
class GARPNHead(GuidedAnchorHead):
"""Guided-Anchor-... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/anchor_heads/ssd_head.py | mmdet/models/anchor_heads/ssd_head.py | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import xavier_init
from mmdet.core import AnchorGenerator, anchor_target, multi_apply
from ..losses import smooth_l1_loss
from ..registry import HEADS
from .anchor_head import AnchorHead
# TODO: add loss evaluator for... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/anchor_heads/fsaf_head.py | mmdet/models/anchor_heads/fsaf_head.py | import numpy as np
import torch.nn as nn
from mmcv.cnn import normal_init
from ..registry import HEADS
from ..utils import ConvModule, bias_init_with_prob
from .anchor_head import AnchorHead
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..losses import sigmoid_focal_loss, FocalLoss, iou_los... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/anchor_heads/guided_anchor_head.py | mmdet/models/anchor_heads/guided_anchor_head.py | from __future__ import division
import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import normal_init
from mmdet.core import (AnchorGenerator, anchor_inside_flags, anchor_target,
delta2bbox, force_fp32, ga_loc_target, ga_shape_target,
multi_apply, multi... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/anchor_heads/anchor_head.py | mmdet/models/anchor_heads/anchor_head.py | from __future__ import division
import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import normal_init
from mmdet.core import (AnchorGenerator, anchor_target, delta2bbox, force_fp32,
multi_apply, multiclass_nms)
from ..builder import build_loss
from ..registry import HEADS
imp... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/anchor_heads/__init__.py | mmdet/models/anchor_heads/__init__.py | from .anchor_head import AnchorHead
from .fcos_head import FCOSHead
from .ga_retina_head import GARetinaHead
from .ga_rpn_head import GARPNHead
from .guided_anchor_head import FeatureAdaption, GuidedAnchorHead
from .reppoints_head import RepPointsHead
from .retina_head import RetinaHead
from .rpn_head import RPNHead
fr... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/anchor_heads/ga_retina_head.py | mmdet/models/anchor_heads/ga_retina_head.py | import torch.nn as nn
from mmcv.cnn import normal_init
from mmdet.ops import MaskedConv2d
from ..registry import HEADS
from ..utils import ConvModule, bias_init_with_prob
from .guided_anchor_head import FeatureAdaption, GuidedAnchorHead
@HEADS.register_module
class GARetinaHead(GuidedAnchorHead):
"""Guided-Ancho... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/anchor_heads/reppoints_head.py | mmdet/models/anchor_heads/reppoints_head.py | from __future__ import division
import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import normal_init
from mmdet.core import (PointGenerator, multi_apply, multiclass_nms,
point_target)
from mmdet.ops import DeformConv
from ..builder import build_loss
from ..registry import HEA... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/anchor_heads/retina_head.py | mmdet/models/anchor_heads/retina_head.py | import numpy as np
import torch.nn as nn
from mmcv.cnn import normal_init
from ..registry import HEADS
from ..utils import ConvModule, bias_init_with_prob
from .anchor_head import AnchorHead
@HEADS.register_module
class RetinaHead(AnchorHead):
def __init__(self,
num_classes,
in... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/anchor_heads/rpn_head.py | mmdet/models/anchor_heads/rpn_head.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import normal_init
from mmdet.core import delta2bbox
from mmdet.ops import nms
from ..registry import HEADS
from .anchor_head import AnchorHead
@HEADS.register_module
class RPNHead(AnchorHead):
def __init__(self, in_channels, **kwa... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/anchor_heads/fcos_head.py | mmdet/models/anchor_heads/fcos_head.py | import torch
import torch.nn as nn
from mmcv.cnn import normal_init
from mmdet.core import distance2bbox, force_fp32, multi_apply, multiclass_nms
from ..builder import build_loss
from ..registry import HEADS
from ..utils import ConvModule, Scale, bias_init_with_prob
INF = 1e8
@HEADS.register_module
class FCOSHead(n... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/mask_heads/fused_semantic_head.py | mmdet/models/mask_heads/fused_semantic_head.py | import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import kaiming_init
from mmdet.core import auto_fp16, force_fp32
from ..registry import HEADS
from ..utils import ConvModule
@HEADS.register_module
class FusedSemanticHead(nn.Module):
"""Multi-level fused semantic segmentation head.
in_1 ->... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/mask_heads/htc_mask_head.py | mmdet/models/mask_heads/htc_mask_head.py | from ..registry import HEADS
from ..utils import ConvModule
from .fcn_mask_head import FCNMaskHead
@HEADS.register_module
class HTCMaskHead(FCNMaskHead):
def __init__(self, *args, **kwargs):
super(HTCMaskHead, self).__init__(*args, **kwargs)
self.conv_res = ConvModule(
self.conv_out_c... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/mask_heads/fcn_mask_head.py | mmdet/models/mask_heads/fcn_mask_head.py | import mmcv
import numpy as np
import pycocotools.mask as mask_util
import torch
import torch.nn as nn
from torch.nn.modules.utils import _pair
from mmdet.core import auto_fp16, force_fp32, mask_target
from ..builder import build_loss
from ..registry import HEADS
from ..utils import ConvModule
@HEADS.register_module... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/mask_heads/__init__.py | mmdet/models/mask_heads/__init__.py | from .fcn_mask_head import FCNMaskHead
from .fused_semantic_head import FusedSemanticHead
from .grid_head import GridHead
from .htc_mask_head import HTCMaskHead
from .maskiou_head import MaskIoUHead
__all__ = [
'FCNMaskHead', 'HTCMaskHead', 'FusedSemanticHead', 'GridHead',
'MaskIoUHead'
]
| python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/mask_heads/grid_head.py | mmdet/models/mask_heads/grid_head.py | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import kaiming_init, normal_init
from ..builder import build_loss
from ..registry import HEADS
from ..utils import ConvModule
@HEADS.register_module
class GridHead(nn.Module):
def __init__(self,
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/mask_heads/maskiou_head.py | mmdet/models/mask_heads/maskiou_head.py | import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import kaiming_init, normal_init
from torch.nn.modules.utils import _pair
from mmdet.core import force_fp32
from ..builder import build_loss
from ..registry import HEADS
@HEADS.register_module
class MaskIoUHead(nn.Module):
"""Mask IoU Head.
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/losses/accuracy.py | mmdet/models/losses/accuracy.py | import torch.nn as nn
def accuracy(pred, target, topk=1):
assert isinstance(topk, (int, tuple))
if isinstance(topk, int):
topk = (topk, )
return_single = True
else:
return_single = False
maxk = max(topk)
_, pred_label = pred.topk(maxk, dim=1)
pred_label = pred_label.t(... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/losses/balanced_l1_loss.py | mmdet/models/losses/balanced_l1_loss.py | import numpy as np
import torch
import torch.nn as nn
from ..registry import LOSSES
from .utils import weighted_loss
@weighted_loss
def balanced_l1_loss(pred,
target,
beta=1.0,
alpha=0.5,
gamma=1.5,
reduction='me... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/losses/ghm_loss.py | mmdet/models/losses/ghm_loss.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from ..registry import LOSSES
def _expand_binary_labels(labels, label_weights, label_channels):
bin_labels = labels.new_full((labels.size(0), label_channels), 0)
inds = torch.nonzero(labels >= 1).squeeze()
if inds.numel() > 0:
bin... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/losses/mse_loss.py | mmdet/models/losses/mse_loss.py | import torch.nn as nn
import torch.nn.functional as F
from ..registry import LOSSES
from .utils import weighted_loss
mse_loss = weighted_loss(F.mse_loss)
@LOSSES.register_module
class MSELoss(nn.Module):
def __init__(self, reduction='mean', loss_weight=1.0):
super().__init__()
self.reduction = ... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/losses/smooth_l1_loss.py | mmdet/models/losses/smooth_l1_loss.py | import torch
import torch.nn as nn
from ..registry import LOSSES
from .utils import weighted_loss
@weighted_loss
def smooth_l1_loss(pred, target, beta=1.0):
assert beta > 0
assert pred.size() == target.size() and target.numel() > 0
diff = torch.abs(pred - target)
loss = torch.where(diff < beta, 0.5 *... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/losses/cross_entropy_loss.py | mmdet/models/losses/cross_entropy_loss.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from ..registry import LOSSES
from .utils import weight_reduce_loss
def cross_entropy(pred, label, weight=None, reduction='mean', avg_factor=None):
# element-wise losses
loss = F.cross_entropy(pred, label, reduction='none')
# apply weigh... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/losses/focal_loss.py | mmdet/models/losses/focal_loss.py | import torch.nn as nn
import torch.nn.functional as F
from mmdet.ops import sigmoid_focal_loss as _sigmoid_focal_loss
from ..registry import LOSSES
from .utils import weight_reduce_loss
# This method is only for debugging
def py_sigmoid_focal_loss(pred,
target,
wei... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/losses/utils.py | mmdet/models/losses/utils.py | import functools
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss tensor.
"""
reduction_enum = ... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/losses/__init__.py | mmdet/models/losses/__init__.py | from .accuracy import Accuracy, accuracy
from .balanced_l1_loss import BalancedL1Loss, balanced_l1_loss
from .cross_entropy_loss import (CrossEntropyLoss, binary_cross_entropy,
cross_entropy, mask_cross_entropy)
from .focal_loss import FocalLoss, sigmoid_focal_loss
from .ghm_loss import... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/losses/iou_loss.py | mmdet/models/losses/iou_loss.py | import torch
import torch.nn as nn
from mmdet.core import bbox_overlaps
from ..registry import LOSSES
from .utils import weighted_loss
@weighted_loss
def iou_loss(pred, target, eps=1e-6):
"""IoU loss.
Computing the IoU loss between a set of predicted bboxes and target bboxes.
The loss is calculated as n... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/bbox_heads/bbox_head.py | mmdet/models/bbox_heads/bbox_head.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair
from mmdet.core import (auto_fp16, bbox_target, delta2bbox, force_fp32,
multiclass_nms)
from ..builder import build_loss
from ..losses import accuracy
from ..registry import HEADS
@HEAD... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/bbox_heads/convfc_bbox_head.py | mmdet/models/bbox_heads/convfc_bbox_head.py | import torch.nn as nn
from ..registry import HEADS
from ..utils import ConvModule
from .bbox_head import BBoxHead
@HEADS.register_module
class ConvFCBBoxHead(BBoxHead):
"""More general bbox head, with shared conv and fc layers and two optional
separated branches.
/-> cls conv... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/bbox_heads/__init__.py | mmdet/models/bbox_heads/__init__.py | from .bbox_head import BBoxHead
from .convfc_bbox_head import ConvFCBBoxHead, SharedFCBBoxHead
from .double_bbox_head import DoubleConvFCBBoxHead
__all__ = [
'BBoxHead', 'ConvFCBBoxHead', 'SharedFCBBoxHead', 'DoubleConvFCBBoxHead'
]
| python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/bbox_heads/double_bbox_head.py | mmdet/models/bbox_heads/double_bbox_head.py | import torch.nn as nn
from mmcv.cnn.weight_init import normal_init, xavier_init
from ..backbones.resnet import Bottleneck
from ..registry import HEADS
from ..utils import ConvModule
from .bbox_head import BBoxHead
class BasicResBlock(nn.Module):
"""Basic residual block.
This block is a little different from... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/utils/weight_init.py | mmdet/models/utils/weight_init.py | import numpy as np
import torch.nn as nn
def xavier_init(module, gain=1, bias=0, distribution='normal'):
assert distribution in ['uniform', 'normal']
if distribution == 'uniform':
nn.init.xavier_uniform_(module.weight, gain=gain)
else:
nn.init.xavier_normal_(module.weight, gain=gain)
i... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/utils/conv_ws.py | mmdet/models/utils/conv_ws.py | import torch.nn as nn
import torch.nn.functional as F
def conv_ws_2d(input,
weight,
bias=None,
stride=1,
padding=0,
dilation=1,
groups=1,
eps=1e-5):
c_in = weight.size(0)
weight_flat = weight.view(c_in, -1... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/utils/conv_module.py | mmdet/models/utils/conv_module.py | import warnings
import torch.nn as nn
from mmcv.cnn import constant_init, kaiming_init
from .conv_ws import ConvWS2d
from .norm import build_norm_layer
conv_cfg = {
'Conv': nn.Conv2d,
'ConvWS': ConvWS2d,
# TODO: octave conv
}
def build_conv_layer(cfg, *args, **kwargs):
""" Build convolution layer
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/utils/norm.py | mmdet/models/utils/norm.py | import torch.nn as nn
norm_cfg = {
# format: layer_type: (abbreviation, module)
'BN': ('bn', nn.BatchNorm2d),
'SyncBN': ('bn', nn.SyncBatchNorm),
'GN': ('gn', nn.GroupNorm),
# and potentially 'SN'
}
def build_norm_layer(cfg, num_features, postfix=''):
""" Build normalization layer
Args:
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/utils/scale.py | mmdet/models/utils/scale.py | import torch
import torch.nn as nn
class Scale(nn.Module):
def __init__(self, scale=1.0):
super(Scale, self).__init__()
self.scale = nn.Parameter(torch.tensor(scale, dtype=torch.float))
def forward(self, x):
return x * self.scale
| python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/utils/__init__.py | mmdet/models/utils/__init__.py | from .conv_module import ConvModule, build_conv_layer
from .conv_ws import ConvWS2d, conv_ws_2d
from .norm import build_norm_layer
from .scale import Scale
from .weight_init import (bias_init_with_prob, kaiming_init, normal_init,
uniform_init, xavier_init)
__all__ = [
'conv_ws_2d', 'ConvW... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/plugins/non_local.py | mmdet/models/plugins/non_local.py | import torch
import torch.nn as nn
from mmcv.cnn import constant_init, normal_init
from ..utils import ConvModule
class NonLocal2D(nn.Module):
"""Non-local module.
See https://arxiv.org/abs/1711.07971 for details.
Args:
in_channels (int): Channels of the input feature map.
reduction (in... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/plugins/generalized_attention.py | mmdet/models/plugins/generalized_attention.py | import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import kaiming_init
class GeneralizedAttention(nn.Module):
"""GeneralizedAttention module.
See 'An Empirical Study of Spatial Attention Mechanisms in Deep Networks'
(https://arxiv.org/abs/1711... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/plugins/__init__.py | mmdet/models/plugins/__init__.py | from .generalized_attention import GeneralizedAttention
from .non_local import NonLocal2D
__all__ = ['NonLocal2D', 'GeneralizedAttention']
| python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/roi_extractors/__init__.py | mmdet/models/roi_extractors/__init__.py | from .single_level import SingleRoIExtractor
__all__ = ['SingleRoIExtractor']
| python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/roi_extractors/single_level.py | mmdet/models/roi_extractors/single_level.py | from __future__ import division
import torch
import torch.nn as nn
from mmdet import ops
from mmdet.core import force_fp32
from ..registry import ROI_EXTRACTORS
@ROI_EXTRACTORS.register_module
class SingleRoIExtractor(nn.Module):
"""Extract RoI features from a single level feature map.
If there are mulitpl... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/two_stage.py | mmdet/models/detectors/two_stage.py | import torch
import torch.nn as nn
from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler
from .. import builder
from ..registry import DETECTORS
from .base import BaseDetector
from .test_mixins import BBoxTestMixin, MaskTestMixin, RPNTestMixin
@DETECTORS.register_module
class TwoStageDetector(B... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/mask_rcnn.py | mmdet/models/detectors/mask_rcnn.py | from ..registry import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module
class MaskRCNN(TwoStageDetector):
def __init__(self,
backbone,
rpn_head,
bbox_roi_extractor,
bbox_head,
mask_roi_extractor,
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/fast_rcnn.py | mmdet/models/detectors/fast_rcnn.py | from ..registry import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module
class FastRCNN(TwoStageDetector):
def __init__(self,
backbone,
bbox_roi_extractor,
bbox_head,
train_cfg,
test_cfg,
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/reppoints_detector.py | mmdet/models/detectors/reppoints_detector.py | import torch
from mmdet.core import bbox2result, bbox_mapping_back, multiclass_nms
from ..registry import DETECTORS
from .single_stage import SingleStageDetector
@DETECTORS.register_module
class RepPointsDetector(SingleStageDetector):
"""RepPoints: Point Set Representation for Object Detection.
This det... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/grid_rcnn.py | mmdet/models/detectors/grid_rcnn.py | import torch
from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler
from .. import builder
from ..registry import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module
class GridRCNN(TwoStageDetector):
"""Grid R-CNN.
This detector is the implementation of:
- G... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/retinanet.py | mmdet/models/detectors/retinanet.py | from ..registry import DETECTORS
from .single_stage import SingleStageDetector
@DETECTORS.register_module
class RetinaNet(SingleStageDetector):
def __init__(self,
backbone,
neck,
bbox_head,
train_cfg=None,
test_cfg=None,
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/cascade_rcnn.py | mmdet/models/detectors/cascade_rcnn.py | from __future__ import division
import torch
import torch.nn as nn
from mmdet.core import (bbox2result, bbox2roi, bbox_mapping, build_assigner,
build_sampler, merge_aug_bboxes, merge_aug_masks,
multiclass_nms)
from .. import builder
from ..registry import DETECTORS
from... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/faster_rcnn.py | mmdet/models/detectors/faster_rcnn.py | from ..registry import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module
class FasterRCNN(TwoStageDetector):
def __init__(self,
backbone,
rpn_head,
bbox_roi_extractor,
bbox_head,
train_cfg,
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/htc.py | mmdet/models/detectors/htc.py | import torch
import torch.nn.functional as F
from mmdet.core import (bbox2result, bbox2roi, bbox_mapping, build_assigner,
build_sampler, merge_aug_bboxes, merge_aug_masks,
multiclass_nms)
from .. import builder
from ..registry import DETECTORS
from .cascade_rcnn import C... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/fcos.py | mmdet/models/detectors/fcos.py | from ..registry import DETECTORS
from .single_stage import SingleStageDetector
@DETECTORS.register_module
class FCOS(SingleStageDetector):
def __init__(self,
backbone,
neck,
bbox_head,
train_cfg=None,
test_cfg=None,
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/fsaf.py | mmdet/models/detectors/fsaf.py | from ..registry import DETECTORS
from .single_stage import SingleStageDetector
import pdb
@DETECTORS.register_module
class FSAF(SingleStageDetector):
def __init__(self,
backbone,
neck,
bbox_head,
train_cfg=None,
test_cfg=None,
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/double_head_rcnn.py | mmdet/models/detectors/double_head_rcnn.py | import torch
from mmdet.core import bbox2roi, build_assigner, build_sampler
from ..registry import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module
class DoubleHeadRCNN(TwoStageDetector):
def __init__(self, reg_roi_scale_factor, **kwargs):
super().__init__(**kwargs)
s... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/single_stage.py | mmdet/models/detectors/single_stage.py | import torch.nn as nn
from mmdet.core import bbox2result
from .. import builder
from ..registry import DETECTORS
from .base import BaseDetector
@DETECTORS.register_module
class SingleStageDetector(BaseDetector):
def __init__(self,
backbone,
neck=None,
bbox_head... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/mask_scoring_rcnn.py | mmdet/models/detectors/mask_scoring_rcnn.py | import torch
from mmdet.core import bbox2roi, build_assigner, build_sampler
from .. import builder
from ..registry import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module
class MaskScoringRCNN(TwoStageDetector):
"""Mask Scoring RCNN.
https://arxiv.org/abs/1903.00241
"""
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/__init__.py | mmdet/models/detectors/__init__.py | from .base import BaseDetector
from .cascade_rcnn import CascadeRCNN
from .double_head_rcnn import DoubleHeadRCNN
from .fast_rcnn import FastRCNN
from .faster_rcnn import FasterRCNN
from .fcos import FCOS
from .grid_rcnn import GridRCNN
from .htc import HybridTaskCascade
from .mask_rcnn import MaskRCNN
from .mask_scori... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/test_mixins.py | mmdet/models/detectors/test_mixins.py | from mmdet.core import (bbox2roi, bbox_mapping, merge_aug_bboxes,
merge_aug_masks, merge_aug_proposals, multiclass_nms)
class RPNTestMixin(object):
def simple_test_rpn(self, x, img_meta, rpn_test_cfg):
rpn_outs = self.rpn_head(x)
proposal_inputs = rpn_outs + (img_meta, rpn... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/rpn.py | mmdet/models/detectors/rpn.py | import mmcv
from mmdet.core import bbox_mapping, tensor2imgs
from .. import builder
from ..registry import DETECTORS
from .base import BaseDetector
from .test_mixins import RPNTestMixin
@DETECTORS.register_module
class RPN(BaseDetector, RPNTestMixin):
def __init__(self,
backbone,
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/detectors/base.py | mmdet/models/detectors/base.py | import logging
from abc import ABCMeta, abstractmethod
import mmcv
import numpy as np
import pycocotools.mask as maskUtils
import torch.nn as nn
from mmdet.core import auto_fp16, get_classes, tensor2imgs
class BaseDetector(nn.Module):
"""Base class for detectors"""
__metaclass__ = ABCMeta
def __init__... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/backbones/hrnet.py | mmdet/models/backbones/hrnet.py | import logging
import torch.nn as nn
from mmcv.cnn import constant_init, kaiming_init
from mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm import _BatchNorm
from ..registry import BACKBONES
from ..utils import build_conv_layer, build_norm_layer
from .resnet import BasicBlock, Bottleneck
class HRM... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/backbones/resnet.py | mmdet/models/backbones/resnet.py | import logging
import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.cnn import constant_init, kaiming_init
from mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm import _BatchNorm
from mmdet.models.plugins import GeneralizedAttention
from mmdet.ops import ContextBlock, DeformConv, Modu... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/backbones/resnext.py | mmdet/models/backbones/resnext.py | import math
import torch.nn as nn
from mmdet.ops import DeformConv, ModulatedDeformConv
from ..registry import BACKBONES
from ..utils import build_conv_layer, build_norm_layer
from .resnet import Bottleneck as _Bottleneck
from .resnet import ResNet
class Bottleneck(_Bottleneck):
def __init__(self, inplanes, pl... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/backbones/__init__.py | mmdet/models/backbones/__init__.py | from .hrnet import HRNet
from .resnet import ResNet, make_res_layer
from .resnext import ResNeXt
from .ssd_vgg import SSDVGG
__all__ = ['ResNet', 'make_res_layer', 'ResNeXt', 'SSDVGG', 'HRNet']
| python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/backbones/ssd_vgg.py | mmdet/models/backbones/ssd_vgg.py | import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import VGG, constant_init, kaiming_init, normal_init, xavier_init
from mmcv.runner import load_checkpoint
from ..registry import BACKBONES
@BACKBONES.register_module
class SSDVGG(VGG):
extra_setting = {
300: ... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/necks/bfp.py | mmdet/models/necks/bfp.py | import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import xavier_init
from ..plugins import NonLocal2D
from ..registry import NECKS
from ..utils import ConvModule
@NECKS.register_module
class BFP(nn.Module):
"""BFP (Balanced Feature Pyrmamids)
BFP takes multi-level features as inputs and ga... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/necks/hrfpn.py | mmdet/models/necks/hrfpn.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn.weight_init import caffe2_xavier_init
from torch.utils.checkpoint import checkpoint
from ..registry import NECKS
from ..utils import ConvModule
@NECKS.register_module
class HRFPN(nn.Module):
"""HRFPN (High Resolution Feature Pyrmami... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/necks/__init__.py | mmdet/models/necks/__init__.py | from .bfp import BFP
from .fpn import FPN
from .hrfpn import HRFPN
__all__ = ['FPN', 'BFP', 'HRFPN']
| python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/necks/fpn.py | mmdet/models/necks/fpn.py | import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import xavier_init
from mmdet.core import auto_fp16
from ..registry import NECKS
from ..utils import ConvModule
@NECKS.register_module
class FPN(nn.Module):
def __init__(self,
in_channels,
out_channels,
... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/shared_heads/__init__.py | mmdet/models/shared_heads/__init__.py | from .res_layer import ResLayer
__all__ = ['ResLayer']
| python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/models/shared_heads/res_layer.py | mmdet/models/shared_heads/res_layer.py | import logging
import torch.nn as nn
from mmcv.cnn import constant_init, kaiming_init
from mmcv.runner import load_checkpoint
from mmdet.core import auto_fp16
from ..backbones import ResNet, make_res_layer
from ..registry import SHARED_HEADS
@SHARED_HEADS.register_module
class ResLayer(nn.Module):
def __init__... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/utils/registry.py | mmdet/utils/registry.py | import inspect
import mmcv
class Registry(object):
def __init__(self, name):
self._name = name
self._module_dict = dict()
def __repr__(self):
format_str = self.__class__.__name__ + '(name={}, items={})'.format(
self._name, list(self._module_dict.keys()))
return f... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection | https://github.com/hdjang/Feature-Selective-Anchor-Free-Module-for-Single-Shot-Object-Detection/blob/321a207c499a3f6b260fa2e0644ef90a5d996ddc/mmdet/utils/flops_counter.py | mmdet/utils/flops_counter.py | # Modified from flops-counter.pytorch by Vladislav Sovrasov
# original repo: https://github.com/sovrasov/flops-counter.pytorch
# MIT License
# Copyright (c) 2018 Vladislav Sovrasov
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... | python | Apache-2.0 | 321a207c499a3f6b260fa2e0644ef90a5d996ddc | 2026-01-05T07:09:22.326240Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.