Spaces:
Paused
Paused
Update app_fine.py
Browse files839 unmodified lines840841842843844845846847848849850851852853839 unmodified lines)# Launch the Gradio appif __name__ == "__main__":pipeline = TrellisVGGTTo3DPipeline.from_pretrained("Stable-X/trellis-vggt-v0-2")# pipeline = TrellisVGGTTo3DPipeline.from_pretrained("weights/trellis-vggt-v0-1")pipeline.cuda()pipeline.VGGT_model.cuda()pipeline.birefnet_model.cuda()pipeline.dreamsim_model.cuda()mast3r_model = AsymmetricMASt3R.from_pretrained("naver/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric").cuda().eval()# mast3r_model = AsymmetricMASt3R.from_pretrained("weights/MAST3R/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric.pth").cuda().eval()demo.launch()839 unmodified lines840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870839 unmodified lines)# ํ์ผ ์ตํ๋จ if __name__ == "__main__": ๋ด๋ถ๋ฅผ ๋ค์๊ณผ ๊ฐ์ด ์์ ํ์ธ์.if __name__ == "__main__":pipeline = TrellisVGGTTo3DPipeline.from_pretrained("Stable-X/trellis-vggt-v0-2")# --- ๋ฉํฐ GPU ์ค์ ์์ ---num_gpus = torch.cuda.device_count()print(f"์ฌ์ฉ ๊ฐ๋ฅํ GPU ๊ฐ์: {num_gpus}")# ๋ฉ์ธ ํ์ดํ๋ผ์ธ ๋ฐ ๋ชจ๋ธ๋ค์ ๋ฉํฐ GPU์ ๋ถ์ฐif num_gpus > 1:pipeline.cuda() # ์ฐ์ ๋ฉ์ธ ๋ก๋# ๋ด๋ถ์ ํฐ ๋ชจ๋ธ๋ค์ DataParallel๋ก ๊ฐ์ธ๊ธฐpipeline.VGGT_model = torch.nn.DataParallel(pipeline.VGGT_model)pipeline.birefnet_model = torch.nn.DataParallel(pipeline.birefnet_model)# pipeline.dreamsim_model = torch.nn.DataParallel(pipeline.dreamsim_model) # ํ์์ ํด์ else:pipeline.cuda()# MAST3R ๋ชจ๋ธ ๋ฉํฐ GPU ์ค์ mast3r_raw = AsymmetricMASt3R.from_pretrained("naver/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric")if num_gpus > 1:mast3r_model = torch.nn.DataParallel(mast3r_raw).cuda().eval()else:mast3r_model = mast3r_raw.cuda().eval()# --- ๋ฉํฐ GPU ์ค์ ๋ ---demo.launch()
app_fine.py+26-9