文生图-text2light-环境搭建

Text2Light主要目标是生成室内和室外的全景图,没有人。生成的图片光线比较’暗,T4上每次生成需要3分钟以上。

1.安装conda

!wget https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh && bash Anaconda3-2022.10-Linux-x86_64.sh

2.创建并激活虚拟环境

!/root/anaconda3/bin/conda env create -f /content/Text2Light/environment.yml
!/root/anaconda3/bin/conda activate text2light #若base没有激活会失败

3. 激活base

!conda init bash
!source activate

4. 进入虚拟环境

#若环境安装失败

!sudo apt-get install libomp-dev
!pip install ftfy regex tqdm omegaconf pytorch-lightning tensorboardX einops transformers
!pip install kornia
!pip install imageio-ffmpeg
!pip install faiss
!pip install opencv-python==4.1.2.30

5. 若cv2启动失败

!apt-get update
!apt-get install libsm6
!apt-get install libxrender1
!apt-get install libxext-dev

6. 终于可以执行命令了

!python text2light.py -h

7.下载预训练模型到logs目录下(https://drive.google.com/drive/folders/1HKBjC7oQOzrkGFKMQmSh6PySv6AycDS3?usp=sharinghttps://drive.google.com/drive/folders/1HKBjC7oQOzrkGFKMQmSh6PySv6AycDS3?usp=sharing

8. 可以愉快的生成了

python text2light.py -rg logs/global_sampler_clip -rl logs/local_sampler_outdoor --outdir ./generated_panorama --text "YOUR SCENE DESCRIPTION" --clip clip_emb.npy --sritmo ./logs/sritmo.pth --sr_factor 4

猜你喜欢

转载自blog.csdn.net/wxl781227/article/details/131635151
今日推荐