#nct西珍妮[超话]# 出 走pt 懂包装 有小礼物
香奈儿娜 日比耶单封娜 wb娜闪 冬专灿
黄衣灿 比耶灿罗渽民 大队sw娜 直播卡娜 爱宝门票娜 src娜 七周年红酒杯娜 byl id卡娜 餐盘娜 杯垫娜 挡板娜 高脚杯 展会拍立得娜 徽章娜 戳脸娜 fm入场娜 玩偶娜 srp娜 k4p娜 kms签售v3v1娜 应援棒贴纸娜 Candy随机娜sw娜 kmsp娜 台历娜 nct dream 划钓 jaemin istj 李马克make 黄仁俊renjun 李帝努 李楷灿 罗渽民 钟辰乐 朴志晟nct 127 dream 白菜价 李楷灿 李马克 钟辰乐 李泰容 金道英 金廷祐 朴志晟 DVD灿 gm glitch mode mumo灿 sticker owhat灿 istj wm6.0灿 favorite马闪 西装马闪 istj满额灿 sticker卡车马 台历阿拉丁马灿 崎玉游戏卡马 电影卡灿 红发灿大队mumo乐 大队日专乐 candy贴纸诺set bfe娜 爱宝星 湖人钥匙扣马闪 首巡容闪 返校貂 英雄t貂 大队mumo kun

#nct西珍妮[超话]# 出出出 走平台 可以预留 可
90半包 130包邮
nct 127 dream 白菜价 李楷灿 李马克 钟辰乐 李泰容 金道英 金廷祐 朴志晟 DVD灿 gm glitch mode mumo灿 sticker owhat灿 istj wm6.0灿 favorite马闪 西装马闪 istj满额灿 sticker卡车马 台历阿拉丁马灿 崎玉游戏卡马 电影卡灿 红发灿大队mumo乐 大队日专乐 candy贴纸诺set bfe娜 爱宝星 湖人钥匙扣马闪 首巡容闪 返校貂 英雄t貂 大队mumo kun

refer to the following Colab python code,
write a new Colab python code for request :
user import Three View or Multiview orthographic projection image png jpg etc file, loading image to produce 3D cloud point,
write the results on .obj file

! pip install plotly -q

!git clone https://t.cn/A6KTcqVE

%cd shap-e
!pip install -e .

!git clone https://t.cn/A6NRWmuS

#Enter the directory and install the requirements
%cd shap-e
!pip install -e .

from PIL import Image
import torch
from tqdm.auto import tqdm

from point_e.diffusion.configs import DIFFUSION_CONFIGS, diffusion_from_config
from point_e.diffusion.sampler import PointCloudSampler
from point_e.models.download import load_checkpoint
from point_e.models.configs import MODEL_CONFIGS, model_from_config
from point_e.util.plotting import plot_point_cloud

#Implementation and Cooking the 3D models, import all the necessary libraries.
#%cd /content/shap-e
import torch

from shap_e.diffusion.sample import sample_latents
from shap_e.diffusion.gaussian_diffusion import diffusion_from_config
from shap_e.models.download import load_model, load_config
from shap_e.util.notebooks import create_pan_cameras, decode_latent_images, gif_widget

#set the device to cuda if available, otherwise to cpu.
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

#load the models and weights.
xm = load_model('transmitter', device=device)
model = load_model('text300M', device=device)
diffusion = diffusion_from_config(load_config('diffusion'))

#generate the 3D models.
batch_size = 1 # this is the size of the models, higher values take longer to generate.
guidance_scale = 65.0 # this is the scale of the guidance, higher values make the model look more like the prompt.

