Unverified Commit b87e774f authored by lizz's avatar lizz Committed by GitHub
Browse files

Remove more unused things (#338)



* Remove more unused things
Signed-off-by: default avatarlizz <lizz@sensetime.com>

* panic
Signed-off-by: default avatarlizz <lizz@sensetime.com>
parent 5a98f7e4
......@@ -32,6 +32,7 @@ class BasicBlock(nn.Module):
style='pytorch',
with_cp=False):
super(BasicBlock, self).__init__()
assert style in ['pytorch', 'caffe']
self.conv1 = conv3x3(inplanes, planes, stride, dilation)
self.bn1 = nn.BatchNorm2d(planes)
self.relu = nn.ReLU(inplace=True)
......@@ -171,7 +172,7 @@ def make_res_layer(block,
style=style,
with_cp=with_cp))
inplanes = planes * block.expansion
for i in range(1, blocks):
for _ in range(1, blocks):
layers.append(
block(inplanes, planes, 1, dilation, style=style, with_cp=with_cp))
......
......@@ -141,7 +141,7 @@ class VGG(nn.Module):
def forward(self, x):
outs = []
vgg_layers = getattr(self, self.module_name)
for i, num_blocks in enumerate(self.stage_blocks):
for i in range(len(self.stage_blocks)):
for j in range(*self.range_sub_modules[i]):
vgg_layer = vgg_layers[j]
x = vgg_layer(x)
......
......@@ -33,7 +33,7 @@ def _init_dist_mpi(backend, **kwargs):
raise NotImplementedError
def _init_dist_slurm(backend, port=29500, **kwargs):
def _init_dist_slurm(backend, port=29500):
proc_id = int(os.environ['SLURM_PROCID'])
ntasks = int(os.environ['SLURM_NTASKS'])
node_list = os.environ['SLURM_NODELIST']
......
......@@ -8,8 +8,7 @@ class MomentumUpdaterHook(Hook):
by_epoch=True,
warmup=None,
warmup_iters=0,
warmup_ratio=0.9,
**kwargs):
warmup_ratio=0.9):
# validate the "warmup" argument
if warmup is not None:
if warmup not in ['constant', 'linear', 'exp']:
......
......@@ -175,7 +175,7 @@ def track_parallel_progress(func,
return results
def track_iter_progress(tasks, bar_width=50, file=sys.stdout, **kwargs):
def track_iter_progress(tasks, bar_width=50, file=sys.stdout):
"""Track the progress of tasks iteration or enumeration with a progress bar.
Tasks are yielded with a simple for-loop.
......
......@@ -58,8 +58,7 @@ def resize_video(in_file,
ratio=None,
keep_ar=False,
log_level='info',
print_cmd=False,
**kwargs):
print_cmd=False):
"""Resize a video.
Args:
......@@ -98,8 +97,7 @@ def cut_video(in_file,
vcodec=None,
acodec=None,
log_level='info',
print_cmd=False,
**kwargs):
print_cmd=False):
"""Cut a clip from a video.
Args:
......@@ -132,8 +130,7 @@ def concat_video(video_list,
vcodec=None,
acodec=None,
log_level='info',
print_cmd=False,
**kwargs):
print_cmd=False):
"""Concatenate multiple videos into a single one.
Args:
......
......@@ -33,7 +33,8 @@ class TestVideoEditor:
def test_resize_video(self):
out_file = osp.join(tempfile.gettempdir(), '.mmcv_test.mp4')
mmcv.resize_video(self.video_path, out_file, (200, 100), quiet=True)
mmcv.resize_video(
self.video_path, out_file, (200, 100), log_level='panic')
v = mmcv.VideoReader(out_file)
assert v.resolution == (200, 100)
os.remove(out_file)
......
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