README.md 3.34 KB
Newer Older
weishb's avatar
weishb committed
1
2
## 论文
[Native and Compact Structured Latents for 3D Generation](https://arxiv.org/abs/2512.14692?utm_source=chatgpt.com)
weishb's avatar
weishb committed
3

weishb's avatar
weishb committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
## 模型简介
TRELLIS.2是一款最先进的大型3D生成模型(40亿参数),专为高保真图像到3D生成而设计。它利用一种名为O-Voxel的新型“无场”稀疏体素结构,来重建和生成具有复杂拓扑结构、锐利特征和完整PBR材质的任意3D资产。

## 环境依赖

| 软件 | 版本 |
| :------: | :------: |
| DTK | 26.04 |
| Python | 3.10 |
| Transformers | 4.56.0 |

推荐使用镜像:

harbor.sourcefind.cn:5443/dcu/admin/base/custom:ubuntu22.04-dtk26.04-py3.10-20260526-trellis2

- 挂载地址`-v` 根据实际模型情况修改
```bash
docker run -it \
    --shm-size 200g \
    --network=host \
    --name TRELLIS2 \
    --privileged \
    --device=/dev/kfd \
    --device=/dev/dri \
    --device=/dev/mkfd \
    --group-add video \
    --cap-add=SYS_PTRACE \
    --security-opt seccomp=unconfined \
    -u root \
    -v /opt/hyhal/:/opt/hyhal/:ro \
    -v /path/your_code_data/:/path/your_code_data/ \
    harbor.sourcefind.cn:5443/dcu/admin/base/custom:ubuntu22.04-dtk26.04-py3.10-20260526-trellis2 bash
```
更多镜像可前往[光源](https://sourcefind.cn/#/service-list)下载使用。

关于本项目DCU显卡所需的特殊深度学习库可从[光合](https://developer.sourcefind.cn/tool/)开发者社区下载安装

其它包安装:

```bash
git clone https://developer.sourcefind.cn/codes/modelzoo/trellis.2.git
```

## 预训练权重
**请根据`支持的DCU型号`选择对应模型下载,FP8模型仅在BW1100/BW1101上支持,其他型号请勿使用!**

| 模型名称  | 权重大小  | 数据类型 | 支持的DCU型号  | 最低卡数需求 |下载地址|
|:-----:|:----------:|:----------:|:----------:|:---------------------:|:----------:|
| TRELLIS.2-4B  | 4B | BF16 | BW1000 | 1 | [HuggingFace](https://huggingface.co/microsoft/TRELLIS.2-4B) |
| TRELLIS-image-large  | 1B | BF16 | BW1000 | 1 | [HuggingFace](https://huggingface.co/microsoft/TRELLIS-image-large?utm_source=chatgpt.com) |
| dinov3-vitl16-pretrain-lvd1689m | 0.5B | BF16 | BW1000 | 1 | [HuggingFace](https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m?utm_source=chatgpt.com) |
| RMBG-2.0  | 0.5B | BF16 | BW1000 | 1 | [HuggingFace](https://huggingface.co/briaai/RMBG-2.0?utm_source=chatgpt.com) |

## 数据集
暂无

## 训练
暂无

## 推理

### Torch
#### 单机推理
**使用离线模型需要进行环境变量配置,如果网络条件允许在线拉取模型,可以忽略环境变量设置**
```bash
export HF_HOME=/path/to/hf_cache
export HUGGINGFACE_HUB_CACHE=$HF_HOME/hub
export HF_HUB_OFFLINE=1
export TRANSFORMERS_OFFLINE=1

weishb's avatar
weishb committed
74
cd TRELLIS.2_DCU
weishb's avatar
weishb committed
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
python app.py
```

## 效果展示
<div align=center>
    <img src="./doc/01.png"/>
</div>

### 精度
DCU与GPU精度一致,推理框架:Pytorch

## 源码仓库及问题反馈
- [此处填本项目gitlab地址](https://developer.sourcefind.cn/codes/modelzoo/trellis.2)

## 参考资料
- https://github.com/microsoft/TRELLIS.2
- https://microsoft.github.io/TRELLIS.2/?utm_source=chatgpt.com
- ......

其他说明:
关于model.properties(必要)、LICENSE(必要)、CONTRIBUTORS、模型图标(必要)等其它信息提供参照:[`ModelZooStd.md`](./ModelZooStd.md)
各个模型需要保留原项目README.md,改名为README_origin.md即可。