服务热线

  13816536734

  公司邮箱

  479498864@qq.com

     名片二维码

   

AI在3D建模领域重大进展,文字和图片直接生成3D模型,动了职场哪部分人的蛋糕

发布日期:2023-06-16 10:46:25   作者 :共建者    浏览量 :361
共建者 发布日期:2023-06-16 10:46:25  
361

文本生成图片和图片生成图片已经逐渐取代绘画师和设计师了,你有没有想过有一天文字和图片还可以生成3D模型?科技的发展只有我们想不到,没有AI做不到。那么对3d模型领域又会有哪些影响呢?手把手硬核AI教学,赶快收藏学习。


一、文本生成3d模型


3D建模在电影、游戏、工程模拟等领域有着非常广泛的应用,也是VR和AR应用的基础。但是建模的时间和成本都是比较高的,制作也需要一定的专业知识,比如使用特定的3D编辑软件或者专门的扫描设备,但是现在AI的发展基本磨平了普通人和专业人士的差距,让普通人在专业领域也能轻松达到了60分的水平。

text to 3d(文本生成3d)image to 3d(图片生成3d)方向比较成熟应用的有自动生成3D模型的AI应用,例如如下这个网站,可以根据图片和文字生成180度的2.5D模型

而真正目前text to 3d比较成熟的开源框架是OpenAI发布的shap-e开源模型,不仅能根据文本和图片来生成3d动画效果,而且还可以把生成的3d模型导出到3d编辑软件里进行编辑。

OpenAI Shap-e手把手硬核步骤教学

一、Shap-e介绍


github项目地址:

https://github.com/openai/shap-e



二、colab上部署Shap-e 复制并打开自动执行脚本:


https://colab.research.google.com/drive/1XvXBALiOwAT5-OaAD7AygqBXFqTijrVf?usp=sharing#scrollTo=7-fLWame0qJw

按执行步骤一步步执行

三、参数修改

batch_size  = 生成的数量

guidance_scale = 分辨率

prompt = 生成内容指令



四、文件下载并使用编辑器进行编辑使用

在左侧文件夹里找到生成的文件并下载使用3d编辑器即可对模型进行修改编辑


OpenAI发布的shap-e开源模型。

这就结束了?更炸裂的来了,接下来手把手演示如果通过图片提示来生成3D动画效果,上车出发

二、图片生成3d模型


面三个步骤不变无脑执行下去,在第四个执行代码里将内容换成

请直接复制








import torch
from shap_e.diffusion.sample import sample_latentsfrom shap_e.diffusion.gaussian_diffusion import diffusion_from_configfrom shap_e.models.download import load_model, load_configfrom shap_e.util.notebooks import create_pan_cameras, decode_latent_images, gif_widgetfrom shap_e.util.image_util import load_image


接下来找到第六步更改模型,替换图片解析模型

无脑复制代码




xm = load_model('transmitter', device=device)model = load_model('image300M', device=device)diffusion = diffusion_from_config(load_config('diffusion'))


别急,快看到终点了

准备一张图片上传到content文件夹里,图片格式.png .jpg

粘贴第四段代码到标注处

继续无脑复制如下代码






















batch_size = 4guidance_scale = 3.0
# To get the best result, you should remove the background and show only the object of interest to the model.image = load_image("example_data/corgi.png")
latents = sample_latents(    batch_size=batch_size,    model=model,    diffusion=diffusion,    guidance_scale=guidance_scale,    model_kwargs=dict(images=[image] * batch_size),    progress=True,    clip_denoised=True,    use_fp16=True,    use_karras=True,    karras_steps=64,    sigma_min=1e-3,    sigma_max=160,    s_churn=0,)

修改参数




batch_size  = 生成的数量guidance_scale = 分辨率img = 图片保存路径


别走,最后一步老铁









复制如下代码到最后一步render_mode = 'nerf' # you can change this to 'stf' for mesh renderingsize = 64 # this is the size of the renders; higher values take longer to render.
cameras = create_pan_cameras(size, device)for i, latent in enumerate(latents):    images = decode_latent_images(xm, latent, cameras, rendering_mode=render_mode)    display(gif_widget(images))

别忧虑点击执行,就会得到image to 3d模型了,照常按着以上步骤去编辑吧


just do it!


模型
图片
E
images
联系我们
QQ:
邮箱:
地址:
赋能中小微企业,我有资源/需求
479498864
上海市浦东新区东方路738号裕安大厦3F-R033
电话:
13918330748
云计算支持 反馈 枢纽云管理
回到顶部