forked from irfanICMLL/structure_knowledge_distillation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
14 lines (13 loc) · 754 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from torch.utils import data
from networks.pspnet_combine import Res_pspnet, BasicBlock, Bottleneck
from networks.evaluate import evaluate_main
from dataset.datasets import CSDataTestSet
from utils.train_options import TrainOptionsForTest
import torch
if __name__ == '__main__':
args = TrainOptionsForTest().initialize()
testloader = data.DataLoader(CSDataTestSet(args.data_dir, './dataset/list/cityscapes/test.lst', crop_size=(1024, 2048)),
batch_size=1, shuffle=False, pin_memory=True)
student = Res_pspnet(BasicBlock, [2, 2, 2, 2], num_classes = 19)
student.load_state_dict(torch.load(args.resume_from))
evaluate_main(student, testloader, '0', '512,512', 19, True, type = 'test')