Closed EricKani closed 3 years ago
These weights are part of timm. If you only want the backbone:
import timm
model = timm.create_model("vit_large_patch16_384"", pretrained=True)
See https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py for a list of models.
If you want to initialize DPT with ImageNet weights in the encoder and random initialization in the decoder:
1) Set this line to True: https://github.com/isl-org/DPT/blob/f43ef9e08d70a752195028a51be5e1aff227b913/dpt/models.py#L52
2) Instantiate a DPT model with path=None
. Example:
model = DPTDepthModel(
path=None,
backbone="vitl16_384",
non_negative=True,
enable_attention_hooks=False)
Got it! Thanks a lot for your detailed reply! Best
Could you share the weights of encoder pretrained on imagenet? Thanks~