Zqlin commited on
Commit
8d5dfff
·
verified ·
1 Parent(s): daae239

Upload folder using huggingface_hub

Browse files
starting_kit/README.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TwinWorld 2026 Starting Kit
2
+
3
+ This page covers two things: the submission format, and a set of reference
4
+ implementations you can use as a starting point.
5
+
6
+ ## Submission Format
7
+
8
+ A single zip file, containing the dataset folders at the top level:
9
+
10
+ ```
11
+ submission.zip
12
+ ├── tum/<scene_id>/
13
+ │ ├── rgb/<frame_id>.png
14
+ │ └── 3D_point_cloud/point_cloud.ply # x, y, z
15
+ └── gold_coast/<scene_id>/
16
+ ├── rgb/<frame_id>.png
17
+ └── 3D_point_cloud/point_cloud.ply # x, y, z, classification
18
+ ```
19
+
20
+ - Scene IDs and frame IDs (file name stems) must exactly match the reference frames provided for each phase.
21
+ - rgb/ images must be PNG at exactly the reference resolution.
22
+ - Point clouds must be valid PLY with finite x, y, z coordinates. Binary little-endian PLY with float32 coordinates is recommended to keep uploads small; store only the properties listed above (no colors/normals — they are ignored by the scorer and inflate the upload).
23
+ - Gold Coast point clouds additionally require an integer classification property with values in {0, 1, 2, 3, 4, 255}.
24
+
25
+ Note: see the CodaBench challenge page for the complete and authoritative submission rules.
26
+
27
+ ## Reference Implementations
28
+
29
+ These are starting points, not requirements. Any method that can be trained
30
+ on this challenge's COLMAP-format data and produce the outputs above is a
31
+ valid submission.
32
+
33
+ ### Basic Gaussian reconstruction
34
+
35
+ - **Original 3D Gaussian Splatting**
36
+ Code: https://github.com/graphdeco-inria/gaussian-splatting
37
+
38
+ - **gsplat**
39
+ Code: https://github.com/nerfstudio-project/gsplat
40
+ This is the Gaussian Splatting rasterization backend maintained by the
41
+ Nerfstudio team, and it is what Nerfstudio's own `splatfacto` method is
42
+ built on. If you are already comfortable with the Nerfstudio ecosystem
43
+ (data parsers, config system, viewer), this lets you stay in that workflow
44
+ instead of adapting the original repo above.
45
+
46
+ ### Geometry-oriented Gaussian reconstruction
47
+
48
+ For the TUM geometry track, these methods target more accurate surfaces
49
+ than vanilla 3DGS, which should help the F-score and Chamfer distance
50
+ metrics.
51
+
52
+ - **2D Gaussian Splatting**
53
+ Code: https://github.com/hbb1/2d-gaussian-splatting
54
+
55
+ - **PGSR**
56
+ Code: https://github.com/zju3dv/PGSR
57
+
58
+ Note: these methods represent the scene with different primitives than
59
+ vanilla 3DGS (oriented disks for 2DGS, planar Gaussians for PGSR). Most of
60
+ the semantic methods below are built as extensions of the original 3DGS
61
+ codebase and assume that representation, so they cannot simply be bolted
62
+ on top of a 2DGS or PGSR scene without adaptation.
63
+
64
+ ### Semantic Gaussian representation
65
+
66
+ For the Gold Coast semantic track:
67
+
68
+ - **Gaussian Grouping**
69
+ Code: https://github.com/lkeab/gaussian-grouping
70
+
71
+ - **Gaga**
72
+ Code: https://github.com/weijielyu/Gaga
73
+
74
+ - **OpenGaussian**
75
+ Code: https://github.com/yanmin-wu/OpenGaussian
76
+
77
+ - **LangSplat**
78
+ Code: https://github.com/minghanqin/LangSplat
79
+
80
+ Note: none of these methods directly output our required `classification`
81
+ values, and the extra step needed differs by method.
82
+
83
+ - Gaussian Grouping and Gaga group Gaussians using 2D masks (for example from
84
+ SAM) into class-agnostic instances: the result is a consistent object ID
85
+ per Gaussian, not a semantic class name, so you still need to map each
86
+ group to one of our 5 classes yourself.
87
+ - LangSplat and OpenGaussian instead train a further per-Gaussian feature on
88
+ top of an already-reconstructed scene and let you query open-vocabulary
89
+ text prompts: you still need an extra step to turn that similarity score
90
+ into one discrete class ID per point, using our 5 class names as the
91
+ prompts.
92
+
93
+ In both cases, turning the method's native output into our required PLY
94
+ `classification` property is left to you.
starting_kit/make_dummy_submission.py ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Creates a submission.zip with valid, correctly-sized and correctly-formatted
3
+ but randomly-generated content, so you can test your submission pipeline
4
+ (zip layout, image sizes, point cloud properties) before you have a trained
5
+ model. See this folder's README.md for the submission format this mirrors.
6
+
7
+ Only reads test/sparse/0/cameras.txt and images.txt from the dataset, so it
8
+ works for every scene, including final-testing scenes where the reference
9
+ photos and 3D ground truth are withheld.
10
+
11
+ Usage:
12
+ python make_dummy_submission.py --output submission.zip
13
+ """
14
+
15
+ import argparse
16
+ import io
17
+ import zipfile
18
+ from pathlib import Path
19
+
20
+ import numpy as np
21
+ from PIL import Image
22
+ from plyfile import PlyData, PlyElement
23
+
24
+ DATASET_ROOT = Path(__file__).resolve().parent.parent # Twinworld_Datasets/
25
+ DATASETS = {
26
+ "tum": "Data_TUM",
27
+ "gold_coast": "Data_Goldcoast",
28
+ }
29
+ NUM_POINTS = 2000
30
+ SEED = 0
31
+
32
+
33
+ def read_cameras_txt(path):
34
+ """Return {camera_id: (width, height)}."""
35
+ cameras = {}
36
+ with open(path) as f:
37
+ for line in f:
38
+ line = line.strip()
39
+ if not line or line.startswith('#'):
40
+ continue
41
+ parts = line.split()
42
+ camera_id = int(parts[0])
43
+ cameras[camera_id] = (int(parts[2]), int(parts[3]))
44
+ return cameras
45
+
46
+
47
+ def read_images_txt(path):
48
+ """Return [(name, camera_id), ...]. Each image occupies two lines; the
49
+ second (POINTS2D) line is not needed here and is skipped."""
50
+ with open(path) as f:
51
+ lines = [line for line in f if not line.startswith('#')]
52
+ entries = []
53
+ for i in range(0, len(lines), 2):
54
+ parts = lines[i].split()
55
+ if not parts:
56
+ continue
57
+ entries.append((parts[9], int(parts[8])))
58
+ return entries
59
+
60
+
61
+ def scene_frames(scene_dir):
62
+ """Return [(frame_stem, width, height), ...] for a scene's test poses."""
63
+ sparse_dir = scene_dir / "test" / "sparse" / "0"
64
+ cameras = read_cameras_txt(sparse_dir / "cameras.txt")
65
+ images = read_images_txt(sparse_dir / "images.txt")
66
+ return [(Path(name).stem, *cameras[camera_id]) for name, camera_id in images]
67
+
68
+
69
+ def random_png_bytes(width, height, rng):
70
+ pixels = rng.integers(0, 256, size=(height, width, 3), dtype=np.uint8)
71
+ buf = io.BytesIO()
72
+ Image.fromarray(pixels, mode="RGB").save(buf, format="PNG")
73
+ return buf.getvalue()
74
+
75
+
76
+ def random_point_cloud_bytes(num_points, rng, with_classification):
77
+ fields = [("x", "f4"), ("y", "f4"), ("z", "f4")]
78
+ if with_classification:
79
+ fields.append(("classification", "u1"))
80
+
81
+ vertex = np.empty(num_points, dtype=fields)
82
+ xyz = rng.uniform(-50.0, 50.0, size=(num_points, 3)).astype(np.float32)
83
+ vertex["x"], vertex["y"], vertex["z"] = xyz[:, 0], xyz[:, 1], xyz[:, 2]
84
+ if with_classification:
85
+ vertex["classification"] = rng.choice(
86
+ [0, 1, 2, 3, 4, 255], size=num_points).astype(np.uint8)
87
+
88
+ buf = io.BytesIO()
89
+ PlyData([PlyElement.describe(vertex, "vertex")], text=False, byte_order="<").write(buf)
90
+ return buf.getvalue()
91
+
92
+
93
+ def main():
94
+ parser = argparse.ArgumentParser(description=__doc__)
95
+ parser.add_argument("--output", type=Path, default=Path("submission.zip"),
96
+ help="output zip path")
97
+ parser.add_argument("--dataset_root", type=Path, default=DATASET_ROOT,
98
+ help="path to Twinworld_Datasets (containing Data_TUM/Data_Goldcoast)")
99
+ parser.add_argument("--num_points", type=int, default=NUM_POINTS,
100
+ help="random points per scene's point cloud")
101
+ parser.add_argument("--seed", type=int, default=SEED)
102
+ args = parser.parse_args()
103
+ rng = np.random.default_rng(args.seed)
104
+
105
+ n_scenes, n_frames = 0, 0
106
+ with zipfile.ZipFile(args.output, "w", zipfile.ZIP_DEFLATED) as zf:
107
+ for dataset_name, dir_name in DATASETS.items():
108
+ dataset_dir = args.dataset_root / dir_name
109
+ for scene_dir in sorted(dataset_dir.glob("scene_*")):
110
+ with_classification = dataset_name == "gold_coast"
111
+
112
+ for stem, width, height in scene_frames(scene_dir):
113
+ zf.writestr(f"{dataset_name}/{scene_dir.name}/rgb/{stem}.png",
114
+ random_png_bytes(width, height, rng))
115
+ n_frames += 1
116
+
117
+ ply_bytes = random_point_cloud_bytes(args.num_points, rng, with_classification)
118
+ zf.writestr(f"{dataset_name}/{scene_dir.name}/3D_point_cloud/point_cloud.ply",
119
+ ply_bytes)
120
+ n_scenes += 1
121
+
122
+ print(f"Wrote {args.output} ({n_scenes} scenes, {n_frames} rgb frames)")
123
+
124
+
125
+ if __name__ == "__main__":
126
+ main()