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 |
|---|---|---|---|---|---|---|---|---|
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/fused_bias_leakyrelu.py | annotator/uniformer/mmcv/ops/fused_bias_leakyrelu.py | # modified from https://github.com/rosinality/stylegan2-pytorch/blob/master/op/fused_act.py # noqa:E501
# Copyright (c) 2021, NVIDIA Corporation. All rights reserved.
# NVIDIA Source Code License for StyleGAN2 with Adaptive Discriminator
# Augmentation (ADA)
# ==========================================================... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/correlation.py | annotator/uniformer/mmcv/ops/correlation.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from torch import Tensor, nn
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.modules.utils import _pair
from ..utils import ext_loader
ext_module = ext_loader.load_ext(
'_ext', ['correlation_forw... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/iou3d.py | annotator/uniformer/mmcv/ops/iou3d.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from ..utils import ext_loader
ext_module = ext_loader.load_ext('_ext', [
'iou3d_boxes_iou_bev_forward', 'iou3d_nms_forward',
'iou3d_nms_normal_forward'
])
def boxes_iou_bev(boxes_a, boxes_b):
"""Calculate boxes IoU in the Bird's Eye View.
... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/border_align.py | annotator/uniformer/mmcv/ops/border_align.py | # Copyright (c) OpenMMLab. All rights reserved.
# modified from
# https://github.com/Megvii-BaseDetection/cvpods/blob/master/cvpods/layers/border_align.py
import torch
import torch.nn as nn
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from ..utils import ext_loader
ext_... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/point_sample.py | annotator/uniformer/mmcv/ops/point_sample.py | # Modified from https://github.com/facebookresearch/detectron2/tree/master/projects/PointRend # noqa
from os import path as osp
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair
from torch.onnx.operators import shape_as_tensor
def bilinear_grid_sample(im, g... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/deform_conv.py | annotator/uniformer/mmcv/ops/deform_conv.py | # Copyright (c) OpenMMLab. All rights reserved.
from typing import Tuple, Union
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.modules.utils import _pair, _single
from... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/three_nn.py | annotator/uniformer/mmcv/ops/three_nn.py | from typing import Tuple
import torch
from torch.autograd import Function
from ..utils import ext_loader
ext_module = ext_loader.load_ext('_ext', ['three_nn_forward'])
class ThreeNN(Function):
"""Find the top-3 nearest neighbors of the target set from the source set.
Please refer to `Paper of PointNet++ <... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/__init__.py | annotator/uniformer/mmcv/ops/__init__.py | # Copyright (c) OpenMMLab. All rights reserved.
from .assign_score_withk import assign_score_withk
from .ball_query import ball_query
from .bbox import bbox_overlaps
from .border_align import BorderAlign, border_align
from .box_iou_rotated import box_iou_rotated
from .carafe import CARAFE, CARAFENaive, CARAFEPack, cara... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/gather_points.py | annotator/uniformer/mmcv/ops/gather_points.py | import torch
from torch.autograd import Function
from ..utils import ext_loader
ext_module = ext_loader.load_ext(
'_ext', ['gather_points_forward', 'gather_points_backward'])
class GatherPoints(Function):
"""Gather points with given index."""
@staticmethod
def forward(ctx, features: torch.Tensor,
... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/upfirdn2d.py | annotator/uniformer/mmcv/ops/upfirdn2d.py | # modified from https://github.com/rosinality/stylegan2-pytorch/blob/master/op/upfirdn2d.py # noqa:E501
# Copyright (c) 2021, NVIDIA Corporation. All rights reserved.
# NVIDIA Source Code License for StyleGAN2 with Adaptive Discriminator
# Augmentation (ADA)
# =========================================================... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/pixel_group.py | annotator/uniformer/mmcv/ops/pixel_group.py | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
from ..utils import ext_loader
ext_module = ext_loader.load_ext('_ext', ['pixel_group'])
def pixel_group(score, mask, embedding, kernel_label, kernel_contour,
kernel_region_num, distance_threshold):
"""Group pixels i... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/scatter_points.py | annotator/uniformer/mmcv/ops/scatter_points.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from torch import nn
from torch.autograd import Function
from ..utils import ext_loader
ext_module = ext_loader.load_ext(
'_ext',
['dynamic_point_to_voxel_forward', 'dynamic_point_to_voxel_backward'])
class _DynamicScatter(Function):
@staticm... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/info.py | annotator/uniformer/mmcv/ops/info.py | # Copyright (c) OpenMMLab. All rights reserved.
import glob
import os
import torch
if torch.__version__ == 'parrots':
import parrots
def get_compiler_version():
return 'GCC ' + parrots.version.compiler
def get_compiling_cuda_version():
return parrots.version.cuda
else:
from ..utils i... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/corner_pool.py | annotator/uniformer/mmcv/ops/corner_pool.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
from torch import nn
from torch.autograd import Function
from ..utils import ext_loader
ext_module = ext_loader.load_ext('_ext', [
'top_pool_forward', 'top_pool_backward', 'bottom_pool_forward',
'bottom_pool_backward', 'left_pool_forward', 'left_poo... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/three_interpolate.py | annotator/uniformer/mmcv/ops/three_interpolate.py | from typing import Tuple
import torch
from torch.autograd import Function
from ..utils import ext_loader
ext_module = ext_loader.load_ext(
'_ext', ['three_interpolate_forward', 'three_interpolate_backward'])
class ThreeInterpolate(Function):
"""Performs weighted linear interpolation on 3 features.
Ple... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/group_points.py | annotator/uniformer/mmcv/ops/group_points.py | # Copyright (c) OpenMMLab. All rights reserved.
from typing import Tuple
import torch
from torch import nn as nn
from torch.autograd import Function
from ..utils import ext_loader
from .ball_query import ball_query
from .knn import knn
ext_module = ext_loader.load_ext(
'_ext', ['group_points_forward', 'group_poi... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/box_iou_rotated.py | annotator/uniformer/mmcv/ops/box_iou_rotated.py | # Copyright (c) OpenMMLab. All rights reserved.
from ..utils import ext_loader
ext_module = ext_loader.load_ext('_ext', ['box_iou_rotated'])
def box_iou_rotated(bboxes1, bboxes2, mode='iou', aligned=False):
"""Return intersection-over-union (Jaccard index) of boxes.
Both sets of boxes are expected to be in
... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/roi_pool.py | annotator/uniformer/mmcv/ops/roi_pool.py | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.modules.utils import _pair
from ..utils import ext_loader
ext_module = ext_loader.load_ext('_ext',
... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/bbox.py | annotator/uniformer/mmcv/ops/bbox.py | # Copyright (c) OpenMMLab. All rights reserved.
from ..utils import ext_loader
ext_module = ext_loader.load_ext('_ext', ['bbox_overlaps'])
def bbox_overlaps(bboxes1, bboxes2, mode='iou', aligned=False, offset=0):
"""Calculate overlap between two set of bboxes.
If ``aligned`` is ``False``, then calculate the... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/psa_mask.py | annotator/uniformer/mmcv/ops/psa_mask.py | # Modified from https://github.com/hszhao/semseg/blob/master/lib/psa
from torch import nn
from torch.autograd import Function
from torch.nn.modules.utils import _pair
from ..utils import ext_loader
ext_module = ext_loader.load_ext('_ext',
['psamask_forward', 'psamask_backward'])
cla... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv/ops/nms.py | annotator/uniformer/mmcv/ops/nms.py | import os
import numpy as np
import torch
from annotator.uniformer.mmcv.utils import deprecated_api_warning
from ..utils import ext_loader
ext_module = ext_loader.load_ext(
'_ext', ['nms', 'softnms', 'nms_match', 'nms_rotated'])
# This function is modified from: https://github.com/pytorch/vision/
class NMSop(t... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv_custom/checkpoint.py | annotator/uniformer/mmcv_custom/checkpoint.py | # Copyright (c) Open-MMLab. All rights reserved.
import io
import os
import os.path as osp
import pkgutil
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 Optimizer
from to... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/mmcv_custom/__init__.py | annotator/uniformer/mmcv_custom/__init__.py | # -*- coding: utf-8 -*-
from .checkpoint import load_checkpoint
__all__ = ['load_checkpoint'] | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/default_runtime.py | annotator/uniformer/configs/_base_/default_runtime.py | # yapf:disable
log_config = dict(
interval=50,
hooks=[
dict(type='TextLoggerHook', by_epoch=False),
# dict(type='TensorboardLoggerHook')
])
# yapf:enable
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = None
resume_from = None
workflow = [('train', 1)]
cudnn_benchmark = True... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/schedules/schedule_20k.py | annotator/uniformer/configs/_base_/schedules/schedule_20k.py | # optimizer
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005)
optimizer_config = dict()
# learning policy
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False)
# runtime settings
runner = dict(type='IterBasedRunner', max_iters=20000)
checkpoint_config = dict(by_epoch=False, inte... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/schedules/schedule_40k.py | annotator/uniformer/configs/_base_/schedules/schedule_40k.py | # optimizer
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005)
optimizer_config = dict()
# learning policy
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False)
# runtime settings
runner = dict(type='IterBasedRunner', max_iters=40000)
checkpoint_config = dict(by_epoch=False, inte... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/schedules/schedule_160k.py | annotator/uniformer/configs/_base_/schedules/schedule_160k.py | # optimizer
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005)
optimizer_config = dict()
# learning policy
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False)
# runtime settings
runner = dict(type='IterBasedRunner', max_iters=160000)
checkpoint_config = dict(by_epoch=False, int... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/schedules/schedule_80k.py | annotator/uniformer/configs/_base_/schedules/schedule_80k.py | # optimizer
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005)
optimizer_config = dict()
# learning policy
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False)
# runtime settings
runner = dict(type='IterBasedRunner', max_iters=80000)
checkpoint_config = dict(by_epoch=False, inte... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/datasets/hrf.py | annotator/uniformer/configs/_base_/datasets/hrf.py | # dataset settings
dataset_type = 'HRFDataset'
data_root = 'data/HRF'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
img_scale = (2336, 3504)
crop_size = (256, 256)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(type=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/datasets/drive.py | annotator/uniformer/configs/_base_/datasets/drive.py | # dataset settings
dataset_type = 'DRIVEDataset'
data_root = 'data/DRIVE'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
img_scale = (584, 565)
crop_size = (64, 64)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(type=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/datasets/pascal_voc12.py | annotator/uniformer/configs/_base_/datasets/pascal_voc12.py | # dataset settings
dataset_type = 'PascalVOCDataset'
data_root = 'data/VOCdevkit/VOC2012'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
crop_size = (512, 512)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(type='Resi... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/datasets/stare.py | annotator/uniformer/configs/_base_/datasets/stare.py | # dataset settings
dataset_type = 'STAREDataset'
data_root = 'data/STARE'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
img_scale = (605, 700)
crop_size = (128, 128)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(typ... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/datasets/pascal_voc12_aug.py | annotator/uniformer/configs/_base_/datasets/pascal_voc12_aug.py | _base_ = './pascal_voc12.py'
# dataset settings
data = dict(
train=dict(
ann_dir=['SegmentationClass', 'SegmentationClassAug'],
split=[
'ImageSets/Segmentation/train.txt',
'ImageSets/Segmentation/aug.txt'
]))
| python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/datasets/chase_db1.py | annotator/uniformer/configs/_base_/datasets/chase_db1.py | # dataset settings
dataset_type = 'ChaseDB1Dataset'
data_root = 'data/CHASE_DB1'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
img_scale = (960, 999)
crop_size = (128, 128)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
d... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/datasets/ade20k.py | annotator/uniformer/configs/_base_/datasets/ade20k.py | # dataset settings
dataset_type = 'ADE20KDataset'
data_root = 'data/ade/ADEChallengeData2016'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
crop_size = (512, 512)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', reduce_zero_labe... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/datasets/cityscapes.py | annotator/uniformer/configs/_base_/datasets/cityscapes.py | # dataset settings
dataset_type = 'CityscapesDataset'
data_root = 'data/cityscapes/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
crop_size = (512, 1024)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(type='Resize',... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/datasets/pascal_context.py | annotator/uniformer/configs/_base_/datasets/pascal_context.py | # dataset settings
dataset_type = 'PascalContextDataset'
data_root = 'data/VOCdevkit/VOC2010/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
img_scale = (520, 520)
crop_size = (480, 480)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnno... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/datasets/pascal_context_59.py | annotator/uniformer/configs/_base_/datasets/pascal_context_59.py | # dataset settings
dataset_type = 'PascalContextDataset59'
data_root = 'data/VOCdevkit/VOC2010/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
img_scale = (520, 520)
crop_size = (480, 480)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAn... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/datasets/cityscapes_769x769.py | annotator/uniformer/configs/_base_/datasets/cityscapes_769x769.py | _base_ = './cityscapes.py'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
crop_size = (769, 769)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(type='Resize', img_scale=(2049, 1025), ratio_range=(0.5, 2.0)),
dict(... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/gcnet_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/fast_scnn.py | annotator/uniformer/configs/_base_/models/fast_scnn.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True, momentum=0.01)
model = dict(
type='EncoderDecoder',
backbone=dict(
type='FastSCNN',
downsample_dw_channels=(32, 48),
global_in_channels=64,
global_block_channels=(64, 96, 128),
global_block_strides=(2, 2,... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/ccnet_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/danet_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/pspnet_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/encnet_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/fcn_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/psanet_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/apcnet_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/ocrnet_hr18.py | annotator/uniformer/configs/_base_/models/ocrnet_hr18.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='CascadeEncoderDecoder',
num_stages=2,
pretrained='open-mmlab://msra/hrnetv2_w18',
backbone=dict(
type='HRNet',
norm_cfg=norm_cfg,
norm_eval=False,
extra=dict(
stage1=dict(
... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/upernet_r50.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/upernet_uniformer.py | annotator/uniformer/configs/_base_/models/upernet_uniformer.py | # model settings
norm_cfg = dict(type='BN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained=None,
backbone=dict(
type='UniFormer',
embed_dim=[64, 128, 320, 512],
layers=[3, 4, 8, 3],
head_dim=64,
mlp_ratio=4.,
qkv_bias=True,
drop_ra... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/ocrnet_r50-d8.py | annotator/uniformer/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... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/emanet_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/dmnet_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/nonlocal_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/deeplabv3_unet_s5-d16.py | annotator/uniformer/configs/_base_/models/deeplabv3_unet_s5-d16.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained=None,
backbone=dict(
type='UNet',
in_channels=3,
base_channels=64,
num_stages=5,
strides=(1, 1, 1, 1, 1),
enc_num_convs=(2, 2, 2, 2, 2),
... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/deeplabv3_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/fcn_unet_s5-d16.py | annotator/uniformer/configs/_base_/models/fcn_unet_s5-d16.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained=None,
backbone=dict(
type='UNet',
in_channels=3,
base_channels=64,
num_stages=5,
strides=(1, 1, 1, 1, 1),
enc_num_convs=(2, 2, 2, 2, 2),
... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/deeplabv3plus_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/fcn_hr18.py | annotator/uniformer/configs/_base_/models/fcn_hr18.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://msra/hrnetv2_w18',
backbone=dict(
type='HRNet',
norm_cfg=norm_cfg,
norm_eval=False,
extra=dict(
stage1=dict(
num_modul... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/pointrend_r50.py | annotator/uniformer/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... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/dnl_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/lraspp_m-v3-d8.py | annotator/uniformer/configs/_base_/models/lraspp_m-v3-d8.py | # model settings
norm_cfg = dict(type='SyncBN', eps=0.001, requires_grad=True)
model = dict(
type='EncoderDecoder',
backbone=dict(
type='MobileNetV3',
arch='large',
out_indices=(1, 3, 16),
norm_cfg=norm_cfg),
decode_head=dict(
type='LRASPPHead',
in_channels=(1... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/pspnet_unet_s5-d16.py | annotator/uniformer/configs/_base_/models/pspnet_unet_s5-d16.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained=None,
backbone=dict(
type='UNet',
in_channels=3,
base_channels=64,
num_stages=5,
strides=(1, 1, 1, 1, 1),
enc_num_convs=(2, 2, 2, 2, 2),
... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/cgnet.py | annotator/uniformer/configs/_base_/models/cgnet.py | # model settings
norm_cfg = dict(type='SyncBN', eps=1e-03, requires_grad=True)
model = dict(
type='EncoderDecoder',
backbone=dict(
type='CGNet',
norm_cfg=norm_cfg,
in_channels=3,
num_channels=(32, 64, 128),
num_blocks=(3, 21),
dilations=(2, 4),
reductions=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/fpn_uniformer.py | annotator/uniformer/configs/_base_/models/fpn_uniformer.py | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
backbone=dict(
type='UniFormer',
embed_dim=[64, 128, 320, 512],
layers=[3, 4, 8, 3],
head_dim=64,
mlp_ratio=4.,
qkv_bias=True,
drop_rate=0.,
at... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/ann_r50-d8.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/uniformer/configs/_base_/models/fpn_r50.py | annotator/uniformer/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=... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/annotator/canny/__init__.py | annotator/canny/__init__.py | import cv2
class CannyDetector:
def __call__(self, img, low_threshold, high_threshold):
return cv2.Canny(img, low_threshold, high_threshold)
| python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/util.py | ldm/util.py | import importlib
import torch
from torch import optim
import numpy as np
from inspect import isfunction
from PIL import Image, ImageDraw, ImageFont
def log_txt_as_img(wh, xc, size=10):
# wh a tuple of (width, height)
# xc a list of captions to plot
b = len(xc)
txts = list()
for bi in range(b):
... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/models/autoencoder.py | ldm/models/autoencoder.py | import torch
import pytorch_lightning as pl
import torch.nn.functional as F
from contextlib import contextmanager
from ldm.modules.diffusionmodules.model import Encoder, Decoder
from ldm.modules.distributions.distributions import DiagonalGaussianDistribution
from ldm.util import instantiate_from_config
from ldm.modul... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/models/diffusion/ddim.py | ldm/models/diffusion/ddim.py | """SAMPLING ONLY."""
import torch
import numpy as np
from tqdm import tqdm
from ldm.modules.diffusionmodules.util import make_ddim_sampling_parameters, make_ddim_timesteps, noise_like, extract_into_tensor
class DDIMSampler(object):
def __init__(self, model, schedule="linear", **kwargs):
super().__init__... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/models/diffusion/ddpm.py | ldm/models/diffusion/ddpm.py | """
wild mixture of
https://github.com/lucidrains/denoising-diffusion-pytorch/blob/7706bdfc6f527f58d33f84b7b522e61e6e3164b3/denoising_diffusion_pytorch/denoising_diffusion_pytorch.py
https://github.com/openai/improved-diffusion/blob/e94489283bb876ac1477d5dd7709bbbd2d9902ce/improved_diffusion/gaussian_diffusion.py
https... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | true |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/models/diffusion/__init__.py | ldm/models/diffusion/__init__.py | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false | |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/models/diffusion/sampling_util.py | ldm/models/diffusion/sampling_util.py | import torch
import numpy as np
def append_dims(x, target_dims):
"""Appends dimensions to the end of a tensor until it has target_dims dimensions.
From https://github.com/crowsonkb/k-diffusion/blob/master/k_diffusion/utils.py"""
dims_to_append = target_dims - x.ndim
if dims_to_append < 0:
rais... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/models/diffusion/plms.py | ldm/models/diffusion/plms.py | """SAMPLING ONLY."""
import torch
import numpy as np
from tqdm import tqdm
from functools import partial
from ldm.modules.diffusionmodules.util import make_ddim_sampling_parameters, make_ddim_timesteps, noise_like
from ldm.models.diffusion.sampling_util import norm_thresholding
class PLMSSampler(object):
def __... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/models/diffusion/dpm_solver/dpm_solver.py | ldm/models/diffusion/dpm_solver/dpm_solver.py | import torch
import torch.nn.functional as F
import math
from tqdm import tqdm
class NoiseScheduleVP:
def __init__(
self,
schedule='discrete',
betas=None,
alphas_cumprod=None,
continuous_beta_0=0.1,
continuous_beta_1=20.,
):
"""Cr... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | true |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/models/diffusion/dpm_solver/sampler.py | ldm/models/diffusion/dpm_solver/sampler.py | """SAMPLING ONLY."""
import torch
from .dpm_solver import NoiseScheduleVP, model_wrapper, DPM_Solver
MODEL_TYPES = {
"eps": "noise",
"v": "v"
}
class DPMSolverSampler(object):
def __init__(self, model, **kwargs):
super().__init__()
self.model = model
to_torch = lambda x: x.clone... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/models/diffusion/dpm_solver/__init__.py | ldm/models/diffusion/dpm_solver/__init__.py | from .sampler import DPMSolverSampler | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/ema.py | ldm/modules/ema.py | import torch
from torch import nn
class LitEma(nn.Module):
def __init__(self, model, decay=0.9999, use_num_upates=True):
super().__init__()
if decay < 0.0 or decay > 1.0:
raise ValueError('Decay must be between 0 and 1')
self.m_name2s_name = {}
self.register_buffer('de... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/attention.py | ldm/modules/attention.py | from inspect import isfunction
import math
import torch
import torch.nn.functional as F
from torch import nn, einsum
from einops import rearrange, repeat
from typing import Optional, Any
from ldm.modules.diffusionmodules.util import checkpoint
try:
import xformers
import xformers.ops
XFORMERS_IS_AVAILBLE... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/image_degradation/bsrgan.py | ldm/modules/image_degradation/bsrgan.py | # -*- coding: utf-8 -*-
"""
# --------------------------------------------
# Super-Resolution
# --------------------------------------------
#
# Kai Zhang (cskaizhang@gmail.com)
# https://github.com/cszn
# From 2019/03--2021/08
# --------------------------------------------
"""
import numpy as np
import cv2
import tor... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/image_degradation/bsrgan_light.py | ldm/modules/image_degradation/bsrgan_light.py | # -*- coding: utf-8 -*-
import numpy as np
import cv2
import torch
from functools import partial
import random
from scipy import ndimage
import scipy
import scipy.stats as ss
from scipy.interpolate import interp2d
from scipy.linalg import orth
import albumentations
import ldm.modules.image_degradation.utils_image as ... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/image_degradation/__init__.py | ldm/modules/image_degradation/__init__.py | from ldm.modules.image_degradation.bsrgan import degradation_bsrgan_variant as degradation_fn_bsr
from ldm.modules.image_degradation.bsrgan_light import degradation_bsrgan_variant as degradation_fn_bsr_light
| python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/image_degradation/utils_image.py | ldm/modules/image_degradation/utils_image.py | import os
import math
import random
import numpy as np
import torch
import cv2
from torchvision.utils import make_grid
from datetime import datetime
#import matplotlib.pyplot as plt # TODO: check with Dominik, also bsrgan.py vs bsrgan_light.py
os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE"
'''
# ----------------------... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/distributions/distributions.py | ldm/modules/distributions/distributions.py | import torch
import numpy as np
class AbstractDistribution:
def sample(self):
raise NotImplementedError()
def mode(self):
raise NotImplementedError()
class DiracDistribution(AbstractDistribution):
def __init__(self, value):
self.value = value
def sample(self):
retur... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/distributions/__init__.py | ldm/modules/distributions/__init__.py | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false | |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/encoders/modules.py | ldm/modules/encoders/modules.py | import torch
import torch.nn as nn
from torch.utils.checkpoint import checkpoint
from transformers import T5Tokenizer, T5EncoderModel, CLIPTokenizer, CLIPTextModel
import open_clip
from ldm.util import default, count_params
class AbstractEncoder(nn.Module):
def __init__(self):
super().__init__()
de... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/encoders/__init__.py | ldm/modules/encoders/__init__.py | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false | |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/midas/api.py | ldm/modules/midas/api.py | # based on https://github.com/isl-org/MiDaS
import cv2
import torch
import torch.nn as nn
from torchvision.transforms import Compose
from ldm.modules.midas.midas.dpt_depth import DPTDepthModel
from ldm.modules.midas.midas.midas_net import MidasNet
from ldm.modules.midas.midas.midas_net_custom import MidasNet_small
fr... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/midas/utils.py | ldm/modules/midas/utils.py | """Utils for monoDepth."""
import sys
import re
import numpy as np
import cv2
import torch
def read_pfm(path):
"""Read pfm file.
Args:
path (str): path to file
Returns:
tuple: (data, scale)
"""
with open(path, "rb") as file:
color = None
width = None
heig... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/midas/__init__.py | ldm/modules/midas/__init__.py | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false | |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/midas/midas/midas_net_custom.py | ldm/modules/midas/midas/midas_net_custom.py | """MidashNet: Network for monocular depth estimation trained by mixing several datasets.
This file contains code that is adapted from
https://github.com/thomasjpfan/pytorch_refinenet/blob/master/pytorch_refinenet/refinenet/refinenet_4cascade.py
"""
import torch
import torch.nn as nn
from .base_model import BaseModel
f... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/midas/midas/base_model.py | ldm/modules/midas/midas/base_model.py | import torch
class BaseModel(torch.nn.Module):
def load(self, path):
"""Load model from file.
Args:
path (str): file path
"""
parameters = torch.load(path, map_location=torch.device('cpu'))
if "optimizer" in parameters:
parameters = parameters["mod... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/midas/midas/dpt_depth.py | ldm/modules/midas/midas/dpt_depth.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from .base_model import BaseModel
from .blocks import (
FeatureFusionBlock,
FeatureFusionBlock_custom,
Interpolate,
_make_encoder,
forward_vit,
)
def _make_fusion_block(features, use_bn):
return FeatureFusionBlock_custom(
... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/midas/midas/blocks.py | ldm/modules/midas/midas/blocks.py | import torch
import torch.nn as nn
from .vit import (
_make_pretrained_vitb_rn50_384,
_make_pretrained_vitl16_384,
_make_pretrained_vitb16_384,
forward_vit,
)
def _make_encoder(backbone, features, use_pretrained, groups=1, expand=False, exportable=True, hooks=None, use_vit_only=False, use_readout="ign... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/midas/midas/midas_net.py | ldm/modules/midas/midas/midas_net.py | """MidashNet: Network for monocular depth estimation trained by mixing several datasets.
This file contains code that is adapted from
https://github.com/thomasjpfan/pytorch_refinenet/blob/master/pytorch_refinenet/refinenet/refinenet_4cascade.py
"""
import torch
import torch.nn as nn
from .base_model import BaseModel
f... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/midas/midas/vit.py | ldm/modules/midas/midas/vit.py | import torch
import torch.nn as nn
import timm
import types
import math
import torch.nn.functional as F
class Slice(nn.Module):
def __init__(self, start_index=1):
super(Slice, self).__init__()
self.start_index = start_index
def forward(self, x):
return x[:, self.start_index :]
class... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/midas/midas/__init__.py | ldm/modules/midas/midas/__init__.py | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false | |
lllyasviel/ControlNet | https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/ldm/modules/midas/midas/transforms.py | ldm/modules/midas/midas/transforms.py | import numpy as np
import cv2
import math
def apply_min_size(sample, size, image_interpolation_method=cv2.INTER_AREA):
"""Rezise the sample to ensure the given size. Keeps aspect ratio.
Args:
sample (dict): sample
size (tuple): image size
Returns:
tuple: new size
"""
shap... | python | Apache-2.0 | ed85cd1e25a5ed592f7d8178495b4483de0331bf | 2026-01-04T14:42:42.940079Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.