Skip to content

Commit

Permalink
style: update first party import (open-mmlab#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
hejm37 authored Jul 20, 2020
1 parent 769543b commit aa5d9c8
Show file tree
Hide file tree
Showing 108 changed files with 114 additions and 19 deletions.
1 change: 1 addition & 0 deletions demo/generation_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import mmcv
import torch

from mmedit.apis import generation_inference, init_model


Expand Down
1 change: 1 addition & 0 deletions demo/inpainting_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import mmcv
import torch

from mmedit.apis import init_model, inpainting_inference
from mmedit.core import tensor2img

Expand Down
1 change: 1 addition & 0 deletions demo/matting_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import mmcv
import torch

from mmedit.apis import init_model, matting_inference


Expand Down
1 change: 1 addition & 0 deletions demo/restoration_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import mmcv
import torch

from mmedit.apis import init_model, restoration_inference
from mmedit.core import tensor2img

Expand Down
1 change: 1 addition & 0 deletions mmedit/apis/generation_inference.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import torch
from mmcv.parallel import collate, scatter

from mmedit.core import tensor2img
from mmedit.datasets.pipelines import Compose

Expand Down
1 change: 1 addition & 0 deletions mmedit/apis/inpainting_inference.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch
from mmcv.parallel import collate, scatter

from mmedit.datasets.pipelines import Compose


Expand Down
1 change: 1 addition & 0 deletions mmedit/apis/matting_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import torch
from mmcv.parallel import collate, scatter
from mmcv.runner import load_checkpoint

from mmedit.datasets.pipelines import Compose
from mmedit.models import build_model

Expand Down
1 change: 1 addition & 0 deletions mmedit/apis/restoration_inference.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch
from mmcv.parallel import collate, scatter

from mmedit.datasets.pipelines import Compose


Expand Down
1 change: 1 addition & 0 deletions mmedit/apis/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import torch
from mmcv.parallel import MMDataParallel
from mmcv.runner import HOOKS, IterBasedRunner

from mmedit.core import DistEvalIterHook, EvalIterHook, build_optimizers
from mmedit.core.distributed_wrapper import DistributedDataParallelWrapper
from mmedit.datasets.builder import build_dataloader, build_dataset
Expand Down
2 changes: 1 addition & 1 deletion mmedit/datasets/pipelines/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import mmcv
import numpy as np
from mmcv.fileio import FileClient

from mmedit.core.mask import (bbox2mask, brush_stroke_mask, get_irregular_mask,
random_bbox)

from ..registry import PIPELINES


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, build_activation_layer

from mmedit.models.common import SimpleGatedConvModule
from mmedit.models.registry import COMPONENTS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule

from mmedit.models.registry import COMPONENTS


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, kaiming_init, normal_init

from mmedit.models.common import DepthwiseSeparableConvModule
from mmedit.models.registry import COMPONENTS

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import torch
import torch.nn as nn
import torch.nn.functional as F

from mmedit.models.common import MaskConvModule
from mmedit.models.registry import COMPONENTS

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch.nn as nn
from mmcv.cnn.utils.weight_init import xavier_init

from mmedit.models.registry import COMPONENTS


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import torch.nn as nn
from mmcv.cnn import ConvModule, constant_init

from mmedit.models.common import GCAModule
from mmedit.models.registry import COMPONENTS

from ..encoders.resnet_enc import BasicBlock


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch.nn as nn
from mmcv.cnn import ConvModule

from mmedit.models.common import SimpleGatedConvModule
from mmedit.models.registry import COMPONENTS

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch.nn as nn
from mmcv.cnn import ConvModule

from mmedit.models.registry import COMPONENTS


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from mmcv.cnn import ConvModule, constant_init, xavier_init
from mmcv.runner import load_checkpoint
from mmcv.utils.parrots_wrapper import SyncBatchNorm

from mmedit.models.common import ASPP, DepthwiseSeparableConvModule
from mmedit.models.registry import COMPONENTS
from mmedit.utils import get_root_logger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch.nn as nn
from mmcv.utils.parrots_wrapper import _BatchNorm

from mmedit.models.common import MaskConvModule
from mmedit.models.registry import COMPONENTS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import torch.nn.functional as F
from mmcv.cnn import ConvModule, build_activation_layer, constant_init
from mmcv.runner import load_checkpoint

from mmedit.models.common import GCAModule
from mmedit.models.registry import COMPONENTS
from mmedit.utils.logger import get_root_logger
Expand Down
1 change: 1 addition & 0 deletions mmedit/models/backbones/encoder_decoders/encoders/vgg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import torch.nn as nn
from mmcv.cnn.utils.weight_init import constant_init, xavier_init
from mmcv.runner import load_checkpoint

from mmedit.models.common import ASPP
from mmedit.models.registry import COMPONENTS
from mmedit.utils import get_root_logger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch.nn as nn
from mmcv.runner import load_checkpoint

from mmedit.models.builder import build_component
from mmedit.models.registry import BACKBONES
from mmedit.utils import get_root_logger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch.nn as nn
from mmcv.cnn import ConvModule

from mmedit.models.common import SimpleGatedConvModule
from mmedit.models.common.contextual_attention import ContextualAttentionModule
from mmedit.models.registry import COMPONENTS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch.nn as nn
from mmcv.cnn import ConvModule

from mmedit.models.common import SimpleGatedConvModule
from mmedit.models.registry import COMPONENTS

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch.nn as nn
from mmcv.runner import load_checkpoint

from mmedit.models.builder import build_component
from mmedit.models.registry import BACKBONES
from mmedit.utils import get_root_logger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import torch.nn as nn

from mmedit.models.builder import build_component
from mmedit.models.registry import BACKBONES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from mmcv.cnn import constant_init, normal_init
from mmcv.runner import load_checkpoint
from mmcv.utils.parrots_wrapper import _BatchNorm

from mmedit.models.builder import build_backbone, build_component
from mmedit.models.registry import BACKBONES
from mmedit.utils import get_root_logger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.runner import load_checkpoint

from mmedit.models.common import (ResidualBlockWithDropout,
generation_init_weights)
from mmedit.models.registry import BACKBONES
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch.nn as nn
from mmcv.runner import load_checkpoint

from mmedit.models.common import (UnetSkipConnectionBlock,
generation_init_weights)
from mmedit.models.registry import BACKBONES
Expand Down
1 change: 1 addition & 0 deletions mmedit/models/backbones/sr_backbones/edsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import torch
import torch.nn as nn
from mmcv.runner import load_checkpoint

from mmedit.models.common import (PixelShufflePack, ResidualBlockNoBN,
make_layer)
from mmedit.models.registry import BACKBONES
Expand Down
3 changes: 2 additions & 1 deletion mmedit/models/backbones/sr_backbones/edvr_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
from mmcv.cnn import ConvModule, constant_init, kaiming_init
from mmcv.ops import ModulatedDeformConv2d, modulated_deform_conv2d
from mmcv.runner import load_checkpoint
from torch.nn.modules.utils import _pair

from mmedit.models.common import (PixelShufflePack, ResidualBlockNoBN,
make_layer)
from mmedit.models.registry import BACKBONES
from mmedit.utils import get_root_logger
from torch.nn.modules.utils import _pair


class ModulatedDCNPack(ModulatedDeformConv2d):
Expand Down
1 change: 1 addition & 0 deletions mmedit/models/backbones/sr_backbones/rrdb_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import torch.nn as nn
import torch.nn.functional as F
from mmcv.runner import load_checkpoint

from mmedit.models.common import default_init_weights, make_layer
from mmedit.models.registry import BACKBONES
from mmedit.utils import get_root_logger
Expand Down
1 change: 1 addition & 0 deletions mmedit/models/backbones/sr_backbones/sr_resnet.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch.nn as nn
from mmcv.runner import load_checkpoint

from mmedit.models.common import (PixelShufflePack, ResidualBlockNoBN,
default_init_weights, make_layer)
from mmedit.models.registry import BACKBONES
Expand Down
1 change: 1 addition & 0 deletions mmedit/models/backbones/sr_backbones/srcnn.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch.nn as nn
from mmcv.runner import load_checkpoint

from mmedit.models.registry import BACKBONES
from mmedit.utils import get_root_logger

Expand Down
1 change: 1 addition & 0 deletions mmedit/models/backbones/sr_backbones/tof.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import load_checkpoint

from mmedit.models.common import flow_warp
from mmedit.models.registry import BACKBONES
from mmedit.utils import get_root_logger
Expand Down
1 change: 1 addition & 0 deletions mmedit/models/components/discriminators/deepfill_disc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import torch.nn as nn
from mmcv.cnn import normal_init
from mmcv.runner import load_checkpoint

from mmedit.models import build_component
from mmedit.models.registry import COMPONENTS
from mmedit.utils import get_root_logger
Expand Down
2 changes: 1 addition & 1 deletion mmedit/models/components/discriminators/gl_disc.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import torch
import torch.nn as nn
from mmcv.runner import load_checkpoint

from mmedit.models.registry import COMPONENTS
from mmedit.utils import get_root_logger

from .multi_layer_disc import MultiLayerDiscriminator


Expand Down
1 change: 1 addition & 0 deletions mmedit/models/components/discriminators/modified_vgg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import torch.nn as nn
from mmcv.runner import load_checkpoint

from mmedit.models.registry import COMPONENTS
from mmedit.utils import get_root_logger

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.runner import load_checkpoint

from mmedit.models.common import LinearModule
from mmedit.models.registry import COMPONENTS
from mmedit.utils import get_root_logger
Expand Down
1 change: 1 addition & 0 deletions mmedit/models/components/discriminators/patch_disc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import torch.nn as nn
from mmcv.cnn import ConvModule, build_conv_layer
from mmcv.runner import load_checkpoint

from mmedit.models.common import generation_init_weights
from mmedit.models.registry import COMPONENTS
from mmedit.utils import get_root_logger
Expand Down
1 change: 1 addition & 0 deletions mmedit/models/components/refiners/deepfill_refiner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import torch
import torch.nn as nn
import torch.nn.functional as F

from mmedit.models.builder import build_component
from mmedit.models.registry import COMPONENTS

Expand Down
1 change: 1 addition & 0 deletions mmedit/models/components/refiners/plain_refiner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import torch
import torch.nn as nn
from mmcv.cnn.utils.weight_init import xavier_init

from mmedit.models.registry import COMPONENTS


Expand Down
2 changes: 1 addition & 1 deletion mmedit/models/inpaintors/one_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import mmcv
import torch
from mmedit.core import L1Evaluation, psnr, ssim, tensor2img
from torchvision.utils import save_image

from mmedit.core import L1Evaluation, psnr, ssim, tensor2img
from ..base import BaseModel
from ..builder import build_backbone, build_component, build_loss
from ..common import set_requires_grad
Expand Down
2 changes: 1 addition & 1 deletion mmedit/models/inpaintors/pconv_inpaintor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import mmcv
import torch
from mmedit.core import tensor2img

from mmedit.core import tensor2img
from ..registry import MODELS
from .one_stage import OneStageInpaintor

Expand Down
2 changes: 1 addition & 1 deletion mmedit/models/inpaintors/two_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import mmcv
import torch
from mmedit.core import tensor2img
from torchvision.utils import save_image

from mmedit.core import tensor2img
from ..common.model_utils import set_requires_grad
from ..registry import MODELS
from .one_stage import OneStageInpaintor
Expand Down
2 changes: 1 addition & 1 deletion mmedit/models/losses/perceptual_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import torch.nn as nn
import torchvision.models.vgg as vgg
from mmcv.runner import load_checkpoint
from mmedit.utils import get_root_logger

from mmedit.utils import get_root_logger
from ..registry import LOSSES


Expand Down
2 changes: 1 addition & 1 deletion mmedit/models/mattors/base_mattor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import numpy as np
from mmcv import ConfigDict
from mmcv.utils import print_log
from mmedit.core.evaluation import connectivity, gradient_error, mse, sad

from mmedit.core.evaluation import connectivity, gradient_error, mse, sad
from ..base import BaseModel
from ..builder import build_backbone, build_component
from ..registry import MODELS
Expand Down
Loading

0 comments on commit aa5d9c8

Please sign in to comment.