From ed8f3f2210133e6a4cdd5c1ea7cbe5198c72ab0a Mon Sep 17 00:00:00 2001 From: Aditya Oke Date: Tue, 27 Apr 2021 23:53:40 +0530 Subject: [PATCH] remove unused imports --- torchvision/datasets/hmdb51.py | 1 - torchvision/datasets/ucf101.py | 1 - torchvision/datasets/voc.py | 1 - torchvision/io/_video_opt.py | 1 - torchvision/io/image.py | 1 - torchvision/io/video.py | 1 - torchvision/models/detection/faster_rcnn.py | 1 - torchvision/models/quantization/inception.py | 1 - torchvision/models/quantization/resnet.py | 3 +-- 9 files changed, 1 insertion(+), 10 deletions(-) diff --git a/torchvision/datasets/hmdb51.py b/torchvision/datasets/hmdb51.py index 113186b71b9..4912eb01600 100644 --- a/torchvision/datasets/hmdb51.py +++ b/torchvision/datasets/hmdb51.py @@ -1,7 +1,6 @@ import glob import os -from .utils import list_dir from .folder import find_classes, make_dataset from .video_utils import VideoClips from .vision import VisionDataset diff --git a/torchvision/datasets/ucf101.py b/torchvision/datasets/ucf101.py index 709151c2fcb..71f62257bcb 100644 --- a/torchvision/datasets/ucf101.py +++ b/torchvision/datasets/ucf101.py @@ -1,6 +1,5 @@ import os -from .utils import list_dir from .folder import find_classes, make_dataset from .video_utils import VideoClips from .vision import VisionDataset diff --git a/torchvision/datasets/voc.py b/torchvision/datasets/voc.py index c459dcb5c9e..56bd92c7972 100644 --- a/torchvision/datasets/voc.py +++ b/torchvision/datasets/voc.py @@ -1,5 +1,4 @@ import os -import tarfile import collections from .vision import VisionDataset from xml.etree.ElementTree import Element as ET_Element diff --git a/torchvision/io/_video_opt.py b/torchvision/io/_video_opt.py index e7d0494a250..4cc2b60c706 100644 --- a/torchvision/io/_video_opt.py +++ b/torchvision/io/_video_opt.py @@ -26,7 +26,6 @@ if os.name == 'nt': # Load the video_reader extension using LoadLibraryExW import ctypes - import sys kernel32 = ctypes.WinDLL('kernel32.dll', use_last_error=True) with_load_library_flags = hasattr(kernel32, 'AddDllDirectory') diff --git a/torchvision/io/image.py b/torchvision/io/image.py index e193555e447..8310c1eb273 100644 --- a/torchvision/io/image.py +++ b/torchvision/io/image.py @@ -22,7 +22,6 @@ if os.name == 'nt': # Load the image extension using LoadLibraryExW import ctypes - import sys kernel32 = ctypes.WinDLL('kernel32.dll', use_last_error=True) with_load_library_flags = hasattr(kernel32, 'AddDllDirectory') diff --git a/torchvision/io/video.py b/torchvision/io/video.py index 34a11826049..22cad38d10b 100644 --- a/torchvision/io/video.py +++ b/torchvision/io/video.py @@ -8,7 +8,6 @@ import torch from . import _video_opt -from ._video_opt import VideoMetaData try: diff --git a/torchvision/models/detection/faster_rcnn.py b/torchvision/models/detection/faster_rcnn.py index 6781c965d18..53100e54adb 100644 --- a/torchvision/models/detection/faster_rcnn.py +++ b/torchvision/models/detection/faster_rcnn.py @@ -1,4 +1,3 @@ -import torch from torch import nn import torch.nn.functional as F diff --git a/torchvision/models/quantization/inception.py b/torchvision/models/quantization/inception.py index efce265271f..1475cad5eb4 100644 --- a/torchvision/models/quantization/inception.py +++ b/torchvision/models/quantization/inception.py @@ -1,5 +1,4 @@ import warnings -from collections import namedtuple import torch import torch.nn as nn diff --git a/torchvision/models/quantization/resnet.py b/torchvision/models/quantization/resnet.py index c6a87c8c7d9..f5ac3d0a486 100644 --- a/torchvision/models/quantization/resnet.py +++ b/torchvision/models/quantization/resnet.py @@ -2,8 +2,7 @@ from torchvision.models.resnet import Bottleneck, BasicBlock, ResNet, model_urls import torch.nn as nn from torchvision.models.utils import load_state_dict_from_url -from torch.quantization import QuantStub, DeQuantStub, fuse_modules -from torch._jit_internal import Optional +from torch.quantization import fuse_modules from .utils import _replace_relu, quantize_model __all__ = ['QuantizableResNet', 'resnet18', 'resnet50',