Skip to content

Commit 08bb2cc

Browse files
author
KaiyangZhou
committed
linting and formatting code
1 parent b39e89a commit 08bb2cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+0
-117
lines changed

.style.yapf

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[style]
22
BASED_ON_STYLE = pep8
33
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = true
4-
BLANK_LINE_BEFORE_MODULE_DOCSTRING = true
5-
BLANK_LINE_BEFORE_CLASS_DOCSTRING = true
64
SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = true
75
DEDENT_CLOSING_BRACKETS = true
86
SPACES_BEFORE_COMMENT = 1

projects/OSNet_AIN/osnet_child.py

-12
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# Basic layers
88
##########
99
class ConvLayer(nn.Module):
10-
1110
"""Convolution layer (conv + bn + relu)."""
1211

1312
def __init__(
@@ -43,7 +42,6 @@ def forward(self, x):
4342

4443

4544
class Conv1x1(nn.Module):
46-
4745
"""1x1 convolution + bn + relu."""
4846

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

6866

6967
class Conv1x1Linear(nn.Module):
70-
7168
"""1x1 convolution + bn (w/o non-linearity)."""
7269

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

8885

8986
class Conv3x3(nn.Module):
90-
9187
"""3x3 convolution + bn + relu."""
9288

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

112108

113109
class LightConv3x3(nn.Module):
114-
115110
"""Lightweight 3x3 convolution.
116111
117112
1x1 (linear) + dw 3x3 (nonlinear).
@@ -142,7 +137,6 @@ def forward(self, x):
142137

143138

144139
class LightConvStream(nn.Module):
145-
146140
"""Lightweight convolution stream."""
147141

148142
def __init__(self, in_channels, out_channels, depth):
@@ -164,7 +158,6 @@ def forward(self, x):
164158
# Building blocks for omni-scale feature learning
165159
##########
166160
class ChannelGate(nn.Module):
167-
168161
"""A mini-network that generates channel-wise gates conditioned on input tensor."""
169162

170163
def __init__(
@@ -226,7 +219,6 @@ def forward(self, x):
226219

227220

228221
class OSBlock(nn.Module):
229-
230222
"""Omni-scale feature learning block."""
231223

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

261253

262254
class OSBlockINv1(nn.Module):
263-
264255
"""Omni-scale feature learning block with instance normalization."""
265256

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

297288

298289
class OSBlockINv2(nn.Module):
299-
300290
"""Omni-scale feature learning block with instance normalization."""
301291

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

333323

334324
class OSBlockINv3(nn.Module):
335-
336325
"""Omni-scale feature learning block with instance normalization."""
337326

338327
def __init__(self, in_channels, out_channels, reduction=4, T=4, **kwargs):
@@ -373,7 +362,6 @@ def forward(self, x):
373362
# Network architecture
374363
##########
375364
class OSNet(nn.Module):
376-
377365
"""Omni-Scale Network.
378366
379367
Reference:

projects/OSNet_AIN/osnet_search.py

-13
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# Basic layers
1212
##########
1313
class ConvLayer(nn.Module):
14-
1514
"""Convolution layer (conv + bn + relu)."""
1615

1716
def __init__(
@@ -47,7 +46,6 @@ def forward(self, x):
4746

4847

4948
class Conv1x1(nn.Module):
50-
5149
"""1x1 convolution + bn + relu."""
5250

5351
def __init__(
@@ -76,7 +74,6 @@ def forward(self, x):
7674

7775

7876
class Conv1x1Linear(nn.Module):
79-
8077
"""1x1 convolution + bn (w/o non-linearity)."""
8178

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

9794

9895
class Conv3x3(nn.Module):
99-
10096
"""3x3 convolution + bn + relu."""
10197

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

121117

122118
class LightConv3x3(nn.Module):
123-
124119
"""Lightweight 3x3 convolution.
125120
126121
1x1 (linear) + dw 3x3 (nonlinear).
@@ -151,7 +146,6 @@ def forward(self, x):
151146

152147

153148
class LightConvStream(nn.Module):
154-
155149
"""Lightweight convolution stream."""
156150

157151
def __init__(self, in_channels, out_channels, depth):
@@ -173,7 +167,6 @@ def forward(self, x):
173167
# Building blocks for omni-scale feature learning
174168
##########
175169
class ChannelGate(nn.Module):
176-
177170
"""A mini-network that generates channel-wise gates conditioned on input tensor."""
178171

179172
def __init__(
@@ -235,7 +228,6 @@ def forward(self, x):
235228

236229

237230
class OSBlock(nn.Module):
238-
239231
"""Omni-scale feature learning block."""
240232

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

270262

271263
class OSBlockINv1(nn.Module):
272-
273264
"""Omni-scale feature learning block with instance normalization."""
274265

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

306297

307298
class OSBlockINv2(nn.Module):
308-
309299
"""Omni-scale feature learning block with instance normalization."""
310300

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

342332

343333
class OSBlockINv3(nn.Module):
344-
345334
"""Omni-scale feature learning block with instance normalization."""
346335

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

380369

381370
class NASBlock(nn.Module):
382-
383371
"""Neural architecture search layer."""
384372

385373
def __init__(self, in_channels, out_channels, search_space=None):
@@ -425,7 +413,6 @@ def forward(self, x, lmda=1.):
425413
# Network architecture
426414
##########
427415
class OSNet(nn.Module):
428-
429416
"""Omni-Scale Network.
430417
431418
Reference:

torchreid/data/datamanager.py

-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
class DataManager(object):
10-
1110
r"""Base data manager.
1211
1312
Args:
@@ -87,7 +86,6 @@ def preprocess_pil_img(self, img):
8786

8887

8988
class ImageDataManager(DataManager):
90-
9189
r"""Image data manager.
9290
9391
Args:
@@ -330,7 +328,6 @@ def __init__(
330328

331329

332330
class VideoDataManager(DataManager):
333-
334331
r"""Video data manager.
335332
336333
Args:

torchreid/data/datasets/dataset.py

-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
class Dataset(object):
13-
1413
"""An abstract class representing a Dataset.
1514
1615
This is the base class for ``ImageDataset`` and ``VideoDataset``.
@@ -248,7 +247,6 @@ def __repr__(self):
248247

249248

250249
class ImageDataset(Dataset):
251-
252250
"""A base class representing ImageDataset.
253251
254252
All other image datasets should subclass it.
@@ -297,7 +295,6 @@ def show_summary(self):
297295

298296

299297
class VideoDataset(Dataset):
300-
301298
"""A base class representing VideoDataset.
302299
303300
All other video datasets should subclass it.

torchreid/data/datasets/image/cuhk01.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
class CUHK01(ImageDataset):
13-
1413
"""CUHK01.
1514
1615
Reference:

torchreid/data/datasets/image/cuhk02.py

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77

88
class CUHK02(ImageDataset):
9-
109
"""CUHK02.
1110
1211
Reference:

torchreid/data/datasets/image/cuhk03.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
class CUHK03(ImageDataset):
10-
1110
"""CUHK03.
1211
1312
Reference:

torchreid/data/datasets/image/dukemtmcreid.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
class DukeMTMCreID(ImageDataset):
10-
1110
"""DukeMTMC-reID.
1211
1312
Reference:

torchreid/data/datasets/image/grid.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111
class GRID(ImageDataset):
12-
1312
"""GRID.
1413
1514
Reference:

torchreid/data/datasets/image/ilids.py

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212

1313
class iLIDS(ImageDataset):
14-
1514
"""QMUL-iLIDS.
1615
1716
Reference:

torchreid/data/datasets/image/market1501.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
class Market1501(ImageDataset):
11-
1211
"""Market1501.
1312
1413
Reference:

torchreid/data/datasets/image/msmt17.py

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424

2525
class MSMT17(ImageDataset):
26-
2726
"""MSMT17.
2827
2928
Reference:

torchreid/data/datasets/image/prid.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
class PRID(ImageDataset):
11-
1211
"""PRID (single-shot version of prid-2011)
1312
1413
Reference:

torchreid/data/datasets/image/sensereid.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
class SenseReID(ImageDataset):
10-
1110
"""SenseReID.
1211
1312
This dataset is used for test purpose only.

torchreid/data/datasets/image/viper.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111
class VIPeR(ImageDataset):
12-
1312
"""VIPeR.
1413
1514
Reference:

torchreid/data/datasets/video/dukemtmcvidreid.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111
class DukeMTMCVidReID(VideoDataset):
12-
1312
"""DukeMTMCVidReID.
1413
1514
Reference:

torchreid/data/datasets/video/ilidsvid.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111
class iLIDSVID(VideoDataset):
12-
1312
"""iLIDS-VID.
1413
1514
Reference:

torchreid/data/datasets/video/mars.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
class Mars(VideoDataset):
10-
1110
"""MARS.
1211
1312
Reference:

torchreid/data/datasets/video/prid2011.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
class PRID2011(VideoDataset):
11-
1211
"""PRID2011.
1312
1413
Reference:

torchreid/data/sampler.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111
class RandomIdentitySampler(Sampler):
12-
1312
"""Randomly samples N identities each with K instances.
1413
1514
Args:

0 commit comments

Comments
 (0)