chore(pipe): Update image-to-3d model loading position. (#26)
Update image-to-3d model loading position. --------- Co-authored-by: xinjie.wang <xinjie.wang@gpu-4090-dev015.hogpu.cc>
This commit is contained in:
parent
e82f02a9a5
commit
87ff24dbd4
@ -30,11 +30,7 @@ from embodied_gen.data.backproject_v2 import entrypoint as backproject_api
|
||||
from embodied_gen.data.utils import delete_dir, trellis_preprocess
|
||||
from embodied_gen.models.delight_model import DelightingModel
|
||||
from embodied_gen.models.gs_model import GaussianOperator
|
||||
from embodied_gen.models.segment_model import (
|
||||
BMGG14Remover,
|
||||
RembgRemover,
|
||||
SAMPredictor,
|
||||
)
|
||||
from embodied_gen.models.segment_model import RembgRemover
|
||||
from embodied_gen.models.sr_model import ImageRealESRGAN
|
||||
from embodied_gen.scripts.render_gs import entrypoint as render_gs_api
|
||||
from embodied_gen.utils.gpt_clients import GPT_CLIENT
|
||||
@ -62,6 +58,19 @@ os.environ["GRADIO_ANALYTICS_ENABLED"] = "false"
|
||||
os.environ["SPCONV_ALGO"] = "native"
|
||||
random.seed(0)
|
||||
|
||||
logger.info("Loading Models...")
|
||||
DELIGHT = DelightingModel()
|
||||
IMAGESR_MODEL = ImageRealESRGAN(outscale=4)
|
||||
RBG_REMOVER = RembgRemover()
|
||||
PIPELINE = TrellisImageTo3DPipeline.from_pretrained(
|
||||
"microsoft/TRELLIS-image-large"
|
||||
)
|
||||
# PIPELINE.cuda()
|
||||
SEG_CHECKER = ImageSegChecker(GPT_CLIENT)
|
||||
GEO_CHECKER = MeshGeoChecker(GPT_CLIENT)
|
||||
AESTHETIC_CHECKER = ImageAestheticChecker()
|
||||
CHECKERS = [GEO_CHECKER, SEG_CHECKER, AESTHETIC_CHECKER]
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description="Image to 3D pipeline args.")
|
||||
@ -109,19 +118,6 @@ def entrypoint(**kwargs):
|
||||
if hasattr(args, k) and v is not None:
|
||||
setattr(args, k, v)
|
||||
|
||||
logger.info("Loading Models...")
|
||||
DELIGHT = DelightingModel()
|
||||
IMAGESR_MODEL = ImageRealESRGAN(outscale=4)
|
||||
RBG_REMOVER = RembgRemover()
|
||||
PIPELINE = TrellisImageTo3DPipeline.from_pretrained(
|
||||
"microsoft/TRELLIS-image-large"
|
||||
)
|
||||
# PIPELINE.cuda()
|
||||
SEG_CHECKER = ImageSegChecker(GPT_CLIENT)
|
||||
GEO_CHECKER = MeshGeoChecker(GPT_CLIENT)
|
||||
AESTHETIC_CHECKER = ImageAestheticChecker()
|
||||
CHECKERS = [GEO_CHECKER, SEG_CHECKER, AESTHETIC_CHECKER]
|
||||
|
||||
assert (
|
||||
args.image_path or args.image_root
|
||||
), "Please provide either --image_path or --image_root."
|
||||
|
||||
@ -3,23 +3,6 @@ set -e
|
||||
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
source "$SCRIPT_DIR/_utils.sh"
|
||||
|
||||
# try_install "Installing txt2panoimg..." \
|
||||
# "pip install txt2panoimg@git+https://github.com/HochCC/SD-T2I-360PanoImage --no-deps" \
|
||||
# "txt2panoimg installation failed."
|
||||
|
||||
# try_install "Installing fused-ssim..." \
|
||||
# "pip install fused-ssim@git+https://github.com/rahul-goel/fused-ssim#egg=328dc98" \
|
||||
# "fused-ssim installation failed."
|
||||
|
||||
# try_install "Installing tiny-cuda-nn..." \
|
||||
# "pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch" \
|
||||
# "tiny-cuda-nn installation failed."
|
||||
|
||||
# try_install "Installing pytorch3d" \
|
||||
# "pip install git+https://github.com/facebookresearch/pytorch3d.git@v0.7.7" \
|
||||
# "pytorch3d installation failed."
|
||||
|
||||
|
||||
PYTHON_PACKAGES_NODEPS=(
|
||||
timm
|
||||
txt2panoimg@git+https://github.com/HochCC/SD-T2I-360PanoImage
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user