File size: 916 Bytes
b579854
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from transformers import AutoProcessor
from .modeling import LRMGenerator, LRMGeneratorConfig

import logging

# we set up logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

# helper function to install packages
def install_package(package_name):
    if importlib.util.find_spec(package_name) is None:
        logger.info(f"Package '{package_name}' not found. Installing...")
        print(f"Package '{package_name}' not found. Installing...")
        subprocess.check_call([sys.executable, "-m", "pip", "install", package_name])
    else:
        logger.info(f"Package '{package_name}' is already installed.")

# list of packages to ensure are installed
required_packages = [
    'imageio[ffmpeg]', 'PyMCubes', 'trimesh', 'rembg[gpu,cli]', 'kiui', 'torchvision', 'Pillow'
]

for package in required_packages:
    install_package(package)

from .processor import LRMImageProcessor