File size: 615 Bytes
e170a8e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
import numpy as np
import random
import torch

from .metrics import quat_degree_error, rotation_angular_error, translation_angular_error, error_auc
from .transform import rotation_matrix_from_ortho6d, rotation_matrix_from_quaternion
from .augment import Augmentor
# from .visualize import project_3D_points, plot_3D_box


def seed_torch(seed):
    random.seed(seed)
    os.environ['PYTHONHASHSEED'] = str(seed)
    np.random.seed(seed)
    torch.manual_seed(seed)
    torch.cuda.manual_seed(seed)
    torch.backends.cudnn.benchmark = False
    torch.backends.cudnn.deterministic = True