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/tests/test_models/test_layers/test_inverted_residual.py
tests/test_models/test_layers/test_inverted_residual.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmcv.cnn import is_norm from torch.nn.modules import GroupNorm from mmdet.models.layers import InvertedResidual, SELayer def test_inverted_residual(): with pytest.raises(AssertionError): # stride must be in [1, 2] In...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_layers/test_conv_upsample.py
tests/test_models/test_layers/test_conv_upsample.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmdet.models.layers import ConvUpsample @pytest.mark.parametrize('num_layers', [0, 1, 2]) def test_conv_upsample(num_layers): num_upsample = num_layers if num_layers > 0 else 0 num_layers = num_layers if num_layers > 0 else 1 ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_layers/test_se_layer.py
tests/test_models/test_layers/test_se_layer.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch import torch.nn.functional as F from mmengine.model import constant_init from mmdet.models.layers import DyReLU, SELayer def test_se_layer(): with pytest.raises(AssertionError): # act_cfg sequence length must equal to 2 SE...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_layers/test_ema.py
tests/test_models/test_layers/test_ema.py
# Copyright (c) OpenMMLab. All rights reserved. import itertools import math from unittest import TestCase import torch import torch.nn as nn from mmengine.testing import assert_allclose from mmdet.models.layers import ExpMomentumEMA class TestEMA(TestCase): def test_exp_momentum_ema(self): model = nn....
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_layers/test_position_encoding.py
tests/test_models/test_layers/test_position_encoding.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmdet.models.layers import (LearnedPositionalEncoding, SinePositionalEncoding) def test_sine_positional_encoding(num_feats=16, batch_size=2): # test invalid type of scale with pytest.raises(Assert...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_layers/__init__.py
tests/test_models/test_layers/__init__.py
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_layers/test_brick_wrappers.py
tests/test_models/test_layers/test_brick_wrappers.py
from unittest.mock import patch import torch import torch.nn as nn import torch.nn.functional as F from mmdet.models.layers import AdaptiveAvgPool2d, adaptive_avg_pool2d if torch.__version__ != 'parrots': torch_version = '1.7' else: torch_version = 'parrots' @patch('torch.__version__', torch_version) def t...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_losses/test_triplet_loss.py
tests/test_models/test_losses/test_triplet_loss.py
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import torch from mmdet.models import TripletLoss class TestTripletLoss(TestCase): def test_triplet_loss(self): feature = torch.Tensor([[1, 1], [1, 1], [0, 0], [0, 0]]) label = torch.Tensor([1, 1, 0, 0]) loss...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_losses/test_loss.py
tests/test_models/test_losses/test_loss.py
# Copyright (c) OpenMMLab. All rights reserved. import json import pytest import torch import torch.nn.functional as F from mmengine.utils import digit_version from mmdet.models.losses import (BalancedL1Loss, CrossEntropyLoss, DDQAuxLoss, DiceLoss, DistributionFocalLoss, EQLV2Loss, ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_losses/test_gaussian_focal_loss.py
tests/test_models/test_losses/test_gaussian_focal_loss.py
import unittest import torch from mmdet.models.losses import GaussianFocalLoss class TestGaussianFocalLoss(unittest.TestCase): def test_forward(self): pred = torch.rand((10, 4)) target = torch.rand((10, 4)) gaussian_focal_loss = GaussianFocalLoss() loss1 = gaussian_focal_loss(pr...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_losses/test_l2_loss.py
tests/test_models/test_losses/test_l2_loss.py
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import torch from mmdet.models import L2Loss class TestL2Loss(TestCase): def test_l2_loss(self): pred = torch.Tensor([[1, 1, 0, 0, 0, 0, 1]]) target = torch.Tensor([[1, 1, 0, 0, 0, 0, 0]]) loss = L2Loss( ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_losses/test_multi_pos_cross_entropy_loss.py
tests/test_models/test_losses/test_multi_pos_cross_entropy_loss.py
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import torch from mmdet.models.losses import MultiPosCrossEntropyLoss class TestMultiPosCrossEntropyLoss(TestCase): def test_mpce_loss(self): costs = torch.tensor([[1, 0], [0, 1]]) labels = torch.tensor([[1, 1], [0, 0...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_trackers/test_byte_tracker.py
tests/test_models/test_trackers/test_byte_tracker.py
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import torch from mmdet.registry import MODELS, TASK_UTILS from mmdet.testing import demo_track_inputs, random_boxes from mmdet.utils import register_all_modules class TestByteTracker(TestCase): @classmethod def setUpClass(cls): ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_trackers/test_oc_sort_tracker.py
tests/test_models/test_trackers/test_oc_sort_tracker.py
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import torch from mmdet.registry import MODELS, TASK_UTILS from mmdet.testing import demo_track_inputs from mmdet.utils import register_all_modules class TestByteTracker(TestCase): @classmethod def setUpClass(cls): regist...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_trackers/test_masktrack_rcnn_tracker.py
tests/test_models/test_trackers/test_masktrack_rcnn_tracker.py
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import torch from mmengine.registry import init_default_scope from parameterized import parameterized from mmdet.registry import MODELS from mmdet.testing import demo_track_inputs, get_detector_cfg, random_boxes class TestMaskTrackRCNNTra...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_trackers/test_strong_sort_tracker.py
tests/test_models/test_trackers/test_strong_sort_tracker.py
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase from unittest.mock import MagicMock import torch from mmengine.registry import init_default_scope from parameterized import parameterized from mmdet.registry import MODELS, TASK_UTILS from mmdet.testing import demo_track_inputs, get_detecto...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_trackers/test_sort_tracker.py
tests/test_models/test_trackers/test_sort_tracker.py
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase from unittest.mock import MagicMock import torch from parameterized import parameterized from mmdet.registry import MODELS, TASK_UTILS from mmdet.testing import demo_track_inputs, get_detector_cfg, random_boxes from mmdet.utils import regis...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_cascade_roi_head.py
tests/test_models/test_roi_heads/test_cascade_roi_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from mmdet.models.roi_heads import StandardRoIHead # noqa from mmdet.registry import MODELS from mmdet.testing import demo_mm_inputs, demo_mm_proposals, get_roi_head_cfg ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_point_rend_roi_head.py
tests/test_models/test_roi_heads/test_point_rend_roi_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from mmdet.models.roi_heads import PointRendRoIHead # noqa from mmdet.registry import MODELS from mmdet.testing import demo_mm_inputs, demo_mm_proposals, get_roi_head_cfg...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_pisa_roi_head.py
tests/test_models/test_roi_heads/test_pisa_roi_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from mmdet.registry import MODELS from mmdet.testing import demo_mm_inputs, demo_mm_proposals, get_roi_head_cfg from mmdet.utils import register_all_modules class TestPI...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_multi_instance_roi_head.py
tests/test_models/test_roi_heads/test_multi_instance_roi_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from mmengine.config import Config from mmdet.registry import MODELS from mmdet.testing import demo_mm_inputs, demo_mm_proposals from mmdet.utils import register_all_modules register_all_modules() def _fake_r...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_htc_roi_head.py
tests/test_models/test_roi_heads/test_htc_roi_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from mmdet.models.roi_heads import HybridTaskCascadeRoIHead # noqa from mmdet.registry import MODELS from mmdet.testing import demo_mm_inputs, demo_mm_proposals, get_roi_...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_sparse_roi_head.py
tests/test_models/test_roi_heads/test_sparse_roi_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch import torch.nn as nn from parameterized import parameterized from mmdet.models.roi_heads import StandardRoIHead # noqa from mmdet.registry import MODELS from mmdet.testing import demo_mm_inputs, demo_mm_propos...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_mask_scoring_roI_head.py
tests/test_models/test_roi_heads/test_mask_scoring_roI_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from mmdet.registry import MODELS from mmdet.testing import demo_mm_inputs, demo_mm_proposals, get_roi_head_cfg from mmdet.utils import register_all_modules class TestMaskScoringRoiHead(TestCase): def set...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_trident_roi_head.py
tests/test_models/test_roi_heads/test_trident_roi_head.py
# Copyright (c) OpenMMLab. All rights reserved. import copy import unittest from unittest import TestCase import torch from mmdet.registry import MODELS from mmdet.testing import demo_mm_inputs, demo_mm_proposals, get_roi_head_cfg from mmdet.utils import register_all_modules class TestTridentRoIHead(TestCase): ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_standard_roi_head.py
tests/test_models/test_roi_heads/test_standard_roi_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from mmengine.config import Config from parameterized import parameterized from mmdet.registry import MODELS from mmdet.testing import demo_mm_inputs, demo_mm_proposals from mmdet.utils import register_all_modul...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_scnet_roi_head.py
tests/test_models/test_roi_heads/test_scnet_roi_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from mmdet.models.roi_heads import SCNetRoIHead # noqa from mmdet.registry import MODELS from mmdet.testing import demo_mm_inputs, demo_mm_proposals, get_roi_head_cfg c...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_dynamic_roi_head.py
tests/test_models/test_roi_heads/test_dynamic_roi_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from mmdet.registry import MODELS from mmdet.testing import demo_mm_inputs, demo_mm_proposals, get_roi_head_cfg from mmdet.utils import register_all_modules class TestDy...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_grid_roi_head.py
tests/test_models/test_roi_heads/test_grid_roi_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from mmdet.registry import MODELS from mmdet.testing import demo_mm_inputs, demo_mm_proposals, get_roi_head_cfg from mmdet.utils import register_all_modules class TestGr...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_roi_extractors/test_single_level_roi_extractor.py
tests/test_models/test_roi_heads/test_roi_extractors/test_single_level_roi_extractor.py
import unittest import torch from mmdet.models.roi_heads.roi_extractors import SingleRoIExtractor class TestSingleRoIExtractor(unittest.TestCase): def test_forward(self): cfg = dict( roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=2), out_channels=16, f...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_roi_extractors/test_generic_roi_extractor.py
tests/test_models/test_roi_heads/test_roi_extractors/test_generic_roi_extractor.py
import unittest import torch from mmdet.models.roi_heads.roi_extractors import GenericRoIExtractor class TestGenericRoIExtractor(unittest.TestCase): def test_init(self): with self.assertRaises(AssertionError): GenericRoIExtractor( aggregation='other', roi_lay...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_mask_heads/test_grid_head.py
tests/test_models/test_roi_heads/test_mask_heads/test_grid_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from mmengine.config import ConfigDict from mmengine.structures import InstanceData from parameterized import parameterized from mmdet.models.roi_heads.mask_heads import GridHead from mmdet.models.utils import u...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_mask_heads/test_maskiou_head.py
tests/test_models/test_roi_heads/test_mask_heads/test_maskiou_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from mmengine.config import ConfigDict from mmengine.structures import InstanceData from parameterized import parameterized from mmdet.models.roi_heads.mask_heads import MaskIoUHead from mmdet.models.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/tests/test_models/test_roi_heads/test_mask_heads/test_fcn_mask_head.py
tests/test_models/test_roi_heads/test_mask_heads/test_fcn_mask_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from mmengine.config import ConfigDict from mmengine.structures import InstanceData from parameterized import parameterized from mmdet.models.roi_heads.mask_heads import FCNMaskHead class TestFCNMaskHead(TestC...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_mask_heads/test_scnet_semantic_head.py
tests/test_models/test_roi_heads/test_mask_heads/test_scnet_semantic_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from torch import Tensor from mmdet.models.roi_heads.mask_heads import SCNetSemanticHead class TestSCNetSemanticHead(TestCase): @parameterized.expand(['cpu', 'cuda'...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_mask_heads/test_fused_semantic_head.py
tests/test_models/test_roi_heads/test_mask_heads/test_fused_semantic_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from torch import Tensor from mmdet.models.roi_heads.mask_heads import FusedSemanticHead class TestFusedSemanticHead(TestCase): @parameterized.expand(['cpu', 'cuda'...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_mask_heads/test_global_context_head.py
tests/test_models/test_roi_heads/test_mask_heads/test_global_context_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from torch import Tensor from mmdet.models.roi_heads.mask_heads import GlobalContextHead class TestGlobalContextHead(TestCase): @parameterized.expand(['cpu', 'cuda'...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_mask_heads/test_feature_relay_head.py
tests/test_models/test_roi_heads/test_mask_heads/test_feature_relay_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from torch import Tensor from mmdet.models.roi_heads.mask_heads import FeatureRelayHead class TestFeatureRelayHead(TestCase): @parameterized.expand(['cpu', 'cuda'])...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_mask_heads/test_scnet_mask_head.py
tests/test_models/test_roi_heads/test_mask_heads/test_scnet_mask_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from torch import Tensor from mmdet.models.roi_heads.mask_heads import SCNetMaskHead class TestSCNetMaskHead(TestCase): @parameterized.expand(['cpu', 'cuda']) d...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_mask_heads/test_coarse_mask_head.py
tests/test_models/test_roi_heads/test_mask_heads/test_coarse_mask_head.py
import unittest import torch from parameterized import parameterized from mmdet.models.roi_heads.mask_heads import CoarseMaskHead class TestCoarseMaskHead(unittest.TestCase): def test_init(self): with self.assertRaises(AssertionError): CoarseMaskHead(num_fcs=0) with self.assertRais...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_mask_heads/test_htc_mask_head.py
tests/test_models/test_roi_heads/test_mask_heads/test_htc_mask_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from torch import Tensor from mmdet.models.roi_heads.mask_heads import HTCMaskHead class TestHTCMaskHead(TestCase): @parameterized.expand(['cpu', 'cuda']) def t...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_bbox_heads/test_multi_instance_bbox_head.py
tests/test_models/test_roi_heads/test_bbox_heads/test_multi_instance_bbox_head.py
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import torch from mmengine.config import ConfigDict from mmengine.structures import InstanceData from mmdet.models.roi_heads.bbox_heads import MultiInstanceBBoxHead class TestMultiInstanceBBoxHead(TestCase): def test_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/tests/test_models/test_roi_heads/test_bbox_heads/test_scnet_bbox_head.py
tests/test_models/test_roi_heads/test_bbox_heads/test_scnet_bbox_head.py
import unittest import torch from mmdet.models.roi_heads.bbox_heads import SCNetBBoxHead class TestSCNetBBoxHead(unittest.TestCase): def test_forward(self): x = torch.rand((2, 1, 16, 16)) bbox_head = SCNetBBoxHead( num_shared_fcs=2, in_channels=1, roi_feat_si...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_bbox_heads/test_sabl_bbox_head.py
tests/test_models/test_roi_heads/test_bbox_heads/test_sabl_bbox_head.py
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import torch from mmengine.config import ConfigDict from mmengine.structures import InstanceData from mmdet.models.roi_heads.bbox_heads import SABLHead from mmdet.models.task_modules.samplers import SamplingResult class TestSABLBboxHead(T...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_bbox_heads/test_double_bbox_head.py
tests/test_models/test_roi_heads/test_bbox_heads/test_double_bbox_head.py
# Copyright (c) OpenMMLab. All rights reserved. import unittest from unittest import TestCase import torch from parameterized import parameterized from mmdet.models.roi_heads.bbox_heads import DoubleConvFCBBoxHead class TestDoubleBboxHead(TestCase): @parameterized.expand(['cpu', 'cuda']) def test_forward_l...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_roi_heads/test_bbox_heads/test_bbox_head.py
tests/test_models/test_roi_heads/test_bbox_heads/test_bbox_head.py
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import torch from mmengine.config import ConfigDict from mmengine.structures import InstanceData from mmdet.models.roi_heads.bbox_heads import (BBoxHead, Shared2FCBBoxHead, Shared4Conv1FCBBoxHe...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_vis/test_masktrack_rcnn.py
tests/test_models/test_vis/test_masktrack_rcnn.py
# Copyright (c) OpenMMLab. All rights reserved. import time import unittest from unittest import TestCase import torch from mmengine.logging import MessageHub from mmengine.registry import init_default_scope from parameterized import parameterized from mmdet.registry import MODELS from mmdet.testing import demo_track...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_vis/test_mask2former.py
tests/test_models/test_vis/test_mask2former.py
# Copyright (c) OpenMMLab. All rights reserved. import time import unittest from unittest import TestCase import torch from mmengine.logging import MessageHub from mmengine.registry import init_default_scope from parameterized import parameterized from mmdet.registry import MODELS from mmdet.testing import demo_track...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_tta/test_det_tta.py
tests/test_models/test_tta/test_det_tta.py
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import torch from mmengine import ConfigDict from mmdet.models import DetTTAModel from mmdet.registry import MODELS from mmdet.structures import DetDataSample from mmdet.testing import get_detector_cfg from mmdet.utils import register_all_m...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_mot/test_byte_track.py
tests/test_models/test_mot/test_byte_track.py
# Copyright (c) OpenMMLab. All rights reserved. import time import unittest from unittest import TestCase import torch from mmengine.logging import MessageHub from mmengine.registry import init_default_scope from parameterized import parameterized from mmdet.registry import MODELS from mmdet.testing import demo_mm_in...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_mot/test_sort.py
tests/test_models/test_mot/test_sort.py
# Copyright (c) OpenMMLab. All rights reserved. import time import unittest from unittest import TestCase import torch from mmengine.logging import MessageHub from mmengine.registry import init_default_scope from parameterized import parameterized from mmdet.registry import MODELS from mmdet.testing import demo_track...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_mot/test_oc_sort.py
tests/test_models/test_mot/test_oc_sort.py
# Copyright (c) OpenMMLab. All rights reserved. import time import unittest from unittest import TestCase import torch from mmengine.logging import MessageHub from mmengine.registry import init_default_scope from parameterized import parameterized from mmdet.registry import MODELS from mmdet.testing import demo_mm_in...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_mot/test_strong_sort.py
tests/test_models/test_mot/test_strong_sort.py
# Copyright (c) OpenMMLab. All rights reserved. import time import unittest from unittest import TestCase import torch from mmengine.logging import MessageHub from mmengine.registry import init_default_scope from parameterized import parameterized from mmdet.registry import MODELS from mmdet.testing import demo_track...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_mot/test_qdtrack.py
tests/test_models/test_mot/test_qdtrack.py
# Copyright (c) OpenMMLab. All rights reserved. import time import unittest from unittest import TestCase import torch from mmengine.logging import MessageHub from mmengine.registry import init_default_scope from parameterized import parameterized from mmdet.registry import MODELS from mmdet.testing import demo_track...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_mot/test_deep_sort.py
tests/test_models/test_mot/test_deep_sort.py
# Copyright (c) OpenMMLab. All rights reserved. import time import unittest from unittest import TestCase import torch from mmengine.logging import MessageHub from mmengine.registry import init_default_scope from parameterized import parameterized from mmdet.registry import MODELS from mmdet.testing import demo_track...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_trident_resnet.py
tests/test_models/test_backbones/test_trident_resnet.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmdet.models.backbones import TridentResNet from mmdet.models.backbones.trident_resnet import TridentBottleneck def test_trident_resnet_bottleneck(): trident_dilations = (1, 2, 3) test_branch_idx = 1 concat_output = True ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_renext.py
tests/test_models/test_backbones/test_renext.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmdet.models.backbones import ResNeXt from mmdet.models.backbones.resnext import Bottleneck as BottleneckX from .utils import is_block def test_renext_bottleneck(): with pytest.raises(AssertionError): # Style must be in ['pyt...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_regnet.py
tests/test_models/test_backbones/test_regnet.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmdet.models.backbones import RegNet regnet_test_data = [ ('regnetx_400mf', dict(w0=24, wa=24.48, wm=2.54, group_w=16, depth=22, bot_mul=1.0), [32, 64, 160, 384]), ('regnetx_800mf', dict(w0=56, wa=35.73, wm=2.2...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_res2net.py
tests/test_models/test_backbones/test_res2net.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmdet.models.backbones import Res2Net from mmdet.models.backbones.res2net import Bottle2neck from .utils import is_block def test_res2net_bottle2neck(): with pytest.raises(AssertionError): # Style must be in ['pytorch', 'caff...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_hrnet.py
tests/test_models/test_backbones/test_hrnet.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmdet.models.backbones.hrnet import HRModule, HRNet from mmdet.models.backbones.resnet import BasicBlock, Bottleneck @pytest.mark.parametrize('block', [BasicBlock, Bottleneck]) def test_hrmodule(block): # Test multiscale forward ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_resnest.py
tests/test_models/test_backbones/test_resnest.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmdet.models.backbones import ResNeSt from mmdet.models.backbones.resnest import Bottleneck as BottleneckS def test_resnest_bottleneck(): with pytest.raises(AssertionError): # Style must be in ['pytorch', 'caffe'] Bot...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_pvt.py
tests/test_models/test_backbones/test_pvt.py
import pytest import torch from mmdet.models.backbones.pvt import (PVTEncoderLayer, PyramidVisionTransformer, PyramidVisionTransformerV2) def test_pvt_block(): # test PVT structure and forward block = PVTEncoderLayer( emb...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_csp_darknet.py
tests/test_models/test_backbones/test_csp_darknet.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from torch.nn.modules.batchnorm import _BatchNorm from mmdet.models.backbones.csp_darknet import CSPDarknet from .utils import check_norm_state, is_norm def test_csp_darknet_backbone(): with pytest.raises(ValueError): # frozen_sta...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/utils.py
tests/test_models/test_backbones/utils.py
# Copyright (c) OpenMMLab. All rights reserved. from torch.nn.modules import GroupNorm from torch.nn.modules.batchnorm import _BatchNorm from mmdet.models.backbones.res2net import Bottle2neck from mmdet.models.backbones.resnet import BasicBlock, Bottleneck from mmdet.models.backbones.resnext import Bottleneck as Bottl...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_swin.py
tests/test_models/test_backbones/test_swin.py
import pytest import torch from mmdet.models.backbones.swin import SwinBlock, SwinTransformer def test_swin_block(): # test SwinBlock structure and forward block = SwinBlock(embed_dims=64, num_heads=4, feedforward_channels=256) assert block.ffn.embed_dims == 64 assert block.attn.w_msa.num_heads == 4 ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_mobilenet_v2.py
tests/test_models/test_backbones/test_mobilenet_v2.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from torch.nn.modules import GroupNorm from torch.nn.modules.batchnorm import _BatchNorm from mmdet.models.backbones.mobilenet_v2 import MobileNetV2 from .utils import check_norm_state, is_block, is_norm def test_mobilenetv2_backbone(): w...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_hourglass.py
tests/test_models/test_backbones/test_hourglass.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmdet.models.backbones.hourglass import HourglassNet def test_hourglass_backbone(): with pytest.raises(AssertionError): # HourglassNet's num_stacks should larger than 0 HourglassNet(num_stacks=0) with pytest.rais...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/__init__.py
tests/test_models/test_backbones/__init__.py
# Copyright (c) OpenMMLab. All rights reserved. from .utils import check_norm_state, is_block, is_norm __all__ = ['is_block', 'is_norm', 'check_norm_state']
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_detectors_resnet.py
tests/test_models/test_backbones/test_detectors_resnet.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest from mmdet.models.backbones import DetectoRS_ResNet def test_detectorrs_resnet_backbone(): detectorrs_cfg = dict( depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requi...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_resnet.py
tests/test_models/test_backbones/test_resnet.py
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmcv.ops import DeformConv2dPack from torch.nn.modules import AvgPool2d, GroupNorm from torch.nn.modules.batchnorm import _BatchNorm from mmdet.models.backbones import ResNet, ResNetV1d from mmdet.models.backbones.resnet import BasicBlock,...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_backbones/test_efficientnet.py
tests/test_models/test_backbones/test_efficientnet.py
import pytest import torch from mmdet.models.backbones import EfficientNet def test_efficientnet_backbone(): """Test EfficientNet backbone.""" with pytest.raises(AssertionError): # EfficientNet arch should be a key in EfficientNet.arch_settings EfficientNet(arch='c3') model = EfficientNe...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_utils/test_model_misc.py
tests/test_models/test_utils/test_model_misc.py
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch from torch.autograd import gradcheck from mmdet.models.utils import interpolate_as, sigmoid_geometric_mean def test_interpolate_as(): source = torch.rand((1, 5, 4, 4)) target = torch.rand((1, 1, 16, 16)) # Test 4D source and...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_models/test_utils/test_misc.py
tests/test_models/test_utils/test_misc.py
import copy import pytest import torch from mmengine.structures import InstanceData from mmdet.models.utils import (empty_instances, filter_gt_instances, rename_loss_dict, reweight_loss_dict, unpack_gt_instances) from mmdet.testing import demo_mm_inputs ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/data/configs_mmtrack/selsa_faster_rcnn_r101_dc5_1x.py
tests/data/configs_mmtrack/selsa_faster_rcnn_r101_dc5_1x.py
_base_ = [ './faster_rcnn_r50_dc5.py', './mot_challenge.py', '../../../configs/_base_/default_runtime.py' ] model = dict( type='SELSA', pretrains=None, detector=dict( backbone=dict(depth=18, base_channels=2), roi_head=dict( type='SelsaRoIHead', bbox_head=dict(...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/data/configs_mmtrack/mot_challenge.py
tests/data/configs_mmtrack/mot_challenge.py
# dataset settings dataset_type = 'MOTChallengeDataset' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadMultiImagesFromFile', to_float32=True), dict(type='SeqLoadAnnotations', with_bbox=True, with_track=True), dict( ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/data/configs_mmtrack/faster_rcnn_r50_dc5.py
tests/data/configs_mmtrack/faster_rcnn_r50_dc5.py
model = dict( detector=dict( type='FasterRCNN', backbone=dict( type='ResNet', depth=18, base_channels=2, num_stages=4, out_indices=(3, ), strides=(1, 2, 2, 1), dilations=(1, 1, 1, 2), frozen_stages=1, ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/data/configs_mmtrack/faster_rcnn_r50_fpn.py
tests/data/configs_mmtrack/faster_rcnn_r50_fpn.py
model = dict( detector=dict( type='FasterRCNN', backbone=dict( type='ResNet', depth=18, base_channels=2, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/data/configs_mmtrack/tracktor_faster-rcnn_r50_fpn_4e.py
tests/data/configs_mmtrack/tracktor_faster-rcnn_r50_fpn_4e.py
_base_ = [ './faster-rcnn_r50_fpn.py', './mot_challenge.py', '../../../configs/_base_/default_runtime.py' ] model = dict( type='Tracktor', pretrains=dict( detector= # noqa: E251 'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-half-64ee2ed4.pth', ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/data/dsdl_det/config.py
tests/data/dsdl_det/config.py
local = dict( type='LocalFileReader', working_dir='local path', )
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_apis/test_det_inferencer.py
tests/test_apis/test_det_inferencer.py
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp import tempfile from unittest import TestCase, mock from unittest.mock import Mock, patch import mmcv import mmengine import numpy as np import torch from mmengine.structures import InstanceData from mmengine.utils import is_list_of from parameteriz...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_apis/test_inference.py
tests/test_apis/test_inference.py
import os from pathlib import Path import numpy as np import pytest import torch from mmdet.apis import inference_detector, init_detector from mmdet.structures import DetDataSample from mmdet.utils import register_all_modules # TODO: Waiting to fix multiple call error bug register_all_modules() @pytest.mark.parame...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_utils/test_setup_env.py
tests/test_utils/test_setup_env.py
import datetime import sys from unittest import TestCase from mmengine import DefaultScope from mmdet.utils import register_all_modules class TestSetupEnv(TestCase): def test_register_all_modules(self): from mmdet.registry import DATASETS # not init default scope sys.modules.pop('mmdet...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_utils/test_memory.py
tests/test_utils/test_memory.py
import numpy as np import pytest import torch from mmdet.utils import AvoidOOM from mmdet.utils.memory import cast_tensor_type def test_avoidoom(): tensor = torch.from_numpy(np.random.random((20, 20))) if torch.cuda.is_available(): tensor = tensor.cuda() # get default result default_r...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_utils/test_replace_cfg_vals.py
tests/test_utils/test_replace_cfg_vals.py
import os.path as osp import tempfile from copy import deepcopy import pytest from mmengine.config import Config from mmdet.utils import replace_cfg_vals def test_replace_cfg_vals(): temp_file = tempfile.NamedTemporaryFile() cfg_path = f'{temp_file.name}.py' with open(cfg_path, 'w') as f: f.writ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/tests/test_utils/test_benchmark.py
tests/test_utils/test_benchmark.py
import copy import os import tempfile import unittest import torch from mmengine import Config, MMLogger from mmengine.dataset import Compose from mmengine.model import BaseModel from torch.utils.data import Dataset from mmdet.registry import DATASETS, MODELS from mmdet.utils import register_all_modules from mmdet.ut...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/docs/zh_cn/stat.py
docs/zh_cn/stat.py
#!/usr/bin/env python import functools as func import glob import os.path as osp import re import numpy as np url_prefix = 'https://github.com/open-mmlab/mmdetection/blob/main/' files = sorted(glob.glob('../configs/*/README.md')) stats = [] titles = [] num_ckpts = 0 for f in files: url = osp.dirname(f.replace(...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/docs/zh_cn/conf.py
docs/zh_cn/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/docs/en/stat.py
docs/en/stat.py
#!/usr/bin/env python import functools as func import glob import os.path as osp import re import numpy as np url_prefix = 'https://github.com/open-mmlab/mmdetection/blob/main/configs' files = sorted(glob.glob('../../configs/*/README.md')) stats = [] titles = [] num_ckpts = 0 for f in files: url = osp.dirname(...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/docs/en/conf.py
docs/en/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/main/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If exte...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/configs/soft_teacher/soft-teacher_faster-rcnn_r50-caffe_fpn_180k_semi-0.1-coco.py
configs/soft_teacher/soft-teacher_faster-rcnn_r50-caffe_fpn_180k_semi-0.1-coco.py
_base_ = [ '../_base_/models/faster-rcnn_r50_fpn.py', '../_base_/default_runtime.py', '../_base_/datasets/semi_coco_detection.py' ] detector = _base_.model detector.data_preprocessor = dict( type='DetDataPreprocessor', mean=[103.530, 116.280, 123.675], std=[1.0, 1.0, 1.0], bgr_to_rgb=False, ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/configs/soft_teacher/soft-teacher_faster-rcnn_r50-caffe_fpn_180k_semi-0.05-coco.py
configs/soft_teacher/soft-teacher_faster-rcnn_r50-caffe_fpn_180k_semi-0.05-coco.py
_base_ = ['soft-teacher_faster-rcnn_r50-caffe_fpn_180k_semi-0.1-coco.py'] # 5% coco train2017 is set as labeled dataset labeled_dataset = _base_.labeled_dataset unlabeled_dataset = _base_.unlabeled_dataset labeled_dataset.ann_file = 'semi_anns/instances_train2017.1@5.json' unlabeled_dataset.ann_file = 'semi_anns/insta...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/configs/soft_teacher/soft-teacher_faster-rcnn_r50-caffe_fpn_180k_semi-0.02-coco.py
configs/soft_teacher/soft-teacher_faster-rcnn_r50-caffe_fpn_180k_semi-0.02-coco.py
_base_ = ['soft-teacher_faster-rcnn_r50-caffe_fpn_180k_semi-0.1-coco.py'] # 2% coco train2017 is set as labeled dataset labeled_dataset = _base_.labeled_dataset unlabeled_dataset = _base_.unlabeled_dataset labeled_dataset.ann_file = 'semi_anns/instances_train2017.1@2.json' unlabeled_dataset.ann_file = 'semi_anns/insta...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/configs/soft_teacher/soft-teacher_faster-rcnn_r50-caffe_fpn_180k_semi-0.01-coco.py
configs/soft_teacher/soft-teacher_faster-rcnn_r50-caffe_fpn_180k_semi-0.01-coco.py
_base_ = ['soft-teacher_faster-rcnn_r50-caffe_fpn_180k_semi-0.1-coco.py'] # 1% coco train2017 is set as labeled dataset labeled_dataset = _base_.labeled_dataset unlabeled_dataset = _base_.unlabeled_dataset labeled_dataset.ann_file = 'semi_anns/instances_train2017.1@1.json' unlabeled_dataset.ann_file = 'semi_anns/insta...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/configs/simple_copy_paste/mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_32xb2-ssj-scp-90k_coco.py
configs/simple_copy_paste/mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_32xb2-ssj-scp-90k_coco.py
_base_ = 'mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_32xb2-ssj-scp-270k_coco.py' # noqa # training schedule for 90k max_iters = 90000 # learning rate policy # lr steps at [0.9, 0.95, 0.975] of the maximum iterations param_scheduler = [ dict( type='LinearLR', start_factor=0.067, by_epoch=False, begin...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/configs/simple_copy_paste/mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_32xb2-ssj-270k_coco.py
configs/simple_copy_paste/mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_32xb2-ssj-270k_coco.py
_base_ = [ '../_base_/models/mask-rcnn_r50_fpn.py', # 270k iterations with batch_size 64 is roughly equivalent to 144 epochs '../common/ssj_270k_coco-instance.py', ] image_size = (1024, 1024) batch_augments = [ dict(type='BatchFixedSizePad', size=image_size, pad_mask=True) ] norm_cfg = dict(type='SyncB...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/configs/simple_copy_paste/mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_32xb2-ssj-scp-270k_coco.py
configs/simple_copy_paste/mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_32xb2-ssj-scp-270k_coco.py
_base_ = [ '../_base_/models/mask-rcnn_r50_fpn.py', # 270k iterations with batch_size 64 is roughly equivalent to 144 epochs '../common/ssj_scp_270k_coco-instance.py' ] image_size = (1024, 1024) batch_augments = [ dict(type='BatchFixedSizePad', size=image_size, pad_mask=True) ] norm_cfg = dict(type='Sy...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/configs/simple_copy_paste/mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_32xb2-ssj-90k_coco.py
configs/simple_copy_paste/mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_32xb2-ssj-90k_coco.py
_base_ = 'mask-rcnn_r50_fpn_rpn-2conv_4conv1fc_syncbn-all_32xb2-ssj-270k_coco.py' # noqa # training schedule for 90k max_iters = 90000 # learning rate policy # lr steps at [0.9, 0.95, 0.975] of the maximum iterations param_scheduler = [ dict( type='LinearLR', start_factor=0.067, by_epoch=False, begin=0, ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/configs/_base_/default_runtime.py
configs/_base_/default_runtime.py
default_scope = 'mmdet' default_hooks = dict( timer=dict(type='IterTimerHook'), logger=dict(type='LoggerHook', interval=50), param_scheduler=dict(type='ParamSchedulerHook'), checkpoint=dict(type='CheckpointHook', interval=1), sampler_seed=dict(type='DistSamplerSeedHook'), visualization=dict(typ...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/configs/_base_/schedules/schedule_2x.py
configs/_base_/schedules/schedule_2x.py
# training schedule for 2x train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=24, val_interval=1) val_cfg = dict(type='ValLoop') test_cfg = dict(type='TestLoop') # learning rate param_scheduler = [ dict( type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), dict( type='Mu...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false
open-mmlab/mmdetection
https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/configs/_base_/schedules/schedule_20e.py
configs/_base_/schedules/schedule_20e.py
# training schedule for 20e train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=20, val_interval=1) val_cfg = dict(type='ValLoop') test_cfg = dict(type='TestLoop') # learning rate param_scheduler = [ dict( type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500), dict( type='M...
python
Apache-2.0
cfd5d3a985b0249de009b67d04f37263e11cdf3d
2026-01-04T14:42:57.197037Z
false