File size: 666 Bytes
8813b45
dd5adff
19b8852
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from .hoho import *
from . import vis
from . import read_write_colmap

import importlib
import sys
class LazyLoadModule:
    def __init__(self, module_name):
        self.module_name = module_name
        self.module = None

    def __getattribute__(self, attr):
        if attr == 'module_name' or attr == 'module':
            return super().__getattribute__(attr)

        if self.module is None:
            self.module = importlib.import_module(f'hoho.{self.module_name}')
            sys.modules[self.module_name] = self.module

        return getattr(self.module, attr)
    
print('hi')
vis = LazyLoadModule('vis')
viz3d = LazyLoadModule('viz3d')
print(viz3d)