LuMonDepth commited on
Commit
9fec5ed
·
verified ·
1 Parent(s): 4dbcf3f

Add files using upload-large-folder tool

Browse files
collect_left_images.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Collect left images from 2C_rectified_images/pair1..pair168 into ./images.
3
+
4
+ Each left image is saved as a 3-digit name (001.png, 002.png, ...). Only the first
5
+ PNG found under each pair's left/ folder is used. Existing targets are left intact
6
+ to avoid overwriting.
7
+ """
8
+ from __future__ import annotations
9
+
10
+ import shutil
11
+ from pathlib import Path
12
+
13
+
14
+ def main() -> None:
15
+ root = Path(__file__).resolve().parent
16
+ source_root = root / "2C_rectified_images"
17
+ dest_dir = root / "images"
18
+ dest_dir.mkdir(exist_ok=True)
19
+
20
+ for idx in range(1, 169):
21
+ pair_left = source_root / f"pair{idx}" / "left"
22
+ if not pair_left.is_dir():
23
+ print(f"[skip] {pair_left} not found")
24
+ continue
25
+
26
+ png_files = sorted(p for p in pair_left.iterdir() if p.is_file() and p.suffix.lower() == ".png")
27
+ if not png_files:
28
+ print(f"[skip] no .png in {pair_left}")
29
+ continue
30
+ if len(png_files) > 1:
31
+ print(f"[warn] multiple .png in {pair_left}; using first: {png_files[0].name}")
32
+
33
+ source = png_files[0]
34
+ target = dest_dir / f"{idx:03d}.png"
35
+
36
+ if target.exists():
37
+ print(f"[skip] {target.name} already exists; not overwriting")
38
+ continue
39
+
40
+ # Move to avoid duplicating storage. Change to copy2 if you prefer copying instead.
41
+ shutil.move(str(source), target)
42
+ print(f"[ok] {pair_left.parent.name} left -> {target.name}")
43
+
44
+ print(f"Done. Files gathered in {dest_dir}")
45
+
46
+
47
+ if __name__ == "__main__":
48
+ main()
masks/003.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72ca51eff29763c617783af73facfc4a94e2fecac9d4d3c625cc9f74ceb769ab
3
+ size 4064384
masks/004.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2a8aa1b721b1025e258424100c37f5a262e513773ac05688cf1a076a404a6ba
3
+ size 4064384
masks/008.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0572641279abec930b241b08548946e4b9828ed6f5db73963b8595b6527b9722
3
+ size 4064384
masks/018.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ea78d0edecd9ecf2b75e87b52f4ecfdf5ed3b13805997fc9d2fe7d0fafe4b8a
3
+ size 4064384
masks/021.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1aa8e14f3f9ac40f7bf93203a2790f07f6b20bb933581bf87e5f33de4f9df733
3
+ size 4064384
masks/023.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35ddd4697ce417fbb6cd90732b3e40b01c707dacc08066fdace91fe6ef27dd0e
3
+ size 4064384
masks/029.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:424e5473f71c265802cc41121b0f011c7b84d10c515cdeda9d2272f78d2416d6
3
+ size 4064384
masks/032.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6935adf1e7f2063b55688c298a395e325e2a3953ff2a71c8f96d088756b9a2ec
3
+ size 4064384
masks/035.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c80edd1faa1f4b2f45a8708dca1620c1cb5bc778f87223be72d3105b753dba73
3
+ size 4064384
masks/049.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0acba4d5c0aaa00ba9600a0c49e04da6fcce77bbeba70b665dbea7ce7015cb0d
3
+ size 4064384
masks/055.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d30145051e129e9ee8b1028747f3a7e09ca0babd7c3aa37d80705f620a2d71a2
3
+ size 4064384
masks/057.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4801cea1c46d2311a11fdff124a2bd6c758fd3f599ccfdec0463e7dec06781c
3
+ size 4064384
masks/058.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:80633a9c99c831149f090f6dae4f3e8ef1b61517efff99fd3cff3e35bf5ed929
3
+ size 4064384
masks/061.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0c05249c71792f58c60d972ba5c021479639f13bb9ba6508c4c14172d1e4a00
3
+ size 4064384
masks/062.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ea6ad5cfee4823caa2791b6e420885f44a661d5563e2d74e268e0492076c567
3
+ size 4064384
masks/064.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a116ff975482ce2f28b4830e27db0ecd681df9457897f743c4f303e3604daea7
3
+ size 4064384
masks/065.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09be02e3de2e83a6e582faa30e42f4ec3262ffe347ad316fcc63597b887aa77f
3
+ size 4064384
masks/072.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dab2afe5aaceac6f448d4c4127172d33b6c84a23f870accb464c2e3a3cc37d68
3
+ size 4064384
masks/073.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21245ce6d7a872671c3aca7a0125eaeb80fbec3253140d5abced4604f27e1317
3
+ size 4064384
masks/074.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:435bad697422c66efe93d0b5454c6235a2510dfac157afa3cd78e80f92638e42
3
+ size 4064384
masks/075.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bb061ed9db1ae5196a60f1fa5b0282aa439b5efee0dd4a99463a62ab2b680c7c
3
+ size 4064384
masks/082.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:88335020d3574dcac02b442c6699c1d1395a0fe90cd4d7e29958c53228a17f0e
3
+ size 4064384
masks/083.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8af92cbcc5b6c8ed6cdab727454b3ae16b8575d6ad1ec9c9e3c0ce7997c8f9b
3
+ size 4064384
masks/093.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e8fbd048c26df0c4d6126701fd49edf534347817e41e631f2bfb60d37f57dbc
3
+ size 4064384
masks/095.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5408b3c47731fcd8bf3b42188b68a4f7d4c29dec933bcc4ff533f86bfbfe0279
3
+ size 4064384
masks/098.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:60b62610b4f9edd892ab0fa5ec547acbc130a70931a05afd7caf1bad4583515b
3
+ size 4064384
masks/099.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0239729febe5a330d2ee380f02d138ddd5148b045e5a61f9ebbe25d6fbc9bd2f
3
+ size 4064384
masks/106.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:debed2074f20b521e2803ffc54d63a7b0404236fc11a62a8a388d93eebc1152b
3
+ size 4064384
masks/109.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a84834de912cabce124e447874b217279d0ea1e68c2e179b11ba58903dee1262
3
+ size 4064384
masks/111.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4f9fdedb33ee9b2a93f28db5cfd5b17ee8a8cab20dfab43ac68ba8768a4187a8
3
+ size 4064384
masks/114.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34089060af44b0cd4744e4bb25618ccebb7a019ebd6c0e8f85c234bc44a53631
3
+ size 4064384
masks/116.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d1960bae67a752727f276a5ff7dbcc4390249a73abe9a71bf5f8e29e40d4769c
3
+ size 4064384
masks/120.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4892d858da66fb12b1ff4422d04ec12aa4a9856454d48da2088c26838f680f99
3
+ size 4064384
masks/121.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12c0a9f201bf2a7f8460ccd9c40fe81465fb470dff01013a1558cdd5f8f4fa0c
3
+ size 4064384
masks/129.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1686bca63a28c61b2676d003e9036ca95ae35a161de76042d3a745d419ed22bf
3
+ size 4064384
masks/132.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6617831af6affe9164ccee250fcf37275b7e6d80b581091c914eae5f7c9d3669
3
+ size 4064384
masks/137.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0360926c4b8f2f8522caf50551d4e83e4802f97cd42686da4db8c1f48298b687
3
+ size 4064384
masks/139.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:053aca3c74404ecb4daf62681349df48050c5f38fac64a60a8e83d4bd548f14f
3
+ size 4064384
masks/147.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94265ca37617f2ff2183c2109618b99de7afa4644f21f30e3564857a150e80f1
3
+ size 4064384
masks/152.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8457a8a4ea4e48288af5634ced47edc1730110c46db1920070dbe398e7569345
3
+ size 4064384
masks/156.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd4cc2f3a6680c8933ee7242934a28b85f88bb10ed7f9b71f0a674d0d564d92e
3
+ size 4064384
masks/157.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a125b3564bfb783b00162960c946850c9330cb714b1e27e8fbdac146f032a837
3
+ size 4064384
masks/158.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f7ac6452d380d666ed57fdd12834d312b21bd6306f33b27ae4a58668875e8b7
3
+ size 4064384
masks/160.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4f3701edd844509469f7b20b82967a04ee93cf9fe623231bedbacd0f5595c66
3
+ size 4064384
masks/161.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e8e298fe076c80a0876b426ed3358090912c1a9eec4a483a9baa94fcf4447e7
3
+ size 4064384
masks/166.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9fa75764a16e59a249d579afce3ad4555b8df73e7e7afb192ea03965cc2064e
3
+ size 4064384
masks/167.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5d467426ef34fbfdb87ad144cb35c5138b6c62b6801afb541a1de801f18b3662
3
+ size 4064384
move_depth_files.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Collect .npy files from pair1..pair168 into ./depth as 3-digit names."""
3
+ from __future__ import annotations
4
+
5
+ import shutil
6
+ from pathlib import Path
7
+
8
+
9
+ def main() -> None:
10
+ root = Path(__file__).resolve().parent
11
+ dest_dir = root / "depth"
12
+ dest_dir.mkdir(exist_ok=True)
13
+
14
+ for idx in range(1, 169):
15
+ pair_dir = root / f"pair{idx}"
16
+ if not pair_dir.is_dir():
17
+ print(f"[skip] {pair_dir.name} not found")
18
+ continue
19
+
20
+ npy_files = list(pair_dir.glob("*.npy"))
21
+ if not npy_files:
22
+ print(f"[skip] no .npy in {pair_dir.name}")
23
+ continue
24
+ if len(npy_files) > 1:
25
+ print(f"[warn] multiple .npy in {pair_dir.name}; using first: {npy_files[0].name}")
26
+
27
+ source = npy_files[0]
28
+ target = dest_dir / f"{idx:03d}.npy"
29
+
30
+ # Move to avoid duplicates in source folders. Change to copy2 if you prefer copying.
31
+ shutil.move(str(source), target)
32
+ print(f"[ok] {pair_dir.name} -> {target.name}")
33
+
34
+ print(f"Done. Files gathered in {dest_dir}")
35
+
36
+
37
+ if __name__ == "__main__":
38
+ main()
rename_images.py ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Rename PNG files in ./images to sequential 3-digit names (001.png, 002.png, ...).
3
+
4
+ Files are processed in ascending order by current filename. Renaming is collision-safe
5
+ via a temporary suffix.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ from pathlib import Path
10
+ import uuid
11
+
12
+
13
+ def main() -> None:
14
+ root = Path(__file__).resolve().parent
15
+ images_dir = root / "images"
16
+ if not images_dir.is_dir():
17
+ raise SystemExit("images directory not found")
18
+
19
+ # Collect and sort .png files (case-insensitive extension match)
20
+ png_files = sorted(
21
+ [p for p in images_dir.iterdir() if p.is_file() and p.suffix.lower() == ".png"],
22
+ key=lambda p: p.name,
23
+ )
24
+
25
+ if not png_files:
26
+ print("No .png files found")
27
+ return
28
+
29
+ # First pass: rename to unique temp names to avoid collisions
30
+ temp_map = {}
31
+ for idx, src in enumerate(png_files, start=1):
32
+ target_name = f"{idx:03d}.png"
33
+ if src.name == target_name:
34
+ temp_map[src] = src # No move needed later
35
+ continue
36
+ temp_name = f".{src.stem}.{uuid.uuid4().hex}.tmp"
37
+ temp_path = images_dir / temp_name
38
+ src.rename(temp_path)
39
+ temp_map[src] = temp_path
40
+
41
+ # Second pass: move temps (or originals) to final names
42
+ for idx, src in enumerate(png_files, start=1):
43
+ target = images_dir / f"{idx:03d}.png"
44
+ current = temp_map[src]
45
+ if current == target:
46
+ print(f"[ok] {target.name} unchanged")
47
+ continue
48
+ current.rename(target)
49
+ print(f"[ok] {current.name} -> {target.name}")
50
+
51
+ print("Done.")
52
+
53
+
54
+ if __name__ == "__main__":
55
+ main()