Unverified Commit 6f1a268e authored by ChaimZhu's avatar ChaimZhu Committed by GitHub
Browse files

[Enhancement] Upgrade isort in pre-commit hook (#1217)

* update isort

* update setuptools

* fix

* pre-commit run --all-files
parent 53488dad
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import torch
from functools import partial from functools import partial
import torch
from mmdet3d.core.points import get_points_type from mmdet3d.core.points import get_points_type
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import math import math
import numpy as np import numpy as np
from mmcv.cnn import ConvModule, build_conv_layer from mmcv.cnn import ConvModule, build_conv_layer
from mmcv.runner import BaseModule from mmcv.runner import BaseModule
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
from abc import ABCMeta, abstractmethod from abc import ABCMeta, abstractmethod
from mmcv.runner import BaseModule from mmcv.runner import BaseModule
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import warnings import warnings
from torch.nn import functional as F from torch.nn import functional as F
from mmdet3d.core import AssignResult from mmdet3d.core import AssignResult
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
from os import path as osp
import mmcv import mmcv
import numpy as np import numpy as np
import torch import torch
from mmcv.parallel import DataContainer as DC from mmcv.parallel import DataContainer as DC
from mmcv.runner import auto_fp16 from mmcv.runner import auto_fp16
from os import path as osp
from mmdet3d.core import show_seg_result from mmdet3d.core import show_seg_result
from mmseg.models.segmentors import BaseSegmentor from mmseg.models.segmentors import BaseSegmentor
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
from typing import List
import torch import torch
from mmcv.runner import force_fp32 from mmcv.runner import force_fp32
from torch import nn as nn from torch import nn as nn
from typing import List
from .furthest_point_sample import (furthest_point_sample, from .furthest_point_sample import (furthest_point_sample,
furthest_point_sample_with_dist) furthest_point_sample_with_dist)
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
from typing import Tuple
import torch import torch
from torch import nn as nn from torch import nn as nn
from torch.autograd import Function from torch.autograd import Function
from typing import Tuple
from ..ball_query import ball_query from ..ball_query import ball_query
from ..knn import knn from ..knn import knn
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
from typing import Tuple
import torch import torch
from torch.autograd import Function from torch.autograd import Function
from typing import Tuple
from . import interpolate_ext from . import interpolate_ext
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
from typing import Tuple
import torch import torch
from torch.autograd import Function from torch.autograd import Function
from typing import Tuple
from . import interpolate_ext from . import interpolate_ext
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import copy import copy
import torch import torch
from mmcv.cnn import (ConvModule, build_activation_layer, build_norm_layer, from mmcv.cnn import (ConvModule, build_activation_layer, build_norm_layer,
constant_init) constant_init)
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
from typing import List
import torch import torch
from mmcv.cnn import ConvModule from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule, force_fp32 from mmcv.runner import BaseModule, force_fp32
from torch import nn as nn from torch import nn as nn
from typing import List
from mmdet3d.ops import three_interpolate, three_nn from mmdet3d.ops import three_interpolate, three_nn
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import math import math
import numpy as np import numpy as np
import torch import torch
from mmcv.cnn import CONV_LAYERS from mmcv.cnn import CONV_LAYERS
......
...@@ -12,8 +12,9 @@ ...@@ -12,8 +12,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import sys import sys
import torch
from collections import OrderedDict from collections import OrderedDict
import torch
from torch import nn from torch import nn
from .structure import SparseConvTensor from .structure import SparseConvTensor
......
...@@ -11,9 +11,10 @@ ...@@ -11,9 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import numpy as np
import unittest import unittest
import numpy as np
class TestCase(unittest.TestCase): class TestCase(unittest.TestCase):
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import logging import logging
from mmcv.utils import get_logger from mmcv.utils import get_logger
......
...@@ -6,7 +6,7 @@ SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = true ...@@ -6,7 +6,7 @@ SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = true
[isort] [isort]
line_length = 79 line_length = 79
multi_line_output = 0 multi_line_output = 0
known_standard_library = setuptools extra_standard_library = setuptools
known_first_party = mmdet,mmseg,mmdet3d known_first_party = mmdet,mmseg,mmdet3d
known_third_party = cv2,imageio,indoor3d_util,load_scannet_data,lyft_dataset_sdk,m2r,matplotlib,mmcv,nuimages,numba,numpy,nuscenes,pandas,plyfile,pycocotools,pyquaternion,pytest,pytorch_sphinx_theme,recommonmark,requests,scannet_utils,scipy,seaborn,shapely,skimage,sphinx,tensorflow,terminaltables,torch,trimesh,ts,waymo_open_dataset known_third_party = cv2,imageio,indoor3d_util,load_scannet_data,lyft_dataset_sdk,m2r,matplotlib,mmcv,nuimages,numba,numpy,nuscenes,pandas,plyfile,pycocotools,pyquaternion,pytest,pytorch_sphinx_theme,recommonmark,requests,scannet_utils,scipy,seaborn,shapely,skimage,sphinx,tensorflow,terminaltables,torch,trimesh,ts,waymo_open_dataset
no_lines_before = STDLIB,LOCALFOLDER no_lines_before = STDLIB,LOCALFOLDER
......
from setuptools import find_packages, setup
import os import os
import platform import platform
import shutil import shutil
import sys import sys
import torch
import warnings import warnings
from os import path as osp from os import path as osp
from setuptools import find_packages, setup
import torch
from torch.utils.cpp_extension import (BuildExtension, CppExtension, from torch.utils.cpp_extension import (BuildExtension, CppExtension,
CUDAExtension) CUDAExtension)
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import math import math
import numpy as np
import os import os
import pytest
import tempfile import tempfile
import numpy as np
import pytest
import torch import torch
from mmdet3d.core.bbox import LiDARInstance3DBoxes, limit_period from mmdet3d.core.bbox import LiDARInstance3DBoxes, limit_period
...@@ -255,9 +256,10 @@ def test_evaluate(): ...@@ -255,9 +256,10 @@ def test_evaluate():
def test_show(): def test_show():
import mmcv
from os import path as osp from os import path as osp
import mmcv
from mmdet3d.core.bbox import LiDARInstance3DBoxes from mmdet3d.core.bbox import LiDARInstance3DBoxes
tmp_dir = tempfile.TemporaryDirectory() tmp_dir = tempfile.TemporaryDirectory()
temp_dir = tmp_dir.name temp_dir = tmp_dir.name
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import tempfile
import mmcv import mmcv
import numpy as np import numpy as np
import tempfile
import torch import torch
from mmdet3d.core import limit_period from mmdet3d.core import limit_period
...@@ -140,9 +141,10 @@ def test_evaluate(): ...@@ -140,9 +141,10 @@ def test_evaluate():
def test_show(): def test_show():
import mmcv
from os import path as osp from os import path as osp
import mmcv
from mmdet3d.core.bbox import LiDARInstance3DBoxes from mmdet3d.core.bbox import LiDARInstance3DBoxes
tmp_dir = tempfile.TemporaryDirectory() tmp_dir = tempfile.TemporaryDirectory()
temp_dir = tmp_dir.name temp_dir = tmp_dir.name
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import tempfile import tempfile
import numpy as np
import torch import torch
from mmdet3d.datasets import NuScenesDataset from mmdet3d.datasets import NuScenesDataset
...@@ -65,9 +66,10 @@ def test_getitem(): ...@@ -65,9 +66,10 @@ def test_getitem():
def test_show(): def test_show():
import mmcv
from os import path as osp from os import path as osp
import mmcv
from mmdet3d.core.bbox import LiDARInstance3DBoxes from mmdet3d.core.bbox import LiDARInstance3DBoxes
tmp_dir = tempfile.TemporaryDirectory() tmp_dir = tempfile.TemporaryDirectory()
temp_dir = tmp_dir.name temp_dir = tmp_dir.name
......
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