This commit is contained in:
rmaphoh
2023-01-31 00:47:18 +00:00
parent 7da646d63c
commit ad280cbf1f
9 changed files with 11 additions and 57 deletions
+2 -2
View File
@@ -40,11 +40,11 @@ pip install -r requirement.txt
<th valign="bottom">ViT-Large</th> <th valign="bottom">ViT-Large</th>
<!-- TABLE BODY --> <!-- TABLE BODY -->
<tr><td align="left">Colour fundus image</td> <tr><td align="left">Colour fundus image</td>
<td align="center"><a href="https://dl.fbaipublicfiles.com/mae/pretrain/mae_pretrain_vit_large.pth">download</a></td> <td align="center"><a href="https://drive.google.com/file/d/1l62zbWUFTlp214SvK6eMwPQZAzcwoeBE/view?usp=sharing">download</a></td>
</tr> </tr>
<!-- TABLE BODY --> <!-- TABLE BODY -->
<tr><td align="left">OCT</td> <tr><td align="left">OCT</td>
<td align="center"><a href="https://dl.fbaipublicfiles.com/mae/pretrain/mae_pretrain_vit_large.pth">download</a></td> <td align="center"><a href="https://drive.google.com/file/d/1m6s7QYkjyjJDlpEuXm7Xp3PmjN-elfW2/view?usp=sharing">download</a></td>
</tr> </tr>
</tbody></table> </tbody></table>
+1 -7
View File
@@ -1,12 +1,6 @@
# Copyright (c) Meta Platforms, Inc. and affiliates. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# Partly revised by YZ @UCL&Moorfields
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# --------------------------------------------------------
# References:
# DeiT: https://github.com/facebookresearch/deit
# BEiT: https://github.com/microsoft/unilm/tree/master/beit
# -------------------------------------------------------- # --------------------------------------------------------
import math import math
+1 -12
View File
@@ -1,12 +1,6 @@
# Copyright (c) Meta Platforms, Inc. and affiliates. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# Partly revised by YZ @UCL&Moorfields
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# --------------------------------------------------------
# References:
# DeiT: https://github.com/facebookresearch/deit
# BEiT: https://github.com/microsoft/unilm/tree/master/beit
# -------------------------------------------------------- # --------------------------------------------------------
import argparse import argparse
@@ -203,11 +197,6 @@ def main(args):
else: else:
sampler_test = torch.utils.data.SequentialSampler(dataset_test) sampler_test = torch.utils.data.SequentialSampler(dataset_test)
else:
sampler_train = torch.utils.data.RandomSampler(dataset_train)
sampler_val = torch.utils.data.SequentialSampler(dataset_val)
sampler_test = torch.utils.data.SequentialSampler(dataset_test)
if global_rank == 0 and args.log_dir is not None and not args.eval: if global_rank == 0 and args.log_dir is not None and not args.eval:
os.makedirs(args.log_dir, exist_ok=True) os.makedirs(args.log_dir, exist_ok=True)
+1 -7
View File
@@ -1,12 +1,6 @@
# Copyright (c) Meta Platforms, Inc. and affiliates. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# Partly revised by YZ @UCL&Moorfields
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# --------------------------------------------------------
# References:
# timm: https://github.com/rwightman/pytorch-image-models/tree/master/timm
# DeiT: https://github.com/facebookresearch/deit
# -------------------------------------------------------- # --------------------------------------------------------
from functools import partial from functools import partial
+1 -7
View File
@@ -1,15 +1,9 @@
# Copyright (c) Meta Platforms, Inc. and affiliates. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# Partly revised by YZ @UCL&Moorfields
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# --------------------------------------------------------
# References:
# DeiT: https://github.com/facebookresearch/deit
# -------------------------------------------------------- # --------------------------------------------------------
import os import os
import PIL
from torchvision import datasets, transforms from torchvision import datasets, transforms
from timm.data import create_transform from timm.data import create_transform
from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
+1 -7
View File
@@ -1,12 +1,6 @@
# Copyright (c) Meta Platforms, Inc. and affiliates. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# Partly revised by YZ @UCL&Moorfields
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# --------------------------------------------------------
# References:
# ELECTRA https://github.com/google-research/electra
# BEiT: https://github.com/microsoft/unilm/tree/master/beit
# -------------------------------------------------------- # --------------------------------------------------------
import json import json
+2 -3
View File
@@ -1,8 +1,7 @@
# Copyright (c) Meta Platforms, Inc. and affiliates. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# Partly revised by YZ @UCL&Moorfields
# This source code is licensed under the license found in the # --------------------------------------------------------
# LICENSE file in the root directory of this source tree.
import math import math
+1 -7
View File
@@ -1,12 +1,6 @@
# Copyright (c) Meta Platforms, Inc. and affiliates. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# Partly revised by YZ @UCL&Moorfields
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# --------------------------------------------------------
# References:
# DeiT: https://github.com/facebookresearch/deit
# BEiT: https://github.com/microsoft/unilm/tree/master/beit
# -------------------------------------------------------- # --------------------------------------------------------
import builtins import builtins
+1 -5
View File
@@ -1,10 +1,6 @@
# Copyright (c) Meta Platforms, Inc. and affiliates. # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved. # All rights reserved.
# Partly revised by YZ @UCL&Moorfields
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# --------------------------------------------------------
# Position embedding utils
# -------------------------------------------------------- # --------------------------------------------------------
import numpy as np import numpy as np