Diffusers
Safetensors
File size: 2,460 Bytes
f0fc238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
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
import io
import tarfile
import pickle
import zstandard

# 只拿第一个包来做实验
archive_path = "/home/dataset-assist-0/usr/lh/ysh/dw/RL/AR/data/DyMesh_50000v_16f_0001_part_00"

print("正在抽取前 3 个文件窥探内部完整的文本和数据结构...\n")

with open(archive_path, 'rb') as fh:
    dctx = zstandard.ZstdDecompressor()
    with dctx.stream_reader(fh) as reader:
        with tarfile.open(fileobj=reader, mode='r|') as tar:
            count = 0
            for member in tar:
                if member.isfile():
                    count += 1
                    print(f"=== [文件 {count}] {member.name} ===")
                    
                    f = tar.extractfile(member)
                    if f is not None:
                        mem_file = io.BytesIO(f.read())
                        data = pickle.load(mem_file)
                        
                        if isinstance(data, dict):
                            # 1. 打印里面所有的键
                            print(f" 📦 字典包含的所有 Key: {list(data.keys())}")
                            
                            # 2. 自动寻找并打印文本内容
                            text_keys = ['caption', 'text', 'prompt', 'description']
                            found_text = False
                            for tk in text_keys:
                                if tk in data:
                                    print(f" 📝 文本标注 ({tk}): \"{data[tk]}\"")
                                    found_text = True
                                    break
                            if not found_text:
                                # 如果不在常用词里,打印出所有不是数组的纯文本/字符串字段
                                for k, v in data.items():
                                    if isinstance(v, str):
                                        print(f" 📝 发现文本字段 ({k}): \"{v}\"")
                            
                            # 3. 顺便打印一下矩阵的大小
                            if 'vertices' in data:
                                print(f" 📐 顶点矩阵 Shape: {data['vertices'].shape}")
                        else:
                            print(" ❌ 该文件不是字典格式")
                    print("-" * 60 + "\n")
                    
                    if count >= 100:  # 只看前 3 个就退出
                        break