lihao57 commited on
Commit
9d9dea1
·
0 Parent(s):

initial commit

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +62 -0
  2. .gitignore +2 -0
  3. .pre-commit-config.yaml +13 -0
  4. README.md +32 -0
  5. dataset.py +90 -0
  6. test/images/00031546.png +3 -0
  7. test/images/00031591.png +3 -0
  8. test/images/00031608.png +3 -0
  9. test/images/00031697.png +3 -0
  10. test/images/00031723.png +3 -0
  11. test/images/00031797.png +3 -0
  12. test/images/00031810.png +3 -0
  13. test/images/00031811.png +3 -0
  14. test/images/00031841.png +3 -0
  15. test/images/00031975.png +3 -0
  16. test/images/00032053.png +3 -0
  17. test/images/00033036.png +3 -0
  18. test/images/00033307.png +3 -0
  19. test/images/00033365.png +3 -0
  20. test/images/00033445.png +3 -0
  21. test/images/00033539.png +3 -0
  22. test/images/00033873.png +3 -0
  23. test/images/00034439.png +3 -0
  24. test/images/00035148.png +3 -0
  25. test/images/00035223.png +3 -0
  26. test/images/00035228.png +3 -0
  27. test/images/00035326.png +3 -0
  28. test/images/00035343.png +3 -0
  29. test/images/00035585.png +3 -0
  30. test/images/00035608.png +3 -0
  31. test/images/00035610.png +3 -0
  32. test/images/00035796.png +3 -0
  33. test/images/00036227.png +3 -0
  34. test/images/00036228.png +3 -0
  35. test/images/00036242.png +3 -0
  36. test/images/00036277.png +3 -0
  37. test/images/00036384.png +3 -0
  38. test/images/00036517.png +3 -0
  39. test/images/00036609.png +3 -0
  40. test/images/00036796.png +3 -0
  41. test/images/00036808.png +3 -0
  42. test/images/00036868.png +3 -0
  43. test/images/00036977.png +3 -0
  44. test/images/00037040.png +3 -0
  45. test/images/00037045.png +3 -0
  46. test/images/00037060.png +3 -0
  47. test/images/00037075.png +3 -0
  48. test/images/00037184.png +3 -0
  49. test/images/00037187.png +3 -0
  50. test/images/00037205.png +3 -0