latents = sample_latents(

batch_size=batch_size,

model=model,

diffusion=diffusion,

guidance_scale=guidance_scale,

model_kwargs=dict(texts=[prompt] * 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,
)

render_mode = 'stf' #
size = 128 # 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))

#save the 3D models as .ply and .obj files.
# Example of saving the latents as meshes.
from shap_e.util.notebooks import decode_latent_mesh

for i, latent in enumerate(latents):

t = decode_latent_mesh(xm, latent).tri_mesh()

with open(f'example_mesh_{i}.ply', 'wb') as f: # this is three-dimensional geometric data of model.

t.write_ply(f)

with open(f'example_mesh_{i}.obj', 'w') as f: # we will use this file to customize in Blender Studio later.

t.write_obj(f)

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

print('creating base model...')
base_name = 'base40M'
base_model = model_from_config(MODEL_CONFIGS[base_name], device)
base_model.eval()
base_diffusion = diffusion_from_config(DIFFUSION_CONFIGS[base_name])

print('creating upsample model...')
upsampler_model = model_from_config(MODEL_CONFIGS['upsample'], device)
upsampler_model.eval()
upsampler_diffusion = diffusion_from_config(DIFFUSION_CONFIGS['upsample'])

print('downloading base checkpoint...')
base_model.load_state_dict(load_checkpoint(base_name, device))

print('downloading upsampler checkpoint...')
upsampler_model.load_state_dict(load_checkpoint('upsample', device))

sampler = PointCloudSampler(

device=device,

models=[base_model, upsampler_model],

diffusions=[base_diffusion, upsampler_diffusion],

num_points=[1024, 4096 - 1024],

aux_channels=['R', 'G', 'B'],

guidance_scale=[3.0, 3.0],
)

from google.colab import files
uploaded = files.upload()

# Load an image to condition on.
img = Image.open('figure_all.jpg')

# Produce a sample from the model.
samples = None
for x in tqdm(sampler.sample_batch_progressive(batch_size=1, model_kwargs=dict(images=[img]))):

samples = x

img

pc = sampler.output_to_point_clouds(samples)[0]

fig = plot_point_cloud(pc, grid_size=3, fixed_bounds=((-0.75, -0.75, -0.75),(0.75, 0.75, 0.75)))

import plotly.graph_objects as go

fig_plotly = go.Figure(

data=[

go.Scatter3d(

x=pc.coords[:,0], y=pc.coords[:,1], z=pc.coords[:,2],

mode='markers',

marker=dict(

size=2,

color=['rgb({},{},{})'.format(r,g,b) for r,g,b in zip(pc.channels["R"], pc.channels["G"], pc.channels["B"])],

)

)

],

layout=dict(

scene=dict(

xaxis=dict(visible=False),

yaxis=dict(visible=False),

zaxis=dict(visible=False)

)

),

)

fig_plotly.show(renderer="colab")

from point_e.util.pc_to_mesh import marching_cubes_mesh

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

print('creating SDF model...')
name = 'sdf'
model = model_from_config(MODEL_CONFIGS[name], device)
model.eval()

print('loading SDF model...')
model.load_state_dict(load_checkpoint(name, device))

import skimage.measure as measure

# Produce a mesh (with vertex colors)
mesh = marching_cubes_mesh(

pc=pc,

model=model,

batch_size=4096,

grid_size=32, # increase to 128 for resolution used in evals

progress=True,
)

# Write the mesh to a PLY file to import into some other program.
with open('figure_all.obj', 'wb') as f:

mesh.write_ply(f)


发布     👍 0 举报 写留言 🖊   
✋热门推荐
  • 【#氪星播报# | 9月7日晚间都有哪些#今日大事件#?2、#抖音电商独立app或停止运营#,但电商梦还要继续3、中欧基金澄清:#葛兰离职为不实信息#4、#小红
  • [吃瓜][吃瓜][吃瓜]时薪1000的律师,不一定比时薪100的律师更靠谱。[吃瓜][吃瓜][吃瓜]刚刚有小韭菜来抱怨,她被人嫌弃报价高律师行业水深了……[吃瓜
  • p1 wdm自己坐的蛋糕 不愧是开手作店的p2 最近的两瓶心头好 bbr那瓶真的很少女!p5 细节的cztp6-7 在万象城旁边的一家日式餐厅叫元宝 真的西北好
  • 大学期间,在杨紫生日的时候,张一山还曾带领着全班男生为她合唱了一首《做你的男人》:“做你的男人,24 个小时不睡觉,让胆小的你在黑夜中也会有个依靠”。对于他们的
  • #俄外交部称俄完全遵守不可发生核战争声明##俄乌局势##水爷称自己上了乌克兰的死亡名单##大象军事[超话]#【尼古拉耶夫通往赫尔松的道路是通畅的】:今天,10
  • 昨晚我电话说,元旦可能回去, 下雪了,家li冷滴狠……疫情… 不稳……回京核酸证明,好好待不了几分钟…………在那想吃什么买什么吧[这得算是战略性安抚],……。又
  •   在通过以上的信息可以确定自己所报考专业是扩招还是缩招的情况下,考生可以去对照去年的复试和录取名单,名单中是有考生的初试成绩和初试成名,考生可以把自己的成绩排
  • 本来想着端午自己安静地再去看一场杜比厅的,但是那天突然想到“如果你有喜欢的歌手,你会想办法去听他们的演唱会,去见见那些和你一样喜欢他们的人”这句话(好像是蔡康永
  • 知之为知之… …是知也[抱一抱][抱一抱][抱一抱] 我曾凭[给你小心心] 我知道 而你不知道 为荣[平安果][平安果][平安果] 恰恰是[红灯笼] 我知道你
  • 来自别人的赞美,并不是因为容貌,而是因为美丽的内心~ 一个人往往有了美丽的内心,就拥有了一个美丽的外在。故事中的墨点儿就是这样的一个女孩子,据说戴上狐狸的面具就
  • 若相知莫相弃,若相惜莫相离......了尘恭敬供养合十 【星辉闪点】人都是有感情的,进了心的人,最难忘,动了情的人,最难放。人心不是欺骗,不必费尽心机,记住一句
  • 论美食,这里自古盛产大米,素有“处州粮仓”之美誉,推出了“松阳十大碗”、酥软香嫩的盐煨鸡等等让人赞不绝口的美食[中国赞]你有去过松阳吗[哇]#浙是中国红# vi
  • [心][握手][握手][心]人生一切都要随缘,也只有这样才是最好的安排……[心]因为,我们执着拥有什么,结果就会失去什么……[鲜花]是你的东西不会跑掉,不是你的
  • 我对着自己的生活使劲,为了自己的前途苟活,于谁都没有认真的付出,当然不应该有什么回报。有些女生确实在自己的人生谷底施舍下了温热,真的万分感谢。
  • 那次巡逻之后便是中秋佳节,吴杰和哨所另一位新战友一起给家人打电话,他告诉母亲,这个中秋节他有收获:“长大,就是翻过心中那座山。中秋节前能收到包裹,用官兵的话来说
  • 差点忘了我的基地这周其实平平淡淡开开心心今天开了新人大会 部长真的一般不过小孩都挺好的[二哈] 主要是合照拍丑了很不开心[抓狂]王饱饱也到的很突然 主要是快递员
  • 哈哈哈哈哈在排队等车的时候又碰到他们一家子了,实话实说第一看见的是魔童,当然我不认识他,只觉得这个小男孩好帅,还卷毛,哈哈哈,忍不住多看了几眼。哈哈哈哈哈在排对
  • 南无莲池海会佛菩萨(三称) 《佛说阿弥陀经》 姚秦三藏法师鸠摩罗什译   如是我闻。一时佛在舍卫国,祇树给孤独园。与大比丘僧,千二百五十人俱,皆是大阿罗汉,众
  •   #没事就要多读书# 郭沫若1923年给宗白华的信《论中德文化书》发表了对于中国传统文化的见解,驳斥了宗白华说中国文化是“静默”的:1、中国文化是注重现实,注
  • #小高的胡言乱语# 今天发现了超级好吃的披萨 感觉很值很值很值 拉丝的芝士 满满的牛肉 开始追一部电视剧 高考 疫情 网课 不争气的爸爸 强势的妈妈 留守的