From d1dbde7cb363c3ba9b0fef6819cd080f236c56a4 Mon Sep 17 00:00:00 2001 From: KaiyangZhou Date: Mon, 23 Apr 2018 10:21:26 +0100 Subject: [PATCH] rm blank space --- dataset_loader.py | 8 +------- models/MuDeep.py | 8 +------- models/ResNet.py | 3 +-- train_img_model_cent.py | 9 +-------- train_img_model_xent.py | 9 +-------- train_img_model_xent_htri.py | 9 +-------- train_vid_model_xent.py | 9 +-------- train_vid_model_xent_htri.py | 9 +-------- transforms.py | 2 +- utils.py | 10 +--------- 10 files changed, 10 insertions(+), 66 deletions(-) diff --git a/dataset_loader.py b/dataset_loader.py index 7388ded..e3ae872 100755 --- a/dataset_loader.py +++ b/dataset_loader.py @@ -96,10 +96,4 @@ class VideoDataset(Dataset): imgs.append(img) imgs = torch.cat(imgs, dim=0) - return imgs, pid, camid - - - - - - + return imgs, pid, camid \ No newline at end of file diff --git a/models/MuDeep.py b/models/MuDeep.py index e9ea6ba..d9f10f2 100644 --- a/models/MuDeep.py +++ b/models/MuDeep.py @@ -182,10 +182,4 @@ class MuDeep(nn.Module): elif self.loss == {'cent'}: return y, x else: - raise KeyError("Unsupported loss: {}".format(self.loss)) - - - - - - + raise KeyError("Unsupported loss: {}".format(self.loss)) \ No newline at end of file diff --git a/models/ResNet.py b/models/ResNet.py index 0b3d844..415c376 100755 --- a/models/ResNet.py +++ b/models/ResNet.py @@ -85,5 +85,4 @@ class ResNet50M(nn.Module): elif self.loss == {'cent'}: return prelogits, combofeat else: - raise KeyError("Unsupported loss: {}".format(self.loss)) - + raise KeyError("Unsupported loss: {}".format(self.loss)) \ No newline at end of file diff --git a/train_img_model_cent.py b/train_img_model_cent.py index bd059d2..365685f 100644 --- a/train_img_model_cent.py +++ b/train_img_model_cent.py @@ -262,11 +262,4 @@ def test(model, queryloader, galleryloader, use_gpu, ranks=[1, 5, 10, 20]): return cmc[0] if __name__ == '__main__': - main() - - - - - - - + main() \ No newline at end of file diff --git a/train_img_model_xent.py b/train_img_model_xent.py index a3a0843..f1b7671 100755 --- a/train_img_model_xent.py +++ b/train_img_model_xent.py @@ -248,11 +248,4 @@ def test(model, queryloader, galleryloader, use_gpu, ranks=[1, 5, 10, 20]): return cmc[0] if __name__ == '__main__': - main() - - - - - - - + main() \ No newline at end of file diff --git a/train_img_model_xent_htri.py b/train_img_model_xent_htri.py index 4ce30f0..208edb2 100755 --- a/train_img_model_xent_htri.py +++ b/train_img_model_xent_htri.py @@ -264,11 +264,4 @@ def test(model, queryloader, galleryloader, use_gpu, ranks=[1, 5, 10, 20]): return cmc[0] if __name__ == '__main__': - main() - - - - - - - + main() \ No newline at end of file diff --git a/train_vid_model_xent.py b/train_vid_model_xent.py index 91efd95..b9aa5e4 100755 --- a/train_vid_model_xent.py +++ b/train_vid_model_xent.py @@ -266,11 +266,4 @@ def test(model, queryloader, galleryloader, pool, use_gpu, ranks=[1, 5, 10, 20]) return cmc[0] if __name__ == '__main__': - main() - - - - - - - + main() \ No newline at end of file diff --git a/train_vid_model_xent_htri.py b/train_vid_model_xent_htri.py index beae0db..00d4081 100755 --- a/train_vid_model_xent_htri.py +++ b/train_vid_model_xent_htri.py @@ -282,11 +282,4 @@ def test(model, queryloader, galleryloader, pool, use_gpu, ranks=[1, 5, 10, 20]) return cmc[0] if __name__ == '__main__': - main() - - - - - - - + main() \ No newline at end of file diff --git a/transforms.py b/transforms.py index 3e96c2c..ec1dfb3 100755 --- a/transforms.py +++ b/transforms.py @@ -40,4 +40,4 @@ class Random2DTranslation(object): return croped_img if __name__ == '__main__': - pass + pass \ No newline at end of file diff --git a/utils.py b/utils.py index e67042d..08c84b4 100755 --- a/utils.py +++ b/utils.py @@ -87,12 +87,4 @@ def read_json(fpath): def write_json(obj, fpath): mkdir_if_missing(osp.dirname(fpath)) with open(fpath, 'w') as f: - json.dump(obj, f, indent=4, separators=(',', ': ')) - - - - - - - - + json.dump(obj, f, indent=4, separators=(',', ': ')) \ No newline at end of file