-
Notifications
You must be signed in to change notification settings - Fork 8
/
test.py
33 lines (30 loc) · 1.01 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from __future__ import absolute_import, division, print_function
import os
os.environ["OMP_NUM_THREADS"] = "1" # export OMP_NUM_THREADS=4
os.environ["OPENBLAS_NUM_THREADS"] = "1" # export OPENBLAS_NUM_THREADS=4
os.environ["MKL_NUM_THREADS"] = "1" # export MKL_NUM_THREADS=6
os.environ["VECLIB_MAXIMUM_THREADS"] = "1" # export VECLIB_MAXIMUM_THREADS=4
os.environ["NUMEXPR_NUM_THREADS"] = "1" # export NUMEXPR_NUM_THREADS=6
from test_dev import TESTER
from options import MonodepthOptions
options = MonodepthOptions()
opts = options.parse()
import cv2
import torch
import random
import numpy as np
from PIL import Image
seed = opts.seed
# Set the random seed for Python's random module
random.seed(seed)
# Set the random seed for Numpy
np.random.seed(seed)
# Set the random seed for PyTorch
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
if __name__ == "__main__":
tester = TESTER(opts)
tester.test()