add TestDataset to datasets.py
This commit is contained in:
1 parent
2c7c2158c4
commit
8b2258a63c
2 files changed
+44
-13
No files matched your search
+23
-13
@@ -5,20 +5,30 @@ from train import load_config
|
||||
import torch
|
||||
|
||||
|
||||
# load config
|
||||
config = load_config()
|
||||
def predict():
|
||||
# load config
|
||||
config = load_config()
|
||||
|
||||
# load model from checkpoint
|
||||
pretrained_model = LitModel.load_from_checkpoint("example.ckpt", config=config)
|
||||
pretrained_model.eval()
|
||||
# load model from checkpoint
|
||||
pretrained_model = LitModel.load_from_checkpoint("example.ckpt", config=config["hparams"])
|
||||
pretrained_model.eval()
|
||||
|
||||
# load data
|
||||
img = None
|
||||
# load data
|
||||
img = None
|
||||
|
||||
# preprocess
|
||||
img = transforms.efficient_net_test_preprocess(img)
|
||||
img = img.reshape((1, *img.size())) # reshape to form batch of size 1
|
||||
# preprocess
|
||||
img = transforms.efficient_net_test_preprocess(img)
|
||||
img = img.reshape((1, *img.size())) # reshape to form batch of size 1
|
||||
|
||||
# inference
|
||||
output = pretrained_model(img)
|
||||
print(output)
|
||||
# inference
|
||||
output = pretrained_model(img)
|
||||
print(output)
|
||||
|
||||
|
||||
def download_from_wanb():
|
||||
MODEL_PATH = ""
|
||||
CODE_PATH = ""
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
predict()
|
||||
Reference in new issue
Block a user