Unverified Commit d2483e15 authored by Kai Chen's avatar Kai Chen Committed by GitHub
Browse files

Use isort to sort imports and setup travis (#1085)

* add isort config

* use isort to sort imports

* add isort to travis
parent 864880de
import torch.nn as nn import torch.nn as nn
from mmcv.cnn import normal_init from mmcv.cnn import normal_init
from .guided_anchor_head import GuidedAnchorHead, FeatureAdaption
from ..registry import HEADS
from ..utils import bias_init_with_prob, ConvModule
from mmdet.ops import MaskedConv2d from mmdet.ops import MaskedConv2d
from ..registry import HEADS
from ..utils import ConvModule, bias_init_with_prob
from .guided_anchor_head import FeatureAdaption, GuidedAnchorHead
@HEADS.register_module @HEADS.register_module
......
...@@ -5,8 +5,8 @@ from mmcv.cnn import normal_init ...@@ -5,8 +5,8 @@ from mmcv.cnn import normal_init
from mmdet.core import delta2bbox from mmdet.core import delta2bbox
from mmdet.ops import nms from mmdet.ops import nms
from .guided_anchor_head import GuidedAnchorHead
from ..registry import HEADS from ..registry import HEADS
from .guided_anchor_head import GuidedAnchorHead
@HEADS.register_module @HEADS.register_module
......
...@@ -5,14 +5,14 @@ import torch ...@@ -5,14 +5,14 @@ import torch
import torch.nn as nn import torch.nn as nn
from mmcv.cnn import normal_init from mmcv.cnn import normal_init
from mmdet.core import (AnchorGenerator, anchor_target, anchor_inside_flags, from mmdet.core import (AnchorGenerator, anchor_inside_flags, anchor_target,
ga_loc_target, ga_shape_target, delta2bbox, delta2bbox, force_fp32, ga_loc_target, ga_shape_target,
multi_apply, multiclass_nms, force_fp32) multi_apply, multiclass_nms)
from mmdet.ops import DeformConv, MaskedConv2d from mmdet.ops import DeformConv, MaskedConv2d
from ..builder import build_loss from ..builder import build_loss
from .anchor_head import AnchorHead
from ..registry import HEADS from ..registry import HEADS
from ..utils import bias_init_with_prob from ..utils import bias_init_with_prob
from .anchor_head import AnchorHead
class FeatureAdaption(nn.Module): class FeatureAdaption(nn.Module):
......
...@@ -2,9 +2,9 @@ import numpy as np ...@@ -2,9 +2,9 @@ import numpy as np
import torch.nn as nn import torch.nn as nn
from mmcv.cnn import normal_init from mmcv.cnn import normal_init
from .anchor_head import AnchorHead
from ..registry import HEADS from ..registry import HEADS
from ..utils import bias_init_with_prob, ConvModule from ..utils import ConvModule, bias_init_with_prob
from .anchor_head import AnchorHead
@HEADS.register_module @HEADS.register_module
......
...@@ -5,8 +5,8 @@ from mmcv.cnn import normal_init ...@@ -5,8 +5,8 @@ from mmcv.cnn import normal_init
from mmdet.core import delta2bbox from mmdet.core import delta2bbox
from mmdet.ops import nms from mmdet.ops import nms
from .anchor_head import AnchorHead
from ..registry import HEADS from ..registry import HEADS
from .anchor_head import AnchorHead
@HEADS.register_module @HEADS.register_module
......
...@@ -5,9 +5,9 @@ import torch.nn.functional as F ...@@ -5,9 +5,9 @@ import torch.nn.functional as F
from mmcv.cnn import xavier_init from mmcv.cnn import xavier_init
from mmdet.core import AnchorGenerator, anchor_target, multi_apply from mmdet.core import AnchorGenerator, anchor_target, multi_apply
from .anchor_head import AnchorHead
from ..losses import smooth_l1_loss from ..losses import smooth_l1_loss
from ..registry import HEADS from ..registry import HEADS
from .anchor_head import AnchorHead
# TODO: add loss evaluator for SSD # TODO: add loss evaluator for SSD
......
...@@ -6,7 +6,7 @@ from mmcv.runner import load_checkpoint ...@@ -6,7 +6,7 @@ from mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm import _BatchNorm from torch.nn.modules.batchnorm import _BatchNorm
from ..registry import BACKBONES from ..registry import BACKBONES
from ..utils import build_norm_layer, build_conv_layer from ..utils import build_conv_layer, build_norm_layer
from .resnet import BasicBlock, Bottleneck from .resnet import BasicBlock, Bottleneck
......
...@@ -2,14 +2,12 @@ import logging ...@@ -2,14 +2,12 @@ import logging
import torch.nn as nn import torch.nn as nn
import torch.utils.checkpoint as cp import torch.utils.checkpoint as cp
from torch.nn.modules.batchnorm import _BatchNorm
from mmcv.cnn import constant_init, kaiming_init from mmcv.cnn import constant_init, kaiming_init
from mmcv.runner import load_checkpoint from mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm import _BatchNorm
from mmdet.ops import DeformConv, ModulatedDeformConv, ContextBlock
from mmdet.models.plugins import GeneralizedAttention from mmdet.models.plugins import GeneralizedAttention
from mmdet.ops import ContextBlock, DeformConv, ModulatedDeformConv
from ..registry import BACKBONES from ..registry import BACKBONES
from ..utils import build_conv_layer, build_norm_layer from ..utils import build_conv_layer, build_norm_layer
......
...@@ -3,10 +3,10 @@ import math ...@@ -3,10 +3,10 @@ import math
import torch.nn as nn import torch.nn as nn
from mmdet.ops import DeformConv, ModulatedDeformConv from mmdet.ops import DeformConv, ModulatedDeformConv
from .resnet import Bottleneck as _Bottleneck
from .resnet import ResNet
from ..registry import BACKBONES from ..registry import BACKBONES
from ..utils import build_conv_layer, build_norm_layer from ..utils import build_conv_layer, build_norm_layer
from .resnet import Bottleneck as _Bottleneck
from .resnet import ResNet
class Bottleneck(_Bottleneck): class Bottleneck(_Bottleneck):
......
...@@ -3,8 +3,7 @@ import logging ...@@ -3,8 +3,7 @@ import logging
import torch import torch
import torch.nn as nn import torch.nn as nn
import torch.nn.functional as F import torch.nn.functional as F
from mmcv.cnn import (VGG, xavier_init, constant_init, kaiming_init, from mmcv.cnn import VGG, constant_init, kaiming_init, normal_init, xavier_init
normal_init)
from mmcv.runner import load_checkpoint from mmcv.runner import load_checkpoint
from ..registry import BACKBONES from ..registry import BACKBONES
......
...@@ -2,8 +2,8 @@ import torch ...@@ -2,8 +2,8 @@ import torch
import torch.nn as nn import torch.nn as nn
import torch.nn.functional as F import torch.nn.functional as F
from mmdet.core import (delta2bbox, multiclass_nms, bbox_target, force_fp32, from mmdet.core import (auto_fp16, bbox_target, delta2bbox, force_fp32,
auto_fp16) multiclass_nms)
from ..builder import build_loss from ..builder import build_loss
from ..losses import accuracy from ..losses import accuracy
from ..registry import HEADS from ..registry import HEADS
......
import torch.nn as nn import torch.nn as nn
from .bbox_head import BBoxHead
from ..registry import HEADS from ..registry import HEADS
from ..utils import ConvModule from ..utils import ConvModule
from .bbox_head import BBoxHead
@HEADS.register_module @HEADS.register_module
......
from torch import nn from torch import nn
from mmdet.utils import build_from_cfg from mmdet.utils import build_from_cfg
from .registry import (BACKBONES, NECKS, ROI_EXTRACTORS, SHARED_HEADS, HEADS, from .registry import (BACKBONES, DETECTORS, HEADS, LOSSES, NECKS,
LOSSES, DETECTORS) ROI_EXTRACTORS, SHARED_HEADS)
def build(cfg, registry, default_args=None): def build(cfg, registry, default_args=None):
......
...@@ -3,10 +3,10 @@ from abc import ABCMeta, abstractmethod ...@@ -3,10 +3,10 @@ from abc import ABCMeta, abstractmethod
import mmcv import mmcv
import numpy as np import numpy as np
import torch.nn as nn
import pycocotools.mask as maskUtils import pycocotools.mask as maskUtils
import torch.nn as nn
from mmdet.core import tensor2imgs, get_classes, auto_fp16 from mmdet.core import auto_fp16, get_classes, tensor2imgs
class BaseDetector(nn.Module): class BaseDetector(nn.Module):
......
...@@ -3,12 +3,12 @@ from __future__ import division ...@@ -3,12 +3,12 @@ from __future__ import division
import torch import torch
import torch.nn as nn import torch.nn as nn
from .base import BaseDetector from mmdet.core import (bbox2result, bbox2roi, build_assigner, build_sampler,
from .test_mixins import RPNTestMixin merge_aug_masks)
from .. import builder from .. import builder
from ..registry import DETECTORS from ..registry import DETECTORS
from mmdet.core import (build_assigner, bbox2roi, bbox2result, build_sampler, from .base import BaseDetector
merge_aug_masks) from .test_mixins import RPNTestMixin
@DETECTORS.register_module @DETECTORS.register_module
......
from .two_stage import TwoStageDetector
from ..registry import DETECTORS from ..registry import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module @DETECTORS.register_module
......
from .two_stage import TwoStageDetector
from ..registry import DETECTORS from ..registry import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module @DETECTORS.register_module
......
from .single_stage import SingleStageDetector
from ..registry import DETECTORS from ..registry import DETECTORS
from .single_stage import SingleStageDetector
@DETECTORS.register_module @DETECTORS.register_module
......
from .two_stage import TwoStageDetector
from ..registry import DETECTORS
import torch import torch
from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler
from .. import builder from .. import builder
from mmdet.core import bbox2roi, bbox2result, build_assigner, build_sampler from ..registry import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module @DETECTORS.register_module
......
import torch import torch
import torch.nn.functional as F import torch.nn.functional as F
from .cascade_rcnn import CascadeRCNN from mmdet.core import (bbox2result, bbox2roi, build_assigner, build_sampler,
merge_aug_masks)
from .. import builder from .. import builder
from ..registry import DETECTORS from ..registry import DETECTORS
from mmdet.core import (bbox2roi, bbox2result, build_assigner, build_sampler, from .cascade_rcnn import CascadeRCNN
merge_aug_masks)
@DETECTORS.register_module @DETECTORS.register_module
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment