Skip to content

Commit

Permalink
linting and formatting code
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiyangZhou committed Dec 2, 2019
1 parent b39e89a commit 08bb2cc
Show file tree
Hide file tree
Showing 52 changed files with 0 additions and 117 deletions.
2 changes: 0 additions & 2 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[style]
BASED_ON_STYLE = pep8
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = true
BLANK_LINE_BEFORE_MODULE_DOCSTRING = true
BLANK_LINE_BEFORE_CLASS_DOCSTRING = true
SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = true
DEDENT_CLOSING_BRACKETS = true
SPACES_BEFORE_COMMENT = 1
Expand Down
12 changes: 0 additions & 12 deletions projects/OSNet_AIN/osnet_child.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# Basic layers
##########
class ConvLayer(nn.Module):

"""Convolution layer (conv + bn + relu)."""

def __init__(
Expand Down Expand Up @@ -43,7 +42,6 @@ def forward(self, x):


class Conv1x1(nn.Module):

"""1x1 convolution + bn + relu."""

def __init__(self, in_channels, out_channels, stride=1, groups=1):
Expand All @@ -67,7 +65,6 @@ def forward(self, x):


class Conv1x1Linear(nn.Module):

"""1x1 convolution + bn (w/o non-linearity)."""

def __init__(self, in_channels, out_channels, stride=1, bn=True):
Expand All @@ -87,7 +84,6 @@ def forward(self, x):


class Conv3x3(nn.Module):

"""3x3 convolution + bn + relu."""

def __init__(self, in_channels, out_channels, stride=1, groups=1):
Expand All @@ -111,7 +107,6 @@ def forward(self, x):


class LightConv3x3(nn.Module):

"""Lightweight 3x3 convolution.
1x1 (linear) + dw 3x3 (nonlinear).
Expand Down Expand Up @@ -142,7 +137,6 @@ def forward(self, x):


class LightConvStream(nn.Module):

"""Lightweight convolution stream."""

def __init__(self, in_channels, out_channels, depth):
Expand All @@ -164,7 +158,6 @@ def forward(self, x):
# Building blocks for omni-scale feature learning
##########
class ChannelGate(nn.Module):

"""A mini-network that generates channel-wise gates conditioned on input tensor."""

def __init__(
Expand Down Expand Up @@ -226,7 +219,6 @@ def forward(self, x):


class OSBlock(nn.Module):

"""Omni-scale feature learning block."""

def __init__(self, in_channels, out_channels, reduction=4, T=4, **kwargs):
Expand Down Expand Up @@ -260,7 +252,6 @@ def forward(self, x):


class OSBlockINv1(nn.Module):

"""Omni-scale feature learning block with instance normalization."""

def __init__(self, in_channels, out_channels, reduction=4, T=4, **kwargs):
Expand Down Expand Up @@ -296,7 +287,6 @@ def forward(self, x):


class OSBlockINv2(nn.Module):

"""Omni-scale feature learning block with instance normalization."""

def __init__(self, in_channels, out_channels, reduction=4, T=4, **kwargs):
Expand Down Expand Up @@ -332,7 +322,6 @@ def forward(self, x):


class OSBlockINv3(nn.Module):

"""Omni-scale feature learning block with instance normalization."""

def __init__(self, in_channels, out_channels, reduction=4, T=4, **kwargs):
Expand Down Expand Up @@ -373,7 +362,6 @@ def forward(self, x):
# Network architecture
##########
class OSNet(nn.Module):

"""Omni-Scale Network.
Reference:
Expand Down
13 changes: 0 additions & 13 deletions projects/OSNet_AIN/osnet_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# Basic layers
##########
class ConvLayer(nn.Module):

"""Convolution layer (conv + bn + relu)."""

def __init__(
Expand Down Expand Up @@ -47,7 +46,6 @@ def forward(self, x):


class Conv1x1(nn.Module):

"""1x1 convolution + bn + relu."""

def __init__(
Expand Down Expand Up @@ -76,7 +74,6 @@ def forward(self, x):


class Conv1x1Linear(nn.Module):

"""1x1 convolution + bn (w/o non-linearity)."""

def __init__(self, in_channels, out_channels, stride=1, bn=True):
Expand All @@ -96,7 +93,6 @@ def forward(self, x):


class Conv3x3(nn.Module):

"""3x3 convolution + bn + relu."""

def __init__(self, in_channels, out_channels, stride=1, groups=1):
Expand All @@ -120,7 +116,6 @@ def forward(self, x):


class LightConv3x3(nn.Module):

"""Lightweight 3x3 convolution.
1x1 (linear) + dw 3x3 (nonlinear).
Expand Down Expand Up @@ -151,7 +146,6 @@ def forward(self, x):


class LightConvStream(nn.Module):

"""Lightweight convolution stream."""

def __init__(self, in_channels, out_channels, depth):
Expand All @@ -173,7 +167,6 @@ def forward(self, x):
# Building blocks for omni-scale feature learning
##########
class ChannelGate(nn.Module):

"""A mini-network that generates channel-wise gates conditioned on input tensor."""

def __init__(
Expand Down Expand Up @@ -235,7 +228,6 @@ def forward(self, x):


class OSBlock(nn.Module):

"""Omni-scale feature learning block."""

def __init__(self, in_channels, out_channels, reduction=4, T=4, **kwargs):
Expand Down Expand Up @@ -269,7 +261,6 @@ def forward(self, x):


class OSBlockINv1(nn.Module):

"""Omni-scale feature learning block with instance normalization."""

def __init__(self, in_channels, out_channels, reduction=4, T=4, **kwargs):
Expand Down Expand Up @@ -305,7 +296,6 @@ def forward(self, x):


class OSBlockINv2(nn.Module):

"""Omni-scale feature learning block with instance normalization."""

def __init__(self, in_channels, out_channels, reduction=4, T=4, **kwargs):
Expand Down Expand Up @@ -341,7 +331,6 @@ def forward(self, x):


class OSBlockINv3(nn.Module):

"""Omni-scale feature learning block with instance normalization."""

def __init__(self, in_channels, out_channels, reduction=4, T=4, **kwargs):
Expand Down Expand Up @@ -379,7 +368,6 @@ def forward(self, x):


class NASBlock(nn.Module):

"""Neural architecture search layer."""

def __init__(self, in_channels, out_channels, search_space=None):
Expand Down Expand Up @@ -425,7 +413,6 @@ def forward(self, x, lmda=1.):
# Network architecture
##########
class OSNet(nn.Module):

"""Omni-Scale Network.
Reference:
Expand Down
3 changes: 0 additions & 3 deletions torchreid/data/datamanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class DataManager(object):

r"""Base data manager.
Args:
Expand Down Expand Up @@ -87,7 +86,6 @@ def preprocess_pil_img(self, img):


class ImageDataManager(DataManager):

r"""Image data manager.
Args:
Expand Down Expand Up @@ -330,7 +328,6 @@ def __init__(


class VideoDataManager(DataManager):

r"""Video data manager.
Args:
Expand Down
3 changes: 0 additions & 3 deletions torchreid/data/datasets/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class Dataset(object):

"""An abstract class representing a Dataset.
This is the base class for ``ImageDataset`` and ``VideoDataset``.
Expand Down Expand Up @@ -248,7 +247,6 @@ def __repr__(self):


class ImageDataset(Dataset):

"""A base class representing ImageDataset.
All other image datasets should subclass it.
Expand Down Expand Up @@ -297,7 +295,6 @@ def show_summary(self):


class VideoDataset(Dataset):

"""A base class representing VideoDataset.
All other video datasets should subclass it.
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/image/cuhk01.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class CUHK01(ImageDataset):

"""CUHK01.
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/image/cuhk02.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class CUHK02(ImageDataset):

"""CUHK02.
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/image/cuhk03.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class CUHK03(ImageDataset):

"""CUHK03.
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/image/dukemtmcreid.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class DukeMTMCreID(ImageDataset):

"""DukeMTMC-reID.
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/image/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class GRID(ImageDataset):

"""GRID.
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/image/ilids.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class iLIDS(ImageDataset):

"""QMUL-iLIDS.
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/image/market1501.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class Market1501(ImageDataset):

"""Market1501.
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/image/msmt17.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@


class MSMT17(ImageDataset):

"""MSMT17.
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/image/prid.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class PRID(ImageDataset):

"""PRID (single-shot version of prid-2011)
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/image/sensereid.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class SenseReID(ImageDataset):

"""SenseReID.
This dataset is used for test purpose only.
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/image/viper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class VIPeR(ImageDataset):

"""VIPeR.
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/video/dukemtmcvidreid.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class DukeMTMCVidReID(VideoDataset):

"""DukeMTMCVidReID.
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/video/ilidsvid.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class iLIDSVID(VideoDataset):

"""iLIDS-VID.
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/video/mars.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class Mars(VideoDataset):

"""MARS.
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/datasets/video/prid2011.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class PRID2011(VideoDataset):

"""PRID2011.
Reference:
Expand Down
1 change: 0 additions & 1 deletion torchreid/data/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class RandomIdentitySampler(Sampler):

"""Randomly samples N identities each with K instances.
Args:
Expand Down
Loading

0 comments on commit 08bb2cc

Please sign in to comment.