From bdbf8cc8575ef01d749c5d9b3f9dc9ea9197b7ba Mon Sep 17 00:00:00 2001 From: xujinling Date: Wed, 15 Jun 2022 11:09:30 +0800 Subject: [PATCH] add pth Signed-off-by: xujinling --- .idea/workspace.xml | 39 ++++++++++++++++++++++++++++++++++ frozen_in_time.py | 8 ++++--- frozen_in_time_base_16_224.pth | 3 +++ 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 .idea/workspace.xml create mode 100644 frozen_in_time_base_16_224.pth diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..5f27234 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + 1655261997162 + + + + \ No newline at end of file diff --git a/frozen_in_time.py b/frozen_in_time.py index 35afa91..ac69ef9 100644 --- a/frozen_in_time.py +++ b/frozen_in_time.py @@ -50,6 +50,8 @@ class FrozenInTime(NNOperator): super().__init__() self.model_name = model_name self.modality = modality + if weight_path is None: + weight_path = os.path.join(str(Path(__file__).parent), 'frozen_in_time_base_16_224.pth') if device is None: self.device = "cuda" if torch.cuda.is_available() else "cpu" else: @@ -72,10 +74,10 @@ class FrozenInTime(NNOperator): self.tokenizer = AutoTokenizer.from_pretrained('distilbert-base-uncased', TOKENIZERS_PARALLELISM=False) self.transform_cfgs = get_configs( side_size=224, - crop_size=224, + crop_size=256, num_frames=self.num_frames, - mean=[0.48145466, 0.4578275, 0.40821073], - std=[0.26862954, 0.26130258, 0.27577711], + mean=[0.485, 0.456, 0.406], + std=[0.229, 0.224, 0.225], ) self.model.eval() diff --git a/frozen_in_time_base_16_224.pth b/frozen_in_time_base_16_224.pth new file mode 100644 index 0000000..ed3535f --- /dev/null +++ b/frozen_in_time_base_16_224.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:404b9c4cca1c3063fd245e6457a25fc2810b47e258c9703b492ba3d6ba9ba056 +size 723826931