xcll commited on
Commit
4312a87
·
verified ·
1 Parent(s): 9e9a714

Add files using upload-large-folder tool

Browse files
COD10k.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7fa81830aaa7de55721527f73163396b3a62b379227c177c686d2d1168ab9587
3
+ size 422566861
DIS5K.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4c28757b49664dd78596b89fe006259f773cc791621521a8e3aaed1b1c72885
3
+ size 311916453
FIVES.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5bab9e73b47569c4be9e9813489e9f59ab1239a9f98e1d65898cf5b62787acf
3
+ size 167721325
MSFD.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a0e44e8450a4ddc1e706d8f0c8524b867acc8b2135bd3630a05faa3d1a9093eb
3
+ size 23585466
SAR.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a48c6933920d36896e4e2a776ae8eeec080622ac7c17d82c0a721c1442adb1a
3
+ size 32196156
TNBC.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b3b63abf3485f0c32577483ba653961dab46c1bd8077b8bb0f0ed0905821330
3
+ size 7165139
build.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a15ba5c1e6242d2882d57a29dad774d2b24e3cf28d6ffade51e42636fc0b842d
3
+ size 115234124
cig_butt.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2fe99e7f340326edc370eba22f346e0e5c6293008976d51031c7edfa3919254
3
+ size 46736143
crack.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71ec98c128c97757bce0879681736999aefca2a351307eb4dce563d315ab6d2f
3
+ size 13872443
crop_weed.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b4a981a4753b6ba57beddbc79479926e996fef8a24a01bcdfac23e659104a97
3
+ size 31558095
fire.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd48102dd0240b4ffed846d1cc10489f7d8632c768e14d30687c85290390f8c0
3
+ size 17288888
fog.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:937f3fd0a8941e5673c938a6a57475e9f8b7df113a3553813b5f8539f0a19308
3
+ size 231933404
fog_png.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a60ff659a503af4f53327f2e3c7bc0904756fb022b7d74f9cdfeb8dc1ed55028
3
+ size 70204792
h5_to_png.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import numpy as np
3
+ import h5py
4
+ from PIL import Image
5
+
6
+ def convert_h5_to_png(directory):
7
+ """
8
+ 将指定目录下所有.h5文件中的'depth'数据集转换为PNG图片
9
+ 确保0-1范围的值正确乘以255转换为0-255
10
+ 强制输出三通道PNG
11
+ """
12
+ for filename in os.listdir(directory):
13
+ if filename.endswith('.h5'):
14
+ h5_path = os.path.join(directory, filename)
15
+
16
+ try:
17
+ # 读取.h5文件
18
+ with h5py.File(h5_path, 'r') as f:
19
+ data = f['depth'][:]
20
+
21
+ # 确保数据在0-1范围内
22
+ if data.max() > 1.0 or data.min() < 0.0:
23
+ data = np.clip(data, 0, 1)
24
+ print(f"注意: {filename} 数据已裁剪到0-1范围")
25
+
26
+ # 关键步骤:乘以255并转换为uint8
27
+ img_data = (data * 255).astype(np.uint8)
28
+
29
+ # 通道处理(保证输出三通道)
30
+ if img_data.ndim == 2: # 单通道 (H,W)
31
+ img_data = np.stack([img_data]*3, axis=-1)
32
+ elif img_data.ndim == 3:
33
+ if img_data.shape[-1] == 1: # (H,W,1)
34
+ img_data = np.repeat(img_data, 3, axis=-1)
35
+ elif img_data.shape[-1] != 3: # 不是三通道
36
+ raise ValueError(f"不支持的通道数: {img_data.shape[-1]}")
37
+
38
+ # 保存PNG
39
+ png_path = os.path.join(directory, filename.replace('.h5', '.png'))
40
+ Image.fromarray(img_data, 'RGB').save(png_path, compress_level=0)
41
+ print(f"成功转换: {filename}")
42
+
43
+ except Exception as e:
44
+ print(f"处理 {filename} 失败: {str(e)}")
45
+
46
+ if __name__ == "__main__":
47
+ target_dir = r'/home/chengyou/xcl/OminiControl_2conditions_hf5/result_context/MSFD'
48
+ print(f"开始处理目录: {target_dir}")
49
+ convert_h5_to_png(target_dir)
50
+ print("转换完成!统计:")
51
+ print(f"处理目录: {target_dir}")
52
+ print(f"总处理文件数: {len([f for f in os.listdir(target_dir) if f.endswith('.h5')])}")
heart.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f9fc69f15706ef415c2fb345829f8475d41114df7d5365fec5f580b25cadba4
3
+ size 184911187
human_cortex.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:346752e9426ef2053a9a43c2da8e6530e59920feaa9563e0861f946f1d59d0af
3
+ size 56966407
overcast.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c26d669718af2f884f6747436cd060563901460c66eccdeb9ae01dc5c2a0f4e2
3
+ size 227318026
overcast_png.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de93a402b7b79f9e6835931211d791d623db7e1dba2cc38ce3fd13a0f3b3a479
3
+ size 56850944
pathhole.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b860f419861add4c8315eb751dd0a2e3ec6aeeb9ba5935d521fa1ca3e5be40c1
3
+ size 32844487
people.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc954ce042bba9d350b6eedb606fad3db88cf133ecfea05e7310813e22cb7f1e
3
+ size 26819833
rain.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e93a97ea6f9ad9d06003624e0840d66e8651259cd9ba866c382ac2ba31c087be
3
+ size 233015859
rain_png.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6164b5fe4f1d358dd23e6406fb69951814c55d86391624ca21d1048284d65ebb
3
+ size 59307768
rename.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ # 指定目录路径,替换为你的实际目录路径
4
+ directory = r'/home/chengyou/xcl/OminiControl_2conditions_hf5/result_context/COD10K'
5
+
6
+ # 遍历目录中的所有文件
7
+ for filename in os.listdir(directory):
8
+ if filename.endswith('.jpg'):
9
+ # 分割文件名和扩展名
10
+ base = os.path.splitext(filename)[0]
11
+ # 构建新的文件名
12
+ new_filename = base + '.h5'
13
+ # 重命名文件
14
+ os.rename(
15
+ os.path.join(directory, filename),
16
+ os.path.join(directory, new_filename)
17
+ )
18
+ print(f'Renamed: {filename} -> {new_filename}')
19
+
20
+ print("All .jpg files have been renamed to .h5")
road.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dd51139870dd7ae6c139e2f723123fd259f8746f9cded69b2d4be516776179ba
3
+ size 40377230
sea_cortex.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dcf34c42fc64b6a51d651c469ed8a336e1065ce08b9c59408b374181c27cb660
3
+ size 4264134
sos.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3833f39bd0a0747d735fcbd89d25ea60b36e0b1bbdfc0da1cf7ebbc6f6504a3
3
+ size 127864594
spine.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d232aa86bc89879f96afca23ee4bd08f81dc0e6623c074fba662334b7cabb819
3
+ size 96782577
sunrise.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4211259b04cbcb507445ce24aff3b4a260b1661dc2d37a4c8a9863dbb513926
3
+ size 231586278
sunrise_png.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:80e609199e0d30a266a5aac659ad1bf7438cbceaa7b35c751343b4af2cd4cefb
3
+ size 57977096
sunset.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a6c28dac2ccb0be98b5c3fc803ac12a9721c301da63b684ccbaa80c76d9a00e
3
+ size 230401235
sunset_png.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09a3786ea80670059dd3cfab722340e5b3d418dbc82b0581f80f4a0075f86c3f
3
+ size 57876010
tree.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8fef0081f3f1ac2b845095ceb3d20b88050cf87766c4acdb23cbe1dde6f6a1ae
3
+ size 464302832