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
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/iSAID/isaid_json.py
projects/iSAID/isaid_json.py
import argparse import json import os.path as osp def json_convert(path): with open(path, 'r+') as f: coco_data = json.load(f) coco_data['categories'].append({'id': 0, 'name': 'background'}) coco_data['categories'] = sorted( coco_data['categories'], key=lambda x: x['id']) ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/iSAID/configs/mask_rcnn_r50_fpn_1x_isaid.py
projects/iSAID/configs/mask_rcnn_r50_fpn_1x_isaid.py
_base_ = [ '../../../configs/_base_/models/mask-rcnn_r50_fpn.py', '../../../configs/_base_/datasets/isaid_instance.py', '../../../configs/_base_/schedules/schedule_1x.py', '../../../configs/_base_/default_runtime.py' ]
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/codetr/co_roi_head.py
projects/CO-DETR/codetr/co_roi_head.py
from typing import List, Tuple import torch from torch import Tensor from mmdet.models.roi_heads import StandardRoIHead from mmdet.models.task_modules.samplers import SamplingResult from mmdet.models.utils import unpack_gt_instances from mmdet.registry import MODELS from mmdet.structures import DetDataSample from mmd...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/codetr/co_dino_head.py
projects/CO-DETR/codetr/co_dino_head.py
# Copyright (c) OpenMMLab. All rights reserved. import copy from typing import List import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import Linear from mmcv.ops import batched_nms from mmengine.structures import InstanceData from torch import Tensor from mmdet.models import DINOHead fr...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/codetr/codetr.py
projects/CO-DETR/codetr/codetr.py
import copy from typing import Tuple, Union import torch import torch.nn as nn from torch import Tensor from mmdet.models.detectors.base import BaseDetector from mmdet.registry import MODELS from mmdet.structures import OptSampleList, SampleList from mmdet.utils import InstanceList, OptConfigType, OptMultiConfig @M...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/codetr/co_atss_head.py
projects/CO-DETR/codetr/co_atss_head.py
from typing import List import torch from torch import Tensor from mmdet.models.dense_heads import ATSSHead from mmdet.models.utils import images_to_levels, multi_apply from mmdet.registry import MODELS from mmdet.utils import InstanceList, OptInstanceList, reduce_mean @MODELS.register_module() class CoATSSHead(ATS...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/codetr/__init__.py
projects/CO-DETR/codetr/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .co_atss_head import CoATSSHead from .co_dino_head import CoDINOHead from .co_roi_head import CoStandardRoIHead from .codetr import CoDETR from .transformer import (CoDinoTransformer, DetrTransformerDecoderLayer, DetrTransformerEncoder, Dino...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/codetr/transformer.py
projects/CO-DETR/codetr/transformer.py
import math import warnings import torch import torch.nn as nn from mmcv.cnn import build_norm_layer from mmcv.cnn.bricks.transformer import (BaseTransformerLayer, TransformerLayerSequence, build_transformer_layer_sequence) from mmcv.ops...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
true
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/configs/codino/co_dino_5scale_r50_lsj_8xb2_3x_coco.py
projects/CO-DETR/configs/codino/co_dino_5scale_r50_lsj_8xb2_3x_coco.py
_base_ = ['co_dino_5scale_r50_lsj_8xb2_1x_coco.py'] param_scheduler = [dict(milestones=[30])] train_cfg = dict(max_epochs=36)
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/configs/codino/co_dino_5scale_r50_8xb2_1x_coco.py
projects/CO-DETR/configs/codino/co_dino_5scale_r50_8xb2_1x_coco.py
_base_ = './co_dino_5scale_r50_lsj_8xb2_1x_coco.py' model = dict( use_lsj=False, data_preprocessor=dict(pad_mask=False, batch_augments=None)) # train_pipeline, NOTE the img_scale and the Pad's size_divisor is different # from the default setting in mmdet. train_pipeline = [ dict(type='LoadImageFromFile', back...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/configs/codino/co_dino_5scale_r50_lsj_8xb2_1x_coco.py
projects/CO-DETR/configs/codino/co_dino_5scale_r50_lsj_8xb2_1x_coco.py
_base_ = 'mmdet::common/ssj_scp_270k_coco-instance.py' custom_imports = dict( imports=['projects.CO-DETR.codetr'], allow_failed_imports=False) # model settings num_dec_layer = 6 loss_lambda = 2.0 num_classes = 80 image_size = (1024, 1024) batch_augments = [ dict(type='BatchFixedSizePad', size=image_size, pad...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/configs/codino/co_dino_5scale_swin_l_lsj_16xb1_3x_coco.py
projects/CO-DETR/configs/codino/co_dino_5scale_swin_l_lsj_16xb1_3x_coco.py
_base_ = ['co_dino_5scale_swin_l_lsj_16xb1_1x_coco.py'] model = dict(backbone=dict(drop_path_rate=0.5)) param_scheduler = [dict(type='MultiStepLR', milestones=[30])] train_cfg = dict(max_epochs=36)
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/configs/codino/co_dino_5scale_swin_l_lsj_16xb1_1x_coco.py
projects/CO-DETR/configs/codino/co_dino_5scale_swin_l_lsj_16xb1_1x_coco.py
_base_ = ['co_dino_5scale_r50_lsj_8xb2_1x_coco.py'] image_size = (1280, 1280) batch_augments = [ dict(type='BatchFixedSizePad', size=image_size, pad_mask=True) ] pretrained = 'https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_large_patch4_window12_384_22k.pth' # noqa # model settings model...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/configs/codino/co_dino_5scale_swin_l_16xb1_16e_o365tococo.py
projects/CO-DETR/configs/codino/co_dino_5scale_swin_l_16xb1_16e_o365tococo.py
_base_ = ['co_dino_5scale_r50_8xb2_1x_coco.py'] pretrained = 'https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_large_patch4_window12_384_22k.pth' # noqa load_from = 'https://download.openmmlab.com/mmdetection/v3.0/codetr/co_dino_5scale_swin_large_16e_o365tococo-614254c9.pth' # noqa # model s...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/configs/codino/co_dino_5scale_swin_l_16xb1_1x_coco.py
projects/CO-DETR/configs/codino/co_dino_5scale_swin_l_16xb1_1x_coco.py
_base_ = ['co_dino_5scale_r50_8xb2_1x_coco.py'] pretrained = 'https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_large_patch4_window12_384_22k.pth' # noqa # model settings model = dict( backbone=dict( _delete_=True, type='SwinTransformer', pretrain_img_size=384, ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/CO-DETR/configs/codino/co_dino_5scale_swin_l_16xb1_3x_coco.py
projects/CO-DETR/configs/codino/co_dino_5scale_swin_l_16xb1_3x_coco.py
_base_ = ['co_dino_5scale_swin_l_16xb1_1x_coco.py'] # model settings model = dict(backbone=dict(drop_path_rate=0.6)) param_scheduler = [dict(milestones=[30])] train_cfg = dict(max_epochs=36)
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/DiffusionDet/model_converters/diffusiondet_resnet_to_mmdet.py
projects/DiffusionDet/model_converters/diffusiondet_resnet_to_mmdet.py
# Copyright (c) OpenMMLab. All rights reserved. import argparse from collections import OrderedDict import numpy as np import torch from mmengine.fileio import load def convert(src, dst): if src.endswith('pth'): src_model = torch.load(src) else: src_model = load(src) dst_state_dict = Ord...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/DiffusionDet/diffusiondet/diffusiondet.py
projects/DiffusionDet/diffusiondet/diffusiondet.py
# Copyright (c) OpenMMLab. All rights reserved. from mmdet.models import SingleStageDetector from mmdet.registry import MODELS from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig @MODELS.register_module() class DiffusionDet(SingleStageDetector): """Implementation of `DiffusionDet <>`_""" def __...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/DiffusionDet/diffusiondet/loss.py
projects/DiffusionDet/diffusiondet/loss.py
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # Modified from https://github.com/ShoufaChen/DiffusionDet/blob/main/diffusiondet/loss.py # noqa # This work is licensed under the CC-BY-NC 4.0 License. # Users should be careful about adopting the...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/DiffusionDet/diffusiondet/__init__.py
projects/DiffusionDet/diffusiondet/__init__.py
from .diffusiondet import DiffusionDet from .head import (DynamicConv, DynamicDiffusionDetHead, SingleDiffusionDetHead, SinusoidalPositionEmbeddings) from .loss import DiffusionDetCriterion, DiffusionDetMatcher __all__ = [ 'DiffusionDet', 'DynamicDiffusionDetHead', 'SingleDiffusionDetHead', ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/DiffusionDet/diffusiondet/head.py
projects/DiffusionDet/diffusiondet/head.py
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # Modified from https://github.com/ShoufaChen/DiffusionDet/blob/main/diffusiondet/detector.py # noqa # Modified from https://github.com/ShoufaChen/DiffusionDet/blob/main/diffusiondet/head.py # noq...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
true
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/DiffusionDet/configs/diffusiondet_r50_fpn_500-proposals_1-step_crop-ms-480-800-450k_coco.py
projects/DiffusionDet/configs/diffusiondet_r50_fpn_500-proposals_1-step_crop-ms-480-800-450k_coco.py
_base_ = [ 'mmdet::_base_/datasets/coco_detection.py', 'mmdet::_base_/schedules/schedule_1x.py', 'mmdet::_base_/default_runtime.py' ] custom_imports = dict( imports=['projects.DiffusionDet.diffusiondet'], allow_failed_imports=False) # model settings model = dict( type='DiffusionDet', data_prep...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/LabelStudio/backend_template/mmdetection.py
projects/LabelStudio/backend_template/mmdetection.py
# Copyright (c) OpenMMLab. All rights reserved. import io import json import logging import os from urllib.parse import urlparse import boto3 from botocore.exceptions import ClientError from label_studio_ml.model import LabelStudioMLBase from label_studio_ml.utils import (DATA_UNDEFINED_NAME, get_image_size, ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/LabelStudio/backend_template/_wsgi.py
projects/LabelStudio/backend_template/_wsgi.py
# Copyright (c) OpenMMLab. All rights reserved. import argparse import json import logging import logging.config import os logging.config.dictConfig({ 'version': 1, 'formatters': { 'standard': { 'format': '[%(asctime)s] [%(levelname)s] [%(name)s::%(funcName)s::%(lineno)d] %(mess...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/ViTDet/vitdet/vit.py
projects/ViTDet/vitdet/vit.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import math import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import build_activation_layer, build_norm_layer from mmcv.cnn.bricks import DropPath from mmengine.logging import MMLogger from mmengine.model import BaseM...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/ViTDet/vitdet/layer_decay_optimizer_constructor.py
projects/ViTDet/vitdet/layer_decay_optimizer_constructor.py
# Copyright (c) OpenMMLab. All rights reserved. import json from typing import List import torch.nn as nn from mmengine.dist import get_dist_info from mmengine.logging import MMLogger from mmengine.optim import DefaultOptimWrapperConstructor from mmdet.registry import OPTIM_WRAPPER_CONSTRUCTORS def get_layer_id_for...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/ViTDet/vitdet/simple_fpn.py
projects/ViTDet/vitdet/simple_fpn.py
# Copyright (c) OpenMMLab. All rights reserved. from typing import List import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule, build_norm_layer from mmengine.model import BaseModule from torch import Tensor from mmdet.registry import MODELS from mmdet.utils import MultiConfig, OptConfi...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/ViTDet/vitdet/fp16_compression_hook.py
projects/ViTDet/vitdet/fp16_compression_hook.py
# Copyright (c) OpenMMLab. All rights reserved. from mmengine.hooks import Hook from mmdet.registry import HOOKS @HOOKS.register_module() class Fp16CompresssionHook(Hook): """Support fp16 compression in DDP mode. In detectron2, vitdet use Fp16CompresssionHook in training process Fp16CompresssionHook can...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/ViTDet/vitdet/__init__.py
projects/ViTDet/vitdet/__init__.py
from .fp16_compression_hook import Fp16CompresssionHook from .layer_decay_optimizer_constructor import LayerDecayOptimizerConstructor from .simple_fpn import SimpleFPN from .vit import LN2d, ViT __all__ = [ 'LayerDecayOptimizerConstructor', 'ViT', 'SimpleFPN', 'LN2d', 'Fp16CompresssionHook' ]
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/ViTDet/configs/lsj-100e_coco-instance.py
projects/ViTDet/configs/lsj-100e_coco-instance.py
_base_ = [ '../../../configs/_base_/default_runtime.py', ] # dataset settings dataset_type = 'CocoDataset' data_root = 'data/coco/' image_size = (1024, 1024) backend_args = None train_pipeline = [ dict(type='LoadImageFromFile', backend_args=backend_args), dict(type='LoadAnnotations', with_bbox=True, with...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/ViTDet/configs/vitdet_mask-rcnn_vit-b-mae_lsj-100e.py
projects/ViTDet/configs/vitdet_mask-rcnn_vit-b-mae_lsj-100e.py
_base_ = [ '../../../configs/_base_/models/mask-rcnn_r50_fpn.py', './lsj-100e_coco-instance.py', ] custom_imports = dict(imports=['projects.ViTDet.vitdet']) backbone_norm_cfg = dict(type='LN', requires_grad=True) norm_cfg = dict(type='LN2d', requires_grad=True) image_size = (1024, 1024) batch_augments = [ ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/SparseInst/configs/sparseinst_r50_iam_8xb8-ms-270k_coco.py
projects/SparseInst/configs/sparseinst_r50_iam_8xb8-ms-270k_coco.py
_base_ = [ 'mmdet::_base_/datasets/coco_instance.py', 'mmdet::_base_/schedules/schedule_1x.py', 'mmdet::_base_/default_runtime.py' ] custom_imports = dict( imports=['projects.SparseInst.sparseinst'], allow_failed_imports=False) model = dict( type='SparseInst', data_preprocessor=dict( t...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/SparseInst/sparseinst/encoder.py
projects/SparseInst/sparseinst/encoder.py
# Copyright (c) Tianheng Cheng and its affiliates. All Rights Reserved import torch import torch.nn as nn import torch.nn.functional as F from mmengine.model.weight_init import caffe2_xavier_init, kaiming_init from mmdet.registry import MODELS class PyramidPoolingModule(nn.Module): def __init__(self, ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/SparseInst/sparseinst/decoder.py
projects/SparseInst/sparseinst/decoder.py
# Copyright (c) Tianheng Cheng and its affiliates. All Rights Reserved import math import torch import torch.nn as nn import torch.nn.functional as F from mmengine.model.weight_init import caffe2_xavier_init, kaiming_init from torch.nn import init from mmdet.registry import MODELS def _make_stack_3x3_convs(num_con...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/SparseInst/sparseinst/sparseinst.py
projects/SparseInst/sparseinst/sparseinst.py
# Copyright (c) Tianheng Cheng and its affiliates. All Rights Reserved from typing import List, Tuple, Union import torch import torch.nn.functional as F from mmengine.structures import InstanceData from torch import Tensor from mmdet.models import BaseDetector from mmdet.models.utils import unpack_gt_instances from ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/SparseInst/sparseinst/loss.py
projects/SparseInst/sparseinst/loss.py
# Copyright (c) Tianheng Cheng and its affiliates. All Rights Reserved import torch import torch.nn as nn import torch.nn.functional as F from scipy.optimize import linear_sum_assignment from torch.cuda.amp import autocast from mmdet.registry import MODELS, TASK_UTILS from mmdet.utils import reduce_mean def compute...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/SparseInst/sparseinst/__init__.py
projects/SparseInst/sparseinst/__init__.py
from .decoder import BaseIAMDecoder, GroupIAMDecoder, GroupIAMSoftDecoder from .encoder import PyramidPoolingModule from .loss import SparseInstCriterion, SparseInstMatcher from .sparseinst import SparseInst __all__ = [ 'BaseIAMDecoder', 'GroupIAMDecoder', 'GroupIAMSoftDecoder', 'PyramidPoolingModule', 'Sparse...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/demo.py
projects/XDecoder/demo.py
# Copyright (c) OpenMMLab. All rights reserved. from argparse import ArgumentParser from mmengine.config import Config from mmengine.logging import print_log from mmdet.apis import DetInferencer from projects.XDecoder.xdecoder.inference import ( ImageCaptionInferencer, RefImageCaptionInferencer, TextToImageRe...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/xdecoder/transformer_decoder.py
projects/XDecoder/xdecoder/transformer_decoder.py
import torch from torch import nn from torch.nn import functional as F from mmdet.registry import MODELS from .language_model import LanguageEncoder from .transformer_blocks import (MLP, Conv2d, CrossAttentionLayer, FFNLayer, PositionEmbeddingSine, SelfAttentionLayer) from .utils impor...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/xdecoder/transformer_blocks.py
projects/XDecoder/xdecoder/transformer_blocks.py
import copy import math from typing import Optional import torch import torch.nn.functional as F from torch import Tensor, nn # modified from https://github.com/microsoft/X-Decoder/blob/main/xdecoder/body/transformer_blocks.py # noqa """Transformer class. Copy-paste from torch.nn.Transformer with modifications: ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/xdecoder/utils.py
projects/XDecoder/xdecoder/utils.py
import logging from contextlib import contextmanager from functools import wraps import torch from mmcv.cnn.bricks.wrappers import obsolete_torch_version from torch.nn import functional as F TORCH_VERSION = tuple(int(x) for x in torch.__version__.split('.')[:2]) def is_lower_torch_version(version=(1, 10)): """C...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/xdecoder/language_model.py
projects/XDecoder/xdecoder/language_model.py
import os from collections import OrderedDict import torch from mmcv.cnn.bricks import DropPath from torch import nn from transformers import CLIPTokenizer from .utils import get_prompt_templates # modified from https://github.com/microsoft/X-Decoder/blob/main/xdecoder/language/vlpencoder.py # noqa class LanguageE...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/xdecoder/unified_head.py
projects/XDecoder/xdecoder/unified_head.py
import copy from typing import Sequence import torch from mmengine.structures import InstanceData, PixelData from torch import nn from torch.nn import functional as F from mmdet.evaluation.functional import INSTANCE_OFFSET from mmdet.registry import MODELS from .utils import (is_lower_torch_version, retry_if_cuda_oom...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/xdecoder/__init__.py
projects/XDecoder/xdecoder/__init__.py
from .focalnet import FocalNet from .pixel_decoder import XTransformerEncoderPixelDecoder from .transformer_decoder import XDecoderTransformerDecoder from .unified_head import XDecoderUnifiedhead from .xdecoder import XDecoder __all__ = [ 'XDecoder', 'FocalNet', 'XDecoderUnifiedhead', 'XTransformerEncoderPixel...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/xdecoder/focalnet.py
projects/XDecoder/xdecoder/focalnet.py
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint as checkpoint from mmcv.cnn.bricks import DropPath from mmdet.registry import MODELS # modified from https://github.com/microsoft/X-Decoder/blob/main/xdecoder/backbone/focal_dw.py # noqa @MODELS.register_module() class ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/xdecoder/xdecoder.py
projects/XDecoder/xdecoder/xdecoder.py
from torch import Tensor from mmdet.models.detectors.single_stage import SingleStageDetector from mmdet.registry import MODELS from mmdet.structures import SampleList from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig @MODELS.register_module() class XDecoder(SingleStageDetector): def __init__(sel...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/xdecoder/pixel_decoder.py
projects/XDecoder/xdecoder/pixel_decoder.py
from typing import Callable, Optional, Union from torch import nn from torch.nn import functional as F from mmdet.registry import MODELS from .transformer_blocks import (Conv2d, PositionEmbeddingSine, TransformerEncoder, TransformerEncoderLayer, get_no...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/xdecoder/inference/__init__.py
projects/XDecoder/xdecoder/inference/__init__.py
from .image_caption import ImageCaptionInferencer, RefImageCaptionInferencer from .texttoimage_regionretrieval_inferencer import \ TextToImageRegionRetrievalInferencer __all__ = [ 'ImageCaptionInferencer', 'RefImageCaptionInferencer', 'TextToImageRegionRetrievalInferencer' ]
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/xdecoder/inference/image_caption.py
projects/XDecoder/xdecoder/inference/image_caption.py
import copy import os.path as osp from typing import Iterable, List, Optional, Tuple, Union import mmcv import mmengine import numpy as np import torch from mmengine.dataset import Compose from rich.progress import track from mmdet.apis.det_inferencer import DetInferencer, InputsType, PredType from mmdet.utils import...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/xdecoder/inference/texttoimage_regionretrieval_inferencer.py
projects/XDecoder/xdecoder/inference/texttoimage_regionretrieval_inferencer.py
import copy from typing import Iterable, Optional, Union import torch from mmengine.dataset import Compose from rich.progress import track from mmdet.apis.det_inferencer import DetInferencer, InputsType from mmdet.utils import ConfigType class TextToImageRegionRetrievalInferencer(DetInferencer): def _init_pipe...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-instance_ade20k.py
projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-instance_ade20k.py
_base_ = [ '_base_/xdecoder-tiny_open-vocab-instance.py', 'mmdet::_base_/datasets/ade20k_instance.py' ] test_pipeline = [ dict(type='LoadImageFromFile', backend_args=_base_.backend_args), dict(type='Resize', scale=(2560, 640), keep_ratio=True), dict(type='LoadAnnotations', with_bbox=True, with_mask...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-ref-seg_refcocog.py
projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-ref-seg_refcocog.py
_base_ = [ '_base_/xdecoder-tiny_ref-seg.py', 'mmdet::_base_/datasets/refcocog.py' ]
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-semseg_ade20k.py
projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-semseg_ade20k.py
_base_ = [ '_base_/xdecoder-tiny_open-vocab-semseg.py', 'mmdet::_base_/datasets/ade20k_semantic.py' ] test_pipeline = [ dict(type='LoadImageFromFile', backend_args=_base_.backend_args), dict(type='Resize', scale=(2560, 640), keep_ratio=True), dict( type='LoadAnnotations', with_bbox=...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/xdecoder-tiny_zeroshot_ref-caption.py
projects/XDecoder/configs/xdecoder-tiny_zeroshot_ref-caption.py
_base_ = 'xdecoder-tiny_zeroshot_caption_coco2014.py' model = dict(head=dict(task='ref-caption')) grounding_scale = 512 test_pipeline = [ dict(type='LoadImageFromFile', imdecode_backend='pillow'), dict(type='ResizeShortestEdge', scale=224, backend='pillow'), dict( type='PackDetInputs', me...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-instance_coco.py
projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-instance_coco.py
_base_ = [ '_base_/xdecoder-tiny_open-vocab-instance.py', 'mmdet::_base_/datasets/coco_instance.py' ] test_pipeline = [ dict( type='LoadImageFromFile', imdecode_backend='pillow', backend_args=_base_.backend_args), dict( type='ResizeShortestEdge', scale=800, max_size=1333...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-panoptic_coco.py
projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-panoptic_coco.py
_base_ = [ '_base_/xdecoder-tiny_open-vocab-panoptic.py', 'mmdet::_base_/datasets/coco_panoptic.py' ] model = dict(test_cfg=dict(mask_thr=0.4)) test_pipeline = [ dict( type='LoadImageFromFile', imdecode_backend='pillow', backend_args=_base_.backend_args), dict( type='Re...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-ref-seg_refcoco.py
projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-ref-seg_refcoco.py
_base_ = [ '_base_/xdecoder-tiny_ref-seg.py', 'mmdet::_base_/datasets/refcoco.py' ]
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-ref-seg_refcoco+.py
projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-ref-seg_refcoco+.py
_base_ = [ '_base_/xdecoder-tiny_ref-seg.py', 'mmdet::_base_/datasets/refcoco+.py' ]
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-semseg_coco.py
projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-semseg_coco.py
_base_ = '_base_/xdecoder-tiny_open-vocab-semseg.py' dataset_type = 'CocoSegDataset' data_root = 'data/coco/' test_pipeline = [ dict( type='LoadImageFromFile', imdecode_backend='pillow', backend_args=None), dict( type='ResizeShortestEdge', scale=800, max_size=1333, backend='pillow'), ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/xdecoder-tiny_zeroshot_caption_coco2014.py
projects/XDecoder/configs/xdecoder-tiny_zeroshot_caption_coco2014.py
_base_ = [ '_base_/xdecoder-tiny_caption.py', 'mmdet::_base_/datasets/coco_caption.py' ] test_pipeline = [ dict( type='LoadImageFromFile', imdecode_backend='pillow', backend_args=_base_.backend_args), dict(type='ResizeShortestEdge', scale=224, backend='pillow'), dict( ty...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/xdecoder-tiny_zeroshot_text-image-retrieval.py
projects/XDecoder/configs/xdecoder-tiny_zeroshot_text-image-retrieval.py
_base_ = 'xdecoder-tiny_zeroshot_caption_coco2014.py' model = dict(head=dict(task='retrieval')) grounding_scale = 512 test_pipeline = [ dict( type='LoadImageFromFile', imdecode_backend='pillow', backend_args=_base_.backend_args), dict( type='ResizeShortestEdge', scale=...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-panoptic_ade20k.py
projects/XDecoder/configs/xdecoder-tiny_zeroshot_open-vocab-panoptic_ade20k.py
_base_ = [ '_base_/xdecoder-tiny_open-vocab-panoptic.py', 'mmdet::_base_/datasets/ade20k_panoptic.py' ] model = dict(test_cfg=dict(mask_thr=0.4)) test_pipeline = [ dict(type='LoadImageFromFile', backend_args=_base_.backend_args), dict(type='Resize', scale=(2560, 640), keep_ratio=True), dict(type='...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/_base_/xdecoder-tiny_caption.py
projects/XDecoder/configs/_base_/xdecoder-tiny_caption.py
_base_ = 'xdecoder-tiny_open-vocab-semseg.py' model = dict(head=dict(task='caption'))
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/_base_/xdecoder-tiny_open-vocab-semseg.py
projects/XDecoder/configs/_base_/xdecoder-tiny_open-vocab-semseg.py
_base_ = 'mmdet::_base_/default_runtime.py' custom_imports = dict( imports=['projects.XDecoder.xdecoder'], allow_failed_imports=False) model = dict( type='XDecoder', data_preprocessor=dict( type='DetDataPreprocessor', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/_base_/xdecoder-tiny_open-vocab-panoptic.py
projects/XDecoder/configs/_base_/xdecoder-tiny_open-vocab-panoptic.py
_base_ = 'xdecoder-tiny_open-vocab-semseg.py' model = dict( head=dict(task='panoptic'), test_cfg=dict(mask_thr=0.8, overlap_thr=0.8))
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/_base_/xdecoder-tiny_open-vocab-instance.py
projects/XDecoder/configs/_base_/xdecoder-tiny_open-vocab-instance.py
_base_ = 'xdecoder-tiny_open-vocab-semseg.py' model = dict(head=dict(task='instance'), test_cfg=dict(max_per_img=100))
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/XDecoder/configs/_base_/xdecoder-tiny_ref-seg.py
projects/XDecoder/configs/_base_/xdecoder-tiny_ref-seg.py
_base_ = 'xdecoder-tiny_open-vocab-semseg.py' model = dict(head=dict(task='ref-seg'))
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/HDINO/h_dino_head.py
projects/HDINO/h_dino_head.py
# Copyright (c) OpenMMLab. All rights reserved. from typing import Dict, List from torch import Tensor from mmdet.models.dense_heads.dino_head import DINOHead from mmdet.models.utils import multi_apply from mmdet.registry import MODELS from mmdet.utils import InstanceList, OptInstanceList @MODELS.register_module() ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/HDINO/h-dino-4scale_r50_8xb2-12e_coco.py
projects/HDINO/h-dino-4scale_r50_8xb2-12e_coco.py
_base_ = [ '../../configs/_base_/datasets/coco_detection.py', '../../configs/_base_/default_runtime.py' ] custom_imports = dict(imports=['projects.HDINO'], allow_failed_imports=False) model = dict( type='HDINO', num_queries=1800, # num_total_queries: 900+900 with_box_refine=True, as_two_stage...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/HDINO/__init__.py
projects/HDINO/__init__.py
from .h_dino import HDINO from .h_dino_head import HybridDINOHead __all__ = ['HDINO', 'HybridDINOHead']
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/HDINO/h_dino.py
projects/HDINO/h_dino.py
# Copyright (c) OpenMMLab. All rights reserved. from typing import Tuple import torch from torch import Tensor, nn from torch.nn.init import normal_ from mmdet.models.detectors import DINO, DeformableDETR from mmdet.models.detectors.deformable_detr import \ MultiScaleDeformableAttention from mmdet.registry import...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/convert_tf_to_pt.py
projects/EfficientDet/convert_tf_to_pt.py
import argparse import numpy as np import torch from tensorflow.python.training import py_checkpoint_reader torch.set_printoptions(precision=20) def tf2pth(v): if v.ndim == 4: return np.ascontiguousarray(v.transpose(3, 2, 0, 1)) elif v.ndim == 2: return np.ascontiguousarray(v.transpose()) ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/efficientdet/efficientdet_head.py
projects/EfficientDet/efficientdet/efficientdet_head.py
# Copyright (c) OpenMMLab. All rights reserved. from typing import List, Tuple import torch import torch.nn as nn from mmcv.cnn.bricks import Swish, build_norm_layer from mmengine.model import bias_init_with_prob from torch import Tensor from mmdet.models.dense_heads.anchor_head import AnchorHead from mmdet.models.ut...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/efficientdet/utils.py
projects/EfficientDet/efficientdet/utils.py
import math from typing import Tuple, Union import torch import torch.nn as nn from mmcv.cnn.bricks import Swish, build_norm_layer from torch.nn import functional as F from torch.nn.init import _calculate_fan_in_and_fan_out, trunc_normal_ from mmdet.registry import MODELS from mmdet.utils import OptConfigType def v...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/efficientdet/bifpn.py
projects/EfficientDet/efficientdet/bifpn.py
from typing import List import torch import torch.nn as nn from mmcv.cnn.bricks import Swish from mmengine.model import BaseModule from mmdet.registry import MODELS from mmdet.utils import MultiConfig, OptConfigType from .utils import DepthWiseConvBlock, DownChannelBlock, MaxPool2dSamePadding class BiFPNStage(nn.Mo...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/efficientdet/efficientdet.py
projects/EfficientDet/efficientdet/efficientdet.py
# Copyright (c) OpenMMLab. All rights reserved. from mmdet.models.detectors.single_stage import SingleStageDetector from mmdet.registry import MODELS from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig @MODELS.register_module() class EfficientDet(SingleStageDetector): def __init__(self, ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/efficientdet/__init__.py
projects/EfficientDet/efficientdet/__init__.py
from .bifpn import BiFPN from .efficientdet import EfficientDet from .efficientdet_head import EfficientDetSepBNHead from .huber_loss import HuberLoss from .tensorflow.anchor_generator import YXYXAnchorGenerator from .tensorflow.coco_90class import Coco90Dataset from .tensorflow.coco_90metric import Coco90Metric from ....
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/efficientdet/huber_loss.py
projects/EfficientDet/efficientdet/huber_loss.py
# Copyright (c) OpenMMLab. All rights reserved. from typing import Optional import torch import torch.nn as nn from torch import Tensor from mmdet.models.losses.utils import weighted_loss from mmdet.registry import MODELS @weighted_loss def huber_loss(pred: Tensor, target: Tensor, beta: float = 1.0) -> Tensor: ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/efficientdet/tensorflow/coco_90class.py
projects/EfficientDet/efficientdet/tensorflow/coco_90class.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import os.path as osp from typing import List, Union from mmengine.fileio import get_local_path from mmdet.datasets.base_det_dataset import BaseDetDataset from mmdet.registry import DATASETS from .api_wrappers import COCO @DATASETS.register_module() class ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/efficientdet/tensorflow/yxyx_bbox_coder.py
projects/EfficientDet/efficientdet/tensorflow/yxyx_bbox_coder.py
# Copyright (c) OpenMMLab. All rights reserved. import warnings import numpy as np import torch from mmdet.models.task_modules.coders.delta_xywh_bbox_coder import \ DeltaXYWHBBoxCoder from mmdet.registry import TASK_UTILS from mmdet.structures.bbox import HorizontalBoxes, get_box_tensor @TASK_UTILS.register_mod...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/efficientdet/tensorflow/trans_max_iou_assigner.py
projects/EfficientDet/efficientdet/tensorflow/trans_max_iou_assigner.py
# Copyright (c) OpenMMLab. All rights reserved. from typing import Optional import torch from mmengine.structures import InstanceData from mmdet.models.task_modules.assigners.assign_result import AssignResult from mmdet.models.task_modules.assigners.max_iou_assigner import MaxIoUAssigner from mmdet.registry import TA...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/efficientdet/tensorflow/anchor_generator.py
projects/EfficientDet/efficientdet/tensorflow/anchor_generator.py
# Copyright (c) OpenMMLab. All rights reserved. from typing import Optional, Tuple, Union import torch from torch import Tensor from mmdet.models.task_modules.prior_generators.anchor_generator import \ AnchorGenerator from mmdet.registry import TASK_UTILS from mmdet.structures.bbox import HorizontalBoxes DeviceT...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/efficientdet/tensorflow/coco_90metric.py
projects/EfficientDet/efficientdet/tensorflow/coco_90metric.py
# Copyright (c) OpenMMLab. All rights reserved. import datetime import itertools import os.path as osp import tempfile from collections import OrderedDict from typing import Dict, List, Optional, Sequence, Union import numpy as np from mmengine.evaluator import BaseMetric from mmengine.fileio import dump, get_local_pa...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/efficientdet/tensorflow/api_wrappers/coco_api.py
projects/EfficientDet/efficientdet/tensorflow/api_wrappers/coco_api.py
# Copyright (c) OpenMMLab. All rights reserved. # This file add snake case alias for coco api import warnings from collections import defaultdict from typing import List, Optional, Union import pycocotools from pycocotools.coco import COCO as _COCO from pycocotools.cocoeval import COCOeval as _COCOeval class COCO(_...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/efficientdet/tensorflow/api_wrappers/__init__.py
projects/EfficientDet/efficientdet/tensorflow/api_wrappers/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .coco_api import COCO, COCOeval, COCOPanoptic __all__ = ['COCO', 'COCOeval', 'COCOPanoptic']
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/configs/efficientdet_effb3_bifpn_8xb16-crop896-300e_coco.py
projects/EfficientDet/configs/efficientdet_effb3_bifpn_8xb16-crop896-300e_coco.py
_base_ = [ 'mmdet::_base_/datasets/coco_detection.py', 'mmdet::_base_/schedules/schedule_1x.py', 'mmdet::_base_/default_runtime.py' ] custom_imports = dict( imports=['projects.EfficientDet.efficientdet'], allow_failed_imports=False) image_size = 896 batch_augments = [ dict(type='BatchFixedSizePad',...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/configs/efficientdet_effb3_bifpn_8xb16-crop896-300e_coco-90cls.py
projects/EfficientDet/configs/efficientdet_effb3_bifpn_8xb16-crop896-300e_coco-90cls.py
_base_ = [ 'mmdet::_base_/datasets/coco_detection.py', 'mmdet::_base_/schedules/schedule_1x.py', 'mmdet::_base_/default_runtime.py' ] custom_imports = dict( imports=['projects.EfficientDet.efficientdet'], allow_failed_imports=False) image_size = 896 batch_augments = [ dict(type='BatchFixedSizePad',...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/configs/efficientdet_effb0_bifpn_8xb16-crop512-300e_coco.py
projects/EfficientDet/configs/efficientdet_effb0_bifpn_8xb16-crop512-300e_coco.py
_base_ = [ 'mmdet::_base_/datasets/coco_detection.py', 'mmdet::_base_/schedules/schedule_1x.py', 'mmdet::_base_/default_runtime.py' ] custom_imports = dict( imports=['projects.EfficientDet.efficientdet'], allow_failed_imports=False) image_size = 512 batch_augments = [ dict(type='BatchFixedSizePad',...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/EfficientDet/configs/tensorflow/efficientdet_effb0_bifpn_8xb16-crop512-300e_coco_tf.py
projects/EfficientDet/configs/tensorflow/efficientdet_effb0_bifpn_8xb16-crop512-300e_coco_tf.py
_base_ = [ 'mmdet::_base_/datasets/coco_detection.py', 'mmdet::_base_/schedules/schedule_1x.py', 'mmdet::_base_/default_runtime.py' ] custom_imports = dict( imports=['projects.EfficientDet.efficientdet'], allow_failed_imports=False) image_size = 512 batch_augments = [ dict(type='BatchFixedSizePad',...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/RF100-Benchmark/coco.py
projects/RF100-Benchmark/coco.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import os.path as osp from typing import List, Union from mmengine.fileio import get_local_path from mmdet.datasets.api_wrappers import COCO from mmdet.datasets.coco import CocoDataset from mmdet.registry import DATASETS @DATASETS.register_module() class R...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/RF100-Benchmark/coco_metric.py
projects/RF100-Benchmark/coco_metric.py
# Copyright (c) OpenMMLab. All rights reserved. import itertools import os.path as osp import tempfile from collections import OrderedDict from typing import Dict import numpy as np from mmengine.fileio import load from mmengine.logging import MMLogger from terminaltables import AsciiTable from mmdet.datasets.api_wra...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/RF100-Benchmark/__init__.py
projects/RF100-Benchmark/__init__.py
from .coco import RF100CocoDataset from .coco_metric import RF100CocoMetric __all__ = ['RF100CocoDataset', 'RF100CocoMetric']
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/RF100-Benchmark/scripts/log_extract.py
projects/RF100-Benchmark/scripts/log_extract.py
import argparse import csv import json import os import re import numpy as np import pandas as pd from openpyxl import load_workbook from openpyxl.styles import Alignment def parse_args(): parser = argparse.ArgumentParser(description='log_name') parser.add_argument( 'method', type=str, help='method n...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/RF100-Benchmark/scripts/download_dataset.py
projects/RF100-Benchmark/scripts/download_dataset.py
from argparse import ArgumentParser from os import environ from pathlib import Path from roboflow import Roboflow def main(): # construct the argument parser and parse the arguments parser = ArgumentParser() parser.add_argument( '-p', '--project', required=True, type=str,...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/RF100-Benchmark/scripts/create_new_config.py
projects/RF100-Benchmark/scripts/create_new_config.py
from argparse import ArgumentParser from mmengine.fileio import load from mmengine.utils import mkdir_or_exist def parse_args(): parser = ArgumentParser(description='create new config') parser.add_argument('config') parser.add_argument('dataset') parser.add_argument('--save-dir', default='temp_config...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/RF100-Benchmark/scripts/parse_dataset_link.py
projects/RF100-Benchmark/scripts/parse_dataset_link.py
import re from argparse import ArgumentParser def main(): parser = ArgumentParser( description='A handy script that will decompose and print from ' "a roboflow dataset link it's workspace, project and version") parser.add_argument( '-l', '--link', required=True, help='A link to a robof...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/RF100-Benchmark/configs/tood_r50_fpn_ms_8xb8_tweeter-profile.py
projects/RF100-Benchmark/configs/tood_r50_fpn_ms_8xb8_tweeter-profile.py
_base_ = '../../../configs/tood/tood_r50_fpn_1x_coco.py' custom_imports = dict( imports=['projects.RF100-Benchmark'], allow_failed_imports=False) data_root = 'rf100/tweeter-profile/' class_name = ('profile_info', ) num_classes = len(class_name) metainfo = dict(classes=class_name) image_scale = (640, 640) model =...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/RF100-Benchmark/configs/dino_r50_fpn_ms_8xb8_tweeter-profile.py
projects/RF100-Benchmark/configs/dino_r50_fpn_ms_8xb8_tweeter-profile.py
_base_ = '../../../configs/dino/dino-4scale_r50_8xb2-12e_coco.py' custom_imports = dict( imports=['projects.RF100-Benchmark'], allow_failed_imports=False) data_root = 'rf100/tweeter-profile/' class_name = ('profile_info', ) num_classes = len(class_name) metainfo = dict(classes=class_name) image_scale = (640, 640)...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/RF100-Benchmark/configs/faster-rcnn_r50_fpn_ms_8xb8_tweeter-profile.py
projects/RF100-Benchmark/configs/faster-rcnn_r50_fpn_ms_8xb8_tweeter-profile.py
_base_ = '../../../configs/faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py' custom_imports = dict( imports=['projects.RF100-Benchmark'], allow_failed_imports=False) data_root = 'rf100/tweeter-profile/' class_name = ('profile_info', ) num_classes = len(class_name) metainfo = dict(classes=class_name) image_scale = (640,...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/projects/example_project/dummy/__init__.py
projects/example_project/dummy/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .dummy_resnet import DummyResNet __all__ = ['DummyResNet']
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false