repo stringlengths 1 99 | file stringlengths 13 215 | code stringlengths 12 59.2M | file_length int64 12 59.2M | avg_line_length float64 3.82 1.48M | max_line_length int64 12 2.51M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/decode_heads/nl_head.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 2,056 | 32.177419 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/decode_heads/dnl_head.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 5,070 | 34.215278 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/decode_heads/decode_head.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 9,719 | 38.352227 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/decode_heads/lraspp_head.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 3,577 | 33.737864 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/decode_heads/uper_head.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 4,491 | 31.316547 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/decode_heads/aspp_head.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 3,938 | 31.825 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/decode_heads/psa_head.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 8,023 | 37.392344 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/decode_heads/gc_head.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 2,090 | 33.85 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/decode_heads/point_head.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 15,233 | 41.082873 | 126 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/utils/se_layer.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 2,630 | 36.585714 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/utils/weight_init.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 2,806 | 36.426667 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/utils/res_layer.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 3,814 | 34.654206 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/utils/self_attention_block.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 6,624 | 37.517442 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/utils/up_conv_block.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 4,467 | 38.192982 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/utils/inverted_residual.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 7,504 | 32.959276 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/utils/drop.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 1,494 | 32.977273 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/segmentors/base.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 10,877 | 37.034965 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/segmentors/cascade_encoder_decoder.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 4,187 | 36.72973 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/segmentors/encoder_decoder.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 11,823 | 37.019293 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/losses/dice_loss.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 4,718 | 34.75 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/losses/lovasz_loss.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 11,898 | 36.655063 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/losses/utils.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 4,197 | 30.328358 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/losses/accuracy.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 3,449 | 36.912088 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/losses/cross_entropy_loss.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 7,916 | 36.521327 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/backbones/hrnet.py | import torch.nn as nn
from annotator.uniformer.mmcv.cnn import (build_conv_layer, build_norm_layer, constant_init,
kaiming_init)
from annotator.uniformer.mmcv.runner import load_checkpoint
from annotator.uniformer.mmcv.utils.parrots_wrapper import _BatchNorm
from annotator.uniformer.mmseg.ops imp... | 21,226 | 37.178058 | 92 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/backbones/mobilenet_v2.py | import logging
import torch.nn as nn
from annotator.uniformer.mmcv.cnn import ConvModule, constant_init, kaiming_init
from annotator.uniformer.mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm import _BatchNorm
from ..builder import BACKBONES
from ..utils import InvertedResidual, make_divisible
@BA... | 6,981 | 37.574586 | 80 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/backbones/fast_scnn.py | import torch
import torch.nn as nn
from annotator.uniformer.mmcv.cnn import (ConvModule, DepthwiseSeparableConvModule, constant_init,
kaiming_init)
from torch.nn.modules.batchnorm import _BatchNorm
from annotator.uniformer.mmseg.models.decode_heads.psp_head import PPM
from annotator.uniformer.mms... | 14,436 | 37.396277 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/backbones/resnet.py | import torch.nn as nn
import torch.utils.checkpoint as cp
from annotator.uniformer.mmcv.cnn import (build_conv_layer, build_norm_layer, build_plugin_layer,
constant_init, kaiming_init)
from annotator.uniformer.mmcv.runner import load_checkpoint
from annotator.uniformer.mmcv.utils.parrots_wrapper i... | 24,310 | 34.28447 | 97 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/backbones/cgnet.py | import torch
import torch.nn as nn
import torch.utils.checkpoint as cp
from annotator.uniformer.mmcv.cnn import (ConvModule, build_conv_layer, build_norm_layer,
constant_init, kaiming_init)
from annotator.uniformer.mmcv.runner import load_checkpoint
from annotator.uniformer.mmcv.utils.parrots_wrap... | 13,183 | 34.826087 | 89 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/backbones/vit.py | """Modified from https://github.com/rwightman/pytorch-image-
models/blob/master/timm/models/vision_transformer.py."""
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as cp
from annotator.uniformer.mmcv.cnn import (Conv2d, Linear, build_activation_layer, bui... | 18,085 | 38.317391 | 128 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/backbones/resnext.py | import math
from annotator.uniformer.mmcv.cnn import build_conv_layer, build_norm_layer
from ..builder import BACKBONES
from ..utils import ResLayer
from .resnet import Bottleneck as _Bottleneck
from .resnet import ResNet
class Bottleneck(_Bottleneck):
"""Bottleneck block for ResNeXt.
If style is "pytorch"... | 5,161 | 34.356164 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/backbones/mobilenet_v3.py | import logging
import annotator.uniformer.mmcv as mmcv
import torch.nn as nn
from annotator.uniformer.mmcv.cnn import ConvModule, constant_init, kaiming_init
from annotator.uniformer.mmcv.cnn.bricks import Conv2dAdaptivePadding
from annotator.uniformer.mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm... | 10,390 | 39.589844 | 80 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/backbones/unet.py | import torch.nn as nn
import torch.utils.checkpoint as cp
from annotator.uniformer.mmcv.cnn import (UPSAMPLE_LAYERS, ConvModule, build_activation_layer,
build_norm_layer, constant_init, kaiming_init)
from annotator.uniformer.mmcv.runner import load_checkpoint
from annotator.uniformer.mmcv.utils.pa... | 18,269 | 41.488372 | 94 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/backbones/resnest.py | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as cp
from annotator.uniformer.mmcv.cnn import build_conv_layer, build_norm_layer
from ..builder import BACKBONES
from ..utils import ResLayer
from .resnet import Bottleneck as _Bottleneck
from .resnet import ... | 10,110 | 31.098413 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/models/backbones/uniformer.py | # --------------------------------------------------------
# UniFormer
# Copyright (c) 2022 SenseTime X-Lab
# Licensed under The MIT License [see LICENSE for details]
# Written by Kunchang Li
# --------------------------------------------------------
from collections import OrderedDict
import math
from functools impo... | 18,476 | 42.680851 | 145 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/datasets/custom.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 15,195 | 35.794189 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/datasets/dataset_wrappers.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 1,978 | 30.412698 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/datasets/builder.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 6,430 | 34.335165 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/datasets/pipelines/formating.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 9,755 | 31.41196 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/ops/wrappers.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 2,306 | 35.619048 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmseg/ops/encoding.py | '''
* Copyright (c) 2023 Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache License 2.0
* For full license text, see LICENSE.txt file in the repo root or http://www.apache.org/licenses/
* By Can Qin
* Modified from ControlNet repo: https://github.com/lllyasviel/ControlNet
* Copyright (c) 2... | 3,267 | 36.563218 | 98 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/ccnet_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,258 | 26.977778 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/ann_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,346 | 27.659574 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/gcnet_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,326 | 27.234043 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/encnet_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,435 | 28.306122 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/danet_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,261 | 27.044444 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/dnl_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,316 | 27.021277 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/pspnet_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,271 | 27.266667 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/upernet_r50.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 1, 1),
strides=... | 1,301 | 27.933333 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/apcnet_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,302 | 27.955556 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/psanet_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,406 | 27.14 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/deeplabv3plus_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,343 | 27.595745 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/emanet_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,329 | 26.708333 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/dmnet_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,302 | 27.955556 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/fpn_r50.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 1, 1),
strides=... | 1,056 | 27.567568 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/deeplabv3_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,273 | 27.311111 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/pointrend_r50.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='CascadeEncoderDecoder',
num_stages=2,
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1... | 1,704 | 28.912281 | 78 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/ocrnet_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='CascadeEncoderDecoder',
num_stages=2,
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1... | 1,385 | 27.875 | 78 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/nonlocal_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,315 | 27 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/configs/_base_/models/fcn_r50-d8.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 2, 4),
strides=... | 1,285 | 26.956522 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/image/misc.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import annotator.uniformer.mmcv as mmcv
try:
import torch
except ImportError:
torch = None
def tensor2imgs(tensor, mean=(0, 0, 0), std=(1, 1, 1), to_rgb=True):
"""Convert tensor to 3-channel images.
Args:
tensor (torch.Tenso... | 1,410 | 30.355556 | 77 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/resnet.py | # Copyright (c) OpenMMLab. All rights reserved.
import logging
import torch.nn as nn
import torch.utils.checkpoint as cp
from .utils import constant_init, kaiming_init
def conv3x3(in_planes, out_planes, stride=1, dilation=1):
"""3x3 convolution with padding."""
return nn.Conv2d(
in_planes,
o... | 9,955 | 30.40694 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/vgg.py | # Copyright (c) OpenMMLab. All rights reserved.
import logging
import torch.nn as nn
from .utils import constant_init, kaiming_init, normal_init
def conv3x3(in_planes, out_planes, dilation=1):
"""3x3 convolution with padding."""
return nn.Conv2d(
in_planes,
out_planes,
kernel_size=3,... | 6,053 | 33.397727 | 77 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/__init__.py | # Copyright (c) OpenMMLab. All rights reserved.
from .alexnet import AlexNet
# yapf: disable
from .bricks import (ACTIVATION_LAYERS, CONV_LAYERS, NORM_LAYERS,
PADDING_LAYERS, PLUGIN_LAYERS, UPSAMPLE_LAYERS,
ContextBlock, Conv2d, Conv3d, ConvAWS2d, ConvModule,
... | 2,438 | 57.071429 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/alexnet.py | # Copyright (c) OpenMMLab. All rights reserved.
import logging
import torch.nn as nn
class AlexNet(nn.Module):
"""AlexNet backbone.
Args:
num_classes (int): number of classes for classification.
"""
def __init__(self, num_classes=-1):
super(AlexNet, self).__init__()
self.num... | 1,990 | 31.112903 | 74 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/activation.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from annotator.uniformer.mmcv.utils import TORCH_VERSION, build_from_cfg, digit_version
from .registry import ACTIVATION_LAYERS
for module in [
nn.ReLU, nn.LeakyReLU, nn.PReLU, nn.RReLU, nn.ReLU6... | 2,508 | 25.978495 | 87 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/hsigmoid.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from .registry import ACTIVATION_LAYERS
@ACTIVATION_LAYERS.register_module()
class HSigmoid(nn.Module):
"""Hard Sigmoid Module. Apply the hard sigmoid function:
Hsigmoid(x) = min(max((x + bias) / divisor, min_value), max_value)
Default... | 1,097 | 30.371429 | 76 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/depthwise_separable_conv_module.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from .conv_module import ConvModule
class DepthwiseSeparableConvModule(nn.Module):
"""Depthwise separable convolution module.
See https://arxiv.org/pdf/1704.04861.pdf for details.
This module can replace a ConvModule with the conv bl... | 4,142 | 41.71134 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/non_local.py | # Copyright (c) OpenMMLab. All rights reserved.
from abc import ABCMeta
import torch
import torch.nn as nn
from ..utils import constant_init, normal_init
from .conv_module import ConvModule
from .registry import PLUGIN_LAYERS
class _NonLocalNd(nn.Module, metaclass=ABCMeta):
"""Basic Non-local module.
This ... | 11,012 | 34.872964 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/norm.py | # Copyright (c) OpenMMLab. All rights reserved.
import inspect
import torch.nn as nn
from annotator.uniformer.mmcv.utils import is_tuple_of
from annotator.uniformer.mmcv.utils.parrots_wrapper import SyncBatchNorm, _BatchNorm, _InstanceNorm
from .registry import NORM_LAYERS
NORM_LAYERS.register_module('BN', module=nn... | 5,154 | 34.551724 | 99 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/conv2d_adaptive_padding.py | # Copyright (c) OpenMMLab. All rights reserved.
import math
from torch import nn
from torch.nn import functional as F
from .registry import CONV_LAYERS
@CONV_LAYERS.register_module()
class Conv2dAdaptivePadding(nn.Conv2d):
"""Implementation of 2D convolution in tensorflow with `padding` as "same",
which app... | 2,514 | 38.920635 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/scale.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
class Scale(nn.Module):
"""A learnable scale parameter.
This layer scales the input by a learnable factor. It multiplies a
learnable scale parameter of shape (1,) with input of any shape.
Args:
scale (float): ... | 577 | 25.272727 | 73 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/conv_ws.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from .registry import CONV_LAYERS
def conv_ws_2d(input,
weight,
bias=None,
stride=1,
padding=0,
dilation=1,
grou... | 5,417 | 35.362416 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/conv_module.py | # Copyright (c) OpenMMLab. All rights reserved.
import warnings
import torch.nn as nn
from annotator.uniformer.mmcv.utils import _BatchNorm, _InstanceNorm
from ..utils import constant_init, kaiming_init
from .activation import build_activation_layer
from .conv import build_conv_layer
from .norm import build_norm_laye... | 8,760 | 41.323671 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/context_block.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from torch import nn
from ..utils import constant_init, kaiming_init
from .registry import PLUGIN_LAYERS
def last_zero_init(m):
if isinstance(m, nn.Sequential):
constant_init(m[-1], val=0)
else:
constant_init(m, val=0)
@PLUGIN_LAY... | 4,681 | 36.15873 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/hswish.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from .registry import ACTIVATION_LAYERS
@ACTIVATION_LAYERS.register_module()
class HSwish(nn.Module):
"""Hard Swish Module.
This module applies the hard swish function:
.. math::
Hswish(x) = x * ReLU6(x + 3) / 6
Args:
... | 651 | 20.733333 | 65 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/wrappers.py | # Copyright (c) OpenMMLab. All rights reserved.
r"""Modified from https://github.com/facebookresearch/detectron2/blob/master/detectron2/layers/wrappers.py # noqa: E501
Wrap some nn modules to support empty tensor input. Currently, these wrappers
are mainly used in mask heads like fcn_mask_head and maskiou_heads since... | 6,961 | 37.464088 | 120 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/transformer.py | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import warnings
import torch
import torch.nn as nn
from annotator.uniformer.mmcv import ConfigDict, deprecated_api_warning
from annotator.uniformer.mmcv.cnn import Linear, build_activation_layer, build_norm_layer
from annotator.uniformer.mmcv.runner.base_mod... | 24,637 | 40.338926 | 129 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/swish.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from .registry import ACTIVATION_LAYERS
@ACTIVATION_LAYERS.register_module()
class Swish(nn.Module):
"""Swish Module.
This module applies the swish function:
.. math::
Swish(x) = x * Sigmoid(x)
Returns:
... | 485 | 17.692308 | 47 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/conv.py | # Copyright (c) OpenMMLab. All rights reserved.
from torch import nn
from .registry import CONV_LAYERS
CONV_LAYERS.register_module('Conv1d', module=nn.Conv1d)
CONV_LAYERS.register_module('Conv2d', module=nn.Conv2d)
CONV_LAYERS.register_module('Conv3d', module=nn.Conv3d)
CONV_LAYERS.register_module('Conv', module=nn.C... | 1,446 | 31.155556 | 78 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/upsample.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
import torch.nn.functional as F
from ..utils import xavier_init
from .registry import UPSAMPLE_LAYERS
UPSAMPLE_LAYERS.register_module('nearest', module=nn.Upsample)
UPSAMPLE_LAYERS.register_module('bilinear', module=nn.Upsample)
@UPSAMPLE_LAYERS.... | 2,880 | 32.894118 | 76 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/generalized_attention.py | # Copyright (c) OpenMMLab. All rights reserved.
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..utils import kaiming_init
from .registry import PLUGIN_LAYERS
@PLUGIN_LAYERS.register_module()
class GeneralizedAttention(nn.Module):
"""GeneralizedAttention m... | 15,999 | 37.74092 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/padding.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from .registry import PADDING_LAYERS
PADDING_LAYERS.register_module('zero', module=nn.ZeroPad2d)
PADDING_LAYERS.register_module('reflect', module=nn.ReflectionPad2d)
PADDING_LAYERS.register_module('replicate', module=nn.ReplicationPad2d)
def buil... | 1,127 | 29.486486 | 75 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/bricks/drop.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from annotator.uniformer.mmcv import build_from_cfg
from .registry import DROPOUT_LAYERS
def drop_path(x, drop_prob=0., training=False):
"""Drop paths (Stochastic Depth) per sample (when applied in main path of
residual blocks... | 2,172 | 31.924242 | 140 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/utils/sync_bn.py | import torch
import annotator.uniformer.mmcv as mmcv
class _BatchNormXd(torch.nn.modules.batchnorm._BatchNorm):
"""A general BatchNorm layer without input dimension check.
Reproduced from @kapily's work:
(https://github.com/pytorch/pytorch/issues/41081#issuecomment-783961547)
The only difference bet... | 2,327 | 37.8 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/utils/weight_init.py | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import math
import warnings
import numpy as np
import torch
import torch.nn as nn
from torch import Tensor
from annotator.uniformer.mmcv.utils import Registry, build_from_cfg, get_logger, print_log
INITIALIZERS = Registry('initializer')
def update_init_in... | 26,006 | 36.966423 | 99 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/utils/fuse_conv_bn.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
def _fuse_conv_bn(conv, bn):
"""Fuse conv and bn into one module.
Args:
conv (nn.Module): Conv to be fused.
bn (nn.Module): BN to be fused.
Returns:
nn.Module: Fused module.
"""
conv_w = co... | 1,881 | 30.366667 | 77 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/utils/flops_counter.py | # Modified from flops-counter.pytorch by Vladislav Sovrasov
# original repo: https://github.com/sovrasov/flops-counter.pytorch
# MIT License
# Copyright (c) 2018 Vladislav Sovrasov
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... | 22,104 | 35.841667 | 128 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/cnn/utils/__init__.py | # Copyright (c) OpenMMLab. All rights reserved.
from .flops_counter import get_model_complexity_info
from .fuse_conv_bn import fuse_conv_bn
from .sync_bn import revert_sync_batchnorm
from .weight_init import (INITIALIZERS, Caffe2XavierInit, ConstantInit,
KaimingInit, NormalInit, PretrainedInit... | 1,023 | 50.2 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/parallel/data_parallel.py | # Copyright (c) OpenMMLab. All rights reserved.
from itertools import chain
from torch.nn.parallel import DataParallel
from .scatter_gather import scatter_kwargs
class MMDataParallel(DataParallel):
"""The DataParallel module that supports DataContainer.
MMDataParallel has two main differences with PyTorch ... | 3,912 | 42.477778 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/parallel/_functions.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from torch.nn.parallel._functions import _get_stream
def scatter(input, devices, streams=None):
"""Scatters tensor across multiple GPUs."""
if streams is None:
streams = [None] * len(devices)
if isinstance(input, list):
chunk_si... | 2,830 | 34.3875 | 76 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/parallel/registry.py | # Copyright (c) OpenMMLab. All rights reserved.
from torch.nn.parallel import DataParallel, DistributedDataParallel
from annotator.uniformer.mmcv.utils import Registry
MODULE_WRAPPERS = Registry('module wrapper')
MODULE_WRAPPERS.register_module(module=DataParallel)
MODULE_WRAPPERS.register_module(module=DistributedDa... | 332 | 36 | 67 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/parallel/data_container.py | # Copyright (c) OpenMMLab. All rights reserved.
import functools
import torch
def assert_tensor_type(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
if not isinstance(args[0].data, torch.Tensor):
raise AttributeError(
f'{args[0].__class__.__name__} has no attr... | 2,365 | 25.288889 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/parallel/distributed_deprecated.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.distributed as dist
import torch.nn as nn
from torch._utils import (_flatten_dense_tensors, _take_tensors,
_unflatten_dense_tensors)
from annotator.uniformer.mmcv.utils import TORCH_VERSION, digit_version
from .registry... | 2,837 | 38.971831 | 78 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/parallel/scatter_gather.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from torch.nn.parallel._functions import Scatter as OrigScatter
from ._functions import Scatter
from .data_container import DataContainer
def scatter(inputs, target_gpus, dim=0):
"""Scatter inputs to target gpus.
The only difference from original ... | 2,307 | 37.466667 | 78 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/parallel/distributed.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from torch.nn.parallel.distributed import (DistributedDataParallel,
_find_tensors)
from annotator.uniformer.mmcv import print_log
from annotator.uniformer.mmcv.utils import TORCH_VERSION, digit_version
from .scatter... | 4,857 | 41.99115 | 78 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/parallel/collate.py | # Copyright (c) OpenMMLab. All rights reserved.
from collections.abc import Mapping, Sequence
import torch
import torch.nn.functional as F
from torch.utils.data.dataloader import default_collate
from .data_container import DataContainer
def collate(batch, samples_per_gpu=1):
"""Puts each data field into a tenso... | 3,665 | 42.129412 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/engine/test.py | # Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp
import pickle
import shutil
import tempfile
import time
import torch
import torch.distributed as dist
import annotator.uniformer.mmcv as mmcv
from annotator.uniformer.mmcv.runner import get_dist_info
def single_gpu_test(model, data_loader):
"... | 7,196 | 34.453202 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/runner/checkpoint.py | # Copyright (c) OpenMMLab. All rights reserved.
import io
import os
import os.path as osp
import pkgutil
import re
import time
import warnings
from collections import OrderedDict
from importlib import import_module
from tempfile import TemporaryDirectory
import torch
import torchvision
from torch.optim import Optimize... | 25,136 | 34.504237 | 79 | py |
UniControl | UniControl-main/annotator/uniformer_base/mmcv/runner/dist_utils.py | # Copyright (c) OpenMMLab. All rights reserved.
import functools
import os
import subprocess
from collections import OrderedDict
import torch
import torch.multiprocessing as mp
from torch import distributed as dist
from torch._utils import (_flatten_dense_tensors, _take_tensors,
_unflatten_de... | 5,395 | 31.70303 | 78 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.