.gitattributes ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
12
+ *.mds filter=lfs diff=lfs merge=lfs -text
13
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
14
+ *.model filter=lfs diff=lfs merge=lfs -text
15
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
16
+ *.npy filter=lfs diff=lfs merge=lfs -text
17
+ *.npz filter=lfs diff=lfs merge=lfs -text
18
+ *.onnx filter=lfs diff=lfs merge=lfs -text
19
+ *.ot filter=lfs diff=lfs merge=lfs -text
20
+ *.parquet filter=lfs diff=lfs merge=lfs -text
21
+ *.pb filter=lfs diff=lfs merge=lfs -text
22
+ *.pickle filter=lfs diff=lfs merge=lfs -text
23
+ *.pkl filter=lfs diff=lfs merge=lfs -text
24
+ *.pt filter=lfs diff=lfs merge=lfs -text
25
+ *.pth filter=lfs diff=lfs merge=lfs -text
26
+ *.rar filter=lfs diff=lfs merge=lfs -text
27
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
28
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
29
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar filter=lfs diff=lfs merge=lfs -text
31
+ *.tflite filter=lfs diff=lfs merge=lfs -text
32
+ *.tgz filter=lfs diff=lfs merge=lfs -text
33
+ *.wasm filter=lfs diff=lfs merge=lfs -text
34
+ *.xz filter=lfs diff=lfs merge=lfs -text
35
+ *.zip filter=lfs diff=lfs merge=lfs -text
36
+ *.zst filter=lfs diff=lfs merge=lfs -text
37
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
38
+ # Audio files - uncompressed
39
+ *.pcm filter=lfs diff=lfs merge=lfs -text
40
+ *.sam filter=lfs diff=lfs merge=lfs -text
41
+ *.raw filter=lfs diff=lfs merge=lfs -text
42
+ # Audio files - compressed
43
+ *.aac filter=lfs diff=lfs merge=lfs -text
44
+ *.flac filter=lfs diff=lfs merge=lfs -text
45
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
46
+ *.ogg filter=lfs diff=lfs merge=lfs -text
47
+ *.wav filter=lfs diff=lfs merge=lfs -text
48
+ # Image files - uncompressed
49
+ *.bmp filter=lfs diff=lfs merge=lfs -text
50
+ *.gif filter=lfs diff=lfs merge=lfs -text
51
+ *.png filter=lfs diff=lfs merge=lfs -text
52
+ *.tiff filter=lfs diff=lfs merge=lfs -text
53
+ # Image files - compressed
54
+ *.jpg filter=lfs diff=lfs merge=lfs -text
55
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
56
+ *.webp filter=lfs diff=lfs merge=lfs -text
57
+ # Video files - compressed
58
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
59
+ *.webm filter=lfs diff=lfs merge=lfs -text
60
+ *png filter=lfs diff=lfs merge=lfs -text
61
+ *pkl filter=lfs diff=lfs merge=lfs -text
62
+ *.jsonl filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ .vscode
2
+ .gradio
.pre-commit-config.yaml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ repos:
2
+ - repo: https://github.com/psf/black
3
+ rev: 22.3.0
4
+ hooks:
5
+ - id: black
6
+ args: [--line-length=120]
7
+ - repo: https://github.com/pre-commit/pre-commit-hooks
8
+ rev: v3.2.0
9
+ hooks:
10
+ - id: check-json
11
+ - id: end-of-file-fixer
12
+ - id: trailing-whitespace
13
+ - id: requirements-txt-fixer
README.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets: lh9171338/Wireframe
3
+ pretty_name: Wireframe Dataset
4
+ license: mit
5
+ tags:
6
+ - computer-vision
7
+ - line-segment-detection
8
+ - wireframe-parsing
9
+ size_categories: 1K<n<10K
10
+ ---
11
+
12
+ # Wireframe Dataset
13
+
14
+ This is the **Wireframe dataset** hosted on Hugging Face Hub.
15
+
16
+ ## Dataset Summary
17
+
18
+ Wireframe dataset with image annotations including line segments.
19
+ The dataset is stored as pickle files (`train.pkl`, `test.pkl`) and images.
20
+ A custom `dataset.py` is provided for loading.
21
+
22
+ ## Usage
23
+
24
+ ```python
25
+ from datasets import load_dataset
26
+
27
+ # Load the dataset from Hugging Face Hub
28
+ ds = load_dataset("lh9171338/Wireframe")
29
+
30
+ # Access samples
31
+ print(ds)
32
+ print(ds["train"][0])
dataset.py ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ """
4
+ @File : dataset.py
5
+ @Time : 2025/08/31 23:00:00
6
+ @Author : lh9171338
7
+ @Version : 1.0
8
+ @Contact : 2909171338@qq.com
9
+ """
10
+
11
+ import os
12
+ import tqdm
13
+ import pickle
14
+ import jsonlines
15
+ from datasets import Dataset, Features, Sequence, Value
16
+
17
+
18
+ def convert_pkl_to_parquet(split):
19
+ """
20
+ Convert pkl file to parquet file
21
+
22
+ Args:
23
+ split (str): split name
24
+
25
+ Returns:
26
+ None
27
+ """
28
+ # 加载 pkl 文件
29
+ with open(f"{split}/{split}.pkl", "rb") as f:
30
+ annotations = pickle.load(f)
31
+
32
+ # 新增 file_name 字段
33
+ new_annotations = []
34
+ for ann in tqdm.tqdm(annotations):
35
+ new_ann = dict(
36
+ file_name=ann["image_file"],
37
+ image_file=os.path.basename(ann["image_file"]),
38
+ image_size=ann["image_size"],
39
+ lines=ann["lines"].tolist(),
40
+ )
41
+ new_annotations.append(new_ann)
42
+
43
+ # 转 Dataset
44
+ features = Features(
45
+ {
46
+ "file_name": Value("string"),
47
+ "image_file": Value("string"),
48
+ "image_size": Sequence(Value("int32")),
49
+ "lines": Sequence(Sequence(Sequence(Value("float")))),
50
+ }
51
+ )
52
+ ds = Dataset.from_list(new_annotations, features=features)
53
+
54
+ # 保存 parquet
55
+ ds.to_parquet(f"{split}/metadata.parquet")
56
+
57
+
58
+ def convert_pkl_to_jsonl(split):
59
+ """
60
+ Convert pkl file to jsonl file
61
+
62
+ Args:
63
+ split (str): split name
64
+
65
+ Returns:
66
+ None
67
+ """
68
+ # 加载 pkl 文件
69
+ with open(f"{split}/{split}.pkl", "rb") as f:
70
+ annotations = pickle.load(f)
71
+
72
+ # 新增 file_name 字段
73
+ new_annotations = []
74
+ for ann in tqdm.tqdm(annotations):
75
+ new_ann = dict(
76
+ file_name=ann["image_file"],
77
+ image_file=os.path.basename(ann["image_file"]),
78
+ image_size=ann["image_size"],
79
+ lines=ann["lines"].tolist(),
80
+ )
81
+ new_annotations.append(new_ann)
82
+
83
+ # 保存 jsonl文件
84
+ with jsonlines.open(f"{split}/metadata.jsonl", "w") as f:
85
+ f.write_all(new_annotations)
86
+
87
+
88
+ if __name__ == "__main__":
89
+ convert_pkl_to_jsonl("train")
90
+ convert_pkl_to_jsonl("test")
test/images/00031546.png ADDED

Git LFS Details

  • SHA256: 6d517f5cf900a28c66e4722f16dfe45ee17902ff8d31fa17fef06dd34701fb84
  • Pointer size: 131 Bytes
  • Size of remote file: 338 kB
test/images/00031591.png ADDED

Git LFS Details

  • SHA256: f9d6e074ecac88724f94fe5405e842a4d46f6cfefb076eeb7d3327ab483905b4
  • Pointer size: 131 Bytes
  • Size of remote file: 353 kB
test/images/00031608.png ADDED

Git LFS Details

  • SHA256: 6e5902442803a34ddfc2dcd615430bd3e58367fbc58933fbb11ec50131d0023a
  • Pointer size: 131 Bytes
  • Size of remote file: 353 kB
test/images/00031697.png ADDED

Git LFS Details

  • SHA256: a725c78b231973846092361838ab3f218555bfe7fe882cefbee18f0d0166e1df
  • Pointer size: 131 Bytes
  • Size of remote file: 359 kB
test/images/00031723.png ADDED

Git LFS Details

  • SHA256: ae34fc19eedcba0b60f1d7b61b56d17630bb3135cb5aeadb80acfd60da21ebd1
  • Pointer size: 131 Bytes
  • Size of remote file: 273 kB
test/images/00031797.png ADDED

Git LFS Details

  • SHA256: fea1a812c224d2228a003dc360e67b7ef196a6049c2777be0bcf2b03d9e9a2d3
  • Pointer size: 131 Bytes
  • Size of remote file: 335 kB
test/images/00031810.png ADDED

Git LFS Details

  • SHA256: 1312ad652b8ca2a32346058a56eeb9ff071eb079b430238fbec4174d309c3b80
  • Pointer size: 131 Bytes
  • Size of remote file: 379 kB
test/images/00031811.png ADDED

Git LFS Details

  • SHA256: a0983e63ea60821abc4cdc3953aee1b310a057b3d8b7eb72889146ecb3c460a2
  • Pointer size: 131 Bytes
  • Size of remote file: 255 kB
test/images/00031841.png ADDED

Git LFS Details

  • SHA256: c6ac99d23360cbc8948b02c3b9066c6ab6fc0210a6ad9256117030a10209c076
  • Pointer size: 131 Bytes
  • Size of remote file: 379 kB
test/images/00031975.png ADDED

Git LFS Details

  • SHA256: 818d571406141e4b2bdd697a78b1228f9d8ef654653b262bedabe8357409b1f7
  • Pointer size: 131 Bytes
  • Size of remote file: 174 kB
test/images/00032053.png ADDED

Git LFS Details

  • SHA256: c3d94f9efec020e80b56041e8142b45d5c6822b45d4f2bbad167e8e7fe0775f0
  • Pointer size: 131 Bytes
  • Size of remote file: 260 kB
test/images/00033036.png ADDED

Git LFS Details

  • SHA256: f58e27d0d40a802d283531a2e9fd85f434922861f6018df43c192333270f2c36
  • Pointer size: 131 Bytes
  • Size of remote file: 281 kB
test/images/00033307.png ADDED

Git LFS Details

  • SHA256: e7140afdcf2ec024368776f0d69b7f0074ae1c417521f7a6952246d9012bc24e
  • Pointer size: 131 Bytes
  • Size of remote file: 410 kB
test/images/00033365.png ADDED

Git LFS Details

  • SHA256: 6a9e3fa621dcbf2ff56e6e0ab074cfb08367b62e58d4f29ed1d024d456413e3c
  • Pointer size: 131 Bytes
  • Size of remote file: 356 kB
test/images/00033445.png ADDED

Git LFS Details

  • SHA256: b1c138a7ec09df38043162cd98adafcfce954a401f76eb991aab0d17cf074c3e
  • Pointer size: 131 Bytes
  • Size of remote file: 299 kB
test/images/00033539.png ADDED

Git LFS Details

  • SHA256: d483d866a8c7d3b854a563f9e46a6c44c809fd0695cb160f52e41a0da33dbfc1
  • Pointer size: 131 Bytes
  • Size of remote file: 352 kB
test/images/00033873.png ADDED

Git LFS Details

  • SHA256: 1443f7ac2455ff117960109eb3fe92aa44f6aef55303b57f20d4fa2200e5050f
  • Pointer size: 131 Bytes
  • Size of remote file: 369 kB
test/images/00034439.png ADDED

Git LFS Details

  • SHA256: 4692ae772929522de16e06d70ad533e23cf2e70c5ea6b94d5fb7be491649db6c
  • Pointer size: 131 Bytes
  • Size of remote file: 240 kB
test/images/00035148.png ADDED

Git LFS Details

  • SHA256: 1595d55bb32bc88e742a001e68d1cb7f70eee06be89a76f93566c9bdfd9a9869
  • Pointer size: 131 Bytes
  • Size of remote file: 316 kB
test/images/00035223.png ADDED

Git LFS Details

  • SHA256: 7f2cb1a12284d7f19edc54042d08529e23e4dea52ed9ce828737e9d795b2ca74
  • Pointer size: 131 Bytes
  • Size of remote file: 352 kB
test/images/00035228.png ADDED

Git LFS Details

  • SHA256: aa0a5f6dd569dc6f288e83ca397773acfdaad0e7dd2676ade68d5f2399f137f2
  • Pointer size: 131 Bytes
  • Size of remote file: 314 kB
test/images/00035326.png ADDED

Git LFS Details

  • SHA256: bd331b2c99d4c0c979d53383c7d3f54ef98d9d329482c9c3e98bfb3ae3c14317
  • Pointer size: 131 Bytes
  • Size of remote file: 333 kB
test/images/00035343.png ADDED

Git LFS Details

  • SHA256: 2af10b406d64d80679490700f771e384cc681225145be3edf2fc7ce9b742f224
  • Pointer size: 131 Bytes
  • Size of remote file: 277 kB
test/images/00035585.png ADDED

Git LFS Details

  • SHA256: c07a8ba8ae6323185407c69ae2985ee01990a954ae94d9af01c34c00873738cd
  • Pointer size: 131 Bytes
  • Size of remote file: 267 kB
test/images/00035608.png ADDED

Git LFS Details

  • SHA256: db5649bdbb3bc3c90f5bd831ce1957c1a17e767e18e3290480ef2af1dcea899e
  • Pointer size: 131 Bytes
  • Size of remote file: 334 kB
test/images/00035610.png ADDED

Git LFS Details

  • SHA256: 4d97a62d337918191ad8b5929738b276d70092a0defc17ca8aa375b982340592
  • Pointer size: 131 Bytes
  • Size of remote file: 248 kB
test/images/00035796.png ADDED

Git LFS Details

  • SHA256: 0f08010536ae0781154c1481995450282c486aac6c7375c89275960755a2b6e2
  • Pointer size: 131 Bytes
  • Size of remote file: 287 kB
test/images/00036227.png ADDED

Git LFS Details

  • SHA256: 35326a2501091ca5502d09df28c4d21f6266a565b32494d09c8c8de3bcdd513a
  • Pointer size: 131 Bytes
  • Size of remote file: 318 kB
test/images/00036228.png ADDED

Git LFS Details

  • SHA256: b54dae93e79ff953fe5210351d44a12decb21c8d9d1db5a0fa1f377ce921c3d8
  • Pointer size: 131 Bytes
  • Size of remote file: 378 kB
test/images/00036242.png ADDED

Git LFS Details

  • SHA256: 3f0b53a8fa199f08edf79f81949439e2f8eebd13565784f88192004ef0ff04bc
  • Pointer size: 131 Bytes
  • Size of remote file: 271 kB
test/images/00036277.png ADDED

Git LFS Details

  • SHA256: 20605c9f191174c8f88f2040ee604a14033e4a01937b8142af530991ef893255
  • Pointer size: 131 Bytes
  • Size of remote file: 269 kB
test/images/00036384.png ADDED

Git LFS Details

  • SHA256: b13b3db5896b0efb7f049a676d3a13e7fc7bd05d547085f6c892050a1bcbe7c4
  • Pointer size: 131 Bytes
  • Size of remote file: 349 kB
test/images/00036517.png ADDED

Git LFS Details

  • SHA256: e85851dd4954d3e0a6c7d453f656a2da28fe09f3dc2f31a7d4c54adbb4c08827
  • Pointer size: 131 Bytes
  • Size of remote file: 268 kB
test/images/00036609.png ADDED

Git LFS Details

  • SHA256: 9432994a6500b2da670a354c984af8f58786e57b5d4e745020336a3af0f04b4a
  • Pointer size: 131 Bytes
  • Size of remote file: 347 kB
test/images/00036796.png ADDED

Git LFS Details

  • SHA256: 2c773671a2488de7a1cc98a31d422878aa79364fdfa453f15610831045f6fe56
  • Pointer size: 131 Bytes
  • Size of remote file: 265 kB
test/images/00036808.png ADDED

Git LFS Details

  • SHA256: 022dd7f8dbcac4bf79555a2da1a598b17b4446c03735d1c4c3aaf960a46a08a3
  • Pointer size: 131 Bytes
  • Size of remote file: 235 kB
test/images/00036868.png ADDED

Git LFS Details

  • SHA256: 22106a54801df263c4757212e4b77448e0371683c839f89b188eda5cfb28e838
  • Pointer size: 131 Bytes
  • Size of remote file: 309 kB
test/images/00036977.png ADDED

Git LFS Details

  • SHA256: 4e1893be4ee0efaca0b8d5c176312100ef21b4464f4e4fd4f37ee84a4adeeaf3
  • Pointer size: 131 Bytes
  • Size of remote file: 296 kB
test/images/00037040.png ADDED

Git LFS Details

  • SHA256: 8ad11196f74f4fd3b8aee26d5d696dd445dfa7dba8619fab67b3ff550d6c9783
  • Pointer size: 131 Bytes
  • Size of remote file: 277 kB
test/images/00037045.png ADDED

Git LFS Details

  • SHA256: 3ee16dd0b65591d627672c6dfef632d20b073f7d4f4c758848c6d3100d05a334
  • Pointer size: 131 Bytes
  • Size of remote file: 277 kB
test/images/00037060.png ADDED

Git LFS Details

  • SHA256: 4817abe0a54749aa82aaf077812229ef607b525504d22c333547af5c16a67ebc
  • Pointer size: 131 Bytes
  • Size of remote file: 258 kB
test/images/00037075.png ADDED

Git LFS Details

  • SHA256: 9d0f8a66d6985af3a866791a1c7ef23643dc62337b52c6d90c738d03542c2ed0
  • Pointer size: 131 Bytes
  • Size of remote file: 267 kB
test/images/00037184.png ADDED

Git LFS Details

  • SHA256: d42e25e980d57e3f7f9f66d8e11766a9321b2138582d093fde2b1f95e74abb84
  • Pointer size: 131 Bytes
  • Size of remote file: 281 kB
test/images/00037187.png ADDED

Git LFS Details

  • SHA256: c1b86f5a24fdb371ed418a1863435b6da9483f0c91a50c8b73d1300591db9102
  • Pointer size: 131 Bytes
  • Size of remote file: 312 kB
test/images/00037205.png ADDED

Git LFS Details

  • SHA256: debfbc1b38c5cce2cab78c04e5b04379711643e5bc6a7480b59e9ab7234b7d37
  • Pointer size: 131 Bytes
  • Size of remote file: 225 kB