Add files using upload-large-folder tool
Browse files- UrbanSound/gun_shot/102305.wav +3 -0
- UrbanSound/gun_shot/133797_000.wav +3 -0
- UrbanSound/gun_shot/135527_002.wav +3 -0
- UrbanSound/gun_shot/135528_002.wav +3 -0
- UrbanSound/gun_shot/135528_003.wav +3 -0
- UrbanSound/gun_shot/135544_000.wav +3 -0
- UrbanSound/gun_shot/136399_000.wav +3 -0
- UrbanSound/gun_shot/145608.wav +3 -0
- UrbanSound/gun_shot/148166.wav +3 -0
- UrbanSound/gun_shot/148833.wav +3 -0
- UrbanSound/gun_shot/148834.wav +3 -0
- UrbanSound/gun_shot/151065.wav +3 -0
- UrbanSound/gun_shot/156897_000.wav +3 -0
- UrbanSound/gun_shot/157799.wav +3 -0
- UrbanSound/gun_shot/157800.wav +3 -0
- UrbanSound/gun_shot/158979.wav +3 -0
- UrbanSound/gun_shot/159701.wav +3 -0
- UrbanSound/gun_shot/159707.wav +3 -0
- UrbanSound/gun_shot/161195.wav +3 -0
- UrbanSound/gun_shot/162432_000.wav +3 -0
- UrbanSound/gun_shot/162433.wav +3 -0
- UrbanSound/gun_shot/162435.wav +3 -0
- UrbanSound/gun_shot/174282_000.wav +3 -0
- UrbanSound/gun_shot/174282_001.wav +3 -0
- UrbanSound/gun_shot/174282_003.wav +3 -0
- UrbanSound/gun_shot/174282_005.wav +3 -0
- UrbanSound/gun_shot/174282_006.wav +3 -0
- UrbanSound/gun_shot/174284_000.wav +3 -0
- UrbanSound/gun_shot/174284_002.wav +3 -0
- UrbanSound/gun_shot/174284_003.wav +3 -0
- UrbanSound/gun_shot/174284_004.wav +3 -0
- UrbanSound/gun_shot/174285_000.wav +3 -0
- UrbanSound/gun_shot/174287_000.wav +3 -0
- UrbanSound/gun_shot/174289_000.wav +3 -0
- UrbanSound/gun_shot/174292_000.wav +3 -0
- UrbanSound/gun_shot/191449.wav +3 -0
- UrbanSound/gun_shot/197320_000.wav +3 -0
- UrbanSound/gun_shot/24631_000.wav +3 -0
- UrbanSound/gun_shot/24632_003.wav +3 -0
- UrbanSound/gun_shot/24632_005.wav +3 -0
- UrbanSound/gun_shot/24652_003.wav +3 -0
- UrbanSound/gun_shot/25037.wav +3 -0
- UrbanSound/gun_shot/25039.wav +3 -0
- UrbanSound/gun_shot/36403_000.wav +3 -0
- UrbanSound/gun_shot/46656.wav +3 -0
- UrbanSound/gun_shot/7067.wav +3 -0
- UrbanSound/gun_shot/76090.wav +3 -0
- UrbanSound/gun_shot/77246.wav +3 -0
- devide.py +57 -0
- statistic.py +89 -0
UrbanSound/gun_shot/102305.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d940b160212d48e038174c467350e77ebf973b0ba23423e077b589342358d996
|
| 3 |
+
size 230388
|
UrbanSound/gun_shot/133797_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:12bb4e6e0c327a8c22cbf67f21e2facf2eaf7a6eb284fcf5a724f5d3ee3bf358
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/135527_002.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61b7fcd213dcacd7c72edbd065c059bc71392a62461227ebf9a335c06281a621
|
| 3 |
+
size 1323044
|
UrbanSound/gun_shot/135528_002.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1d38322d18e661c1723a94078767481251d3e606daae53a9ad0e2ff6a4a6664a
|
| 3 |
+
size 1323044
|
UrbanSound/gun_shot/135528_003.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:403a5724b7adedf0a51f0984cd50a520a5fad8921a0b080694a10a6960fb20d5
|
| 3 |
+
size 1323044
|
UrbanSound/gun_shot/135544_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e657435888b056ead4dc3e1daca5189e9cd33ce310ce2ca3c68f9d5ecae3197b
|
| 3 |
+
size 1323044
|
UrbanSound/gun_shot/136399_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3f84acb4f01ab6c1f2b01bb17a8de1fc71d467784c7eaf6fbd56d59f6435277e
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/145608.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:89310d1fdac858fdb2185e7314a65fc14c8d27d271e9a4e0ec963bc5a86b844a
|
| 3 |
+
size 2086952
|
UrbanSound/gun_shot/148166.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:69e4674b16a382f536e4c3707e0891a1521e7ca810f10e3866c56a3007ecb5a5
|
| 3 |
+
size 97324
|
UrbanSound/gun_shot/148833.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bafbae023e6bde6fc939df88e703f5587af7c36606b2d4d0f38eb314e1c0f2ac
|
| 3 |
+
size 523052
|
UrbanSound/gun_shot/148834.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f6b130b679d818ff8c9c349739c8f1cafb75711b1a6538d88ca16225e61b65f2
|
| 3 |
+
size 140588
|
UrbanSound/gun_shot/151065.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dcb9071601e05a7ce9cfdac36985f787209ce9207a96c55bd3b277ea0190662f
|
| 3 |
+
size 155202
|
UrbanSound/gun_shot/156897_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0eb588c5f2eb384a670279d5a6b78f6960faaf4d4729d28746395a3a2824b4f5
|
| 3 |
+
size 1323044
|
UrbanSound/gun_shot/157799.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:414ec0b68eaa60cee6561ddf8b1edb02381888109b25cbd61f7caa2a1c291a27
|
| 3 |
+
size 202796
|
UrbanSound/gun_shot/157800.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6c3ed162996db7933493ef1dd0a3b376699c20ef353263da70c10fa7f0c14fe6
|
| 3 |
+
size 103724
|
UrbanSound/gun_shot/158979.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:548489223e92ddd7a1411417454df7710855209bccfd959428022081a0c8c560
|
| 3 |
+
size 241284
|
UrbanSound/gun_shot/159701.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e3c6aafc5972e19f17d91d9f79993c03cbf94acad620a467155616bb891a4586
|
| 3 |
+
size 1354796
|
UrbanSound/gun_shot/159707.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7708dcafdd1282dc5837f594c2c016fcc23d2d83b6b04dc2dd8b807a9322132f
|
| 3 |
+
size 311340
|
UrbanSound/gun_shot/161195.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fae460b587ea4e72efc1a7acca63725c095274949c81a94d53e3a2e47bdd5d3c
|
| 3 |
+
size 70598
|
UrbanSound/gun_shot/162432_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d43a349444470aa3265147e37db5623abb10ca1eaae0a720ca4bb6f7bf0750d6
|
| 3 |
+
size 2880044
|
UrbanSound/gun_shot/162433.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:02542c9b20325015d616fc44809865adc3f306409eb7992aeac90ab47f0c66ab
|
| 3 |
+
size 917594
|
UrbanSound/gun_shot/162435.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac4ff05428e411f41bb8540c00a917f1fdd6472b54b54d09473a2b6816f1f8a7
|
| 3 |
+
size 576856
|
UrbanSound/gun_shot/174282_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:58198bdd05d9e9998dc78bc9af0a8d7d8ea48d338887b381550858aab1523d70
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/174282_001.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e0805ca8cdff022e6e49fed57205be70a82279eb67de592ac7cd14d39daf4b11
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/174282_003.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1cfd0e76facc0dde2eb5ce95feee06987ac56035e3ccbbe3989b3d81b38e2c17
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/174282_005.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:290be73071b7b7063d00f8ff4411e37bb882bc3146f6c16969bc1149ba8804b7
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/174282_006.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:04288e3497153056670016f8acd8bb846e62bf3af98a517636bde4f178aa5238
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/174284_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4a0b4b97ddfdf2917e6d889e25d6e5a3798b40f1573acd3154e1b822312cffc3
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/174284_002.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08b655c693c3f458ea266450702e13762742aaf8681171f0ff13ba1796f458bd
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/174284_003.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3a549856be626f19571fb3c80c8bdeb392dcacfb7011250fce78022449412136
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/174284_004.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eee90afc00da62b5bc00955ee59039550b90b016c77c9122d933f3d91854b565
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/174285_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fee7195653fb226afb3c8a9714beb79346fce3bd16c087a0083ab9c9584a6e4c
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/174287_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:78fdd0346eed111a04686aa6f08f6553d4b5e7258820dbb9b4d60816b3c1c30d
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/174289_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ebf14ad4a074df7c28244e83b926882a68a93af30a17279424f991e2ffe13245
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/174292_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d0aee659989e0d2f2ea638de603a7a22f7969e6b328def7b46f6bb2d950ca06
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/191449.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d3c9424e3b372ee035e3fb257e072af196f50af5b7bef839e85e21d3ade388b
|
| 3 |
+
size 867972
|
UrbanSound/gun_shot/197320_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:122e0d0b0d3966a4c191aa798aeef709ce72d90a993e036ae64fc82b60db2019
|
| 3 |
+
size 1440044
|
UrbanSound/gun_shot/24631_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:18d56c2ebeccb9536069969be4bdb3702fbb7e60ef03eb900a1f3237a96775fa
|
| 3 |
+
size 1323044
|
UrbanSound/gun_shot/24632_003.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:30ba0233ce000c493432317bda04ef9468622f7a821e7a3ef2ec01af88d3b06f
|
| 3 |
+
size 1323044
|
UrbanSound/gun_shot/24632_005.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3bb2fc2bb0fc51c5ca148121a343d8d63b26367b22d66fface10bf699aa9e445
|
| 3 |
+
size 1323044
|
UrbanSound/gun_shot/24652_003.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08ab03d8d344a3260933f705ad5662c7a0bfa12093e114797eb6466462289ab8
|
| 3 |
+
size 1323044
|
UrbanSound/gun_shot/25037.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9132235ad1ccd563f6b0d0b22d97871eb99200faf78621d8907d93b6428841c4
|
| 3 |
+
size 278238
|
UrbanSound/gun_shot/25039.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:299e8432a7e1037cdaa701588d17df7730db61c131da66bb905ee5bbbe5b20cb
|
| 3 |
+
size 348664
|
UrbanSound/gun_shot/36403_000.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ca5b014a2a84a507d4e991aca1eb623e5eab16dc2c14d2ed75ca7aa3f23b59e3
|
| 3 |
+
size 1323044
|
UrbanSound/gun_shot/46656.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:48e2f2048a08ff0bcc518a72645f42ea9e3a3e6eb877a0a6504240b18697726d
|
| 3 |
+
size 1272898
|
UrbanSound/gun_shot/7067.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a91a33ed54c96134a1c9585083a2d2c1e7b7b994f886047aa2af2d22c2305c56
|
| 3 |
+
size 326226
|
UrbanSound/gun_shot/76090.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f9b30caf53090bf91da2f1a12e10dafbcdf31915feb31ae26a8efdadc4a1b73c
|
| 3 |
+
size 218188
|
UrbanSound/gun_shot/77246.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:624422ecfb17cf130bb0d730fef0a7bd9f19cb334bc94c2e5fb2fc60d63c1ec0
|
| 3 |
+
size 340406
|
devide.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import shutil
|
| 3 |
+
|
| 4 |
+
ROOT = "./"
|
| 5 |
+
MAX_FILES = 8000 # 每个子目录最多文件数
|
| 6 |
+
|
| 7 |
+
def split_directory(dirpath):
|
| 8 |
+
"""
|
| 9 |
+
将 dirpath 下的直接文件分成 part_xxx 子目录
|
| 10 |
+
"""
|
| 11 |
+
print(f"→ Splitting directory: {dirpath}")
|
| 12 |
+
|
| 13 |
+
files = [
|
| 14 |
+
f for f in os.listdir(dirpath)
|
| 15 |
+
if os.path.isfile(os.path.join(dirpath, f))
|
| 16 |
+
]
|
| 17 |
+
|
| 18 |
+
total = len(files)
|
| 19 |
+
print(f" Found {total} files.")
|
| 20 |
+
|
| 21 |
+
# 按 MAX_FILES 分块
|
| 22 |
+
for idx in range(0, total, MAX_FILES):
|
| 23 |
+
part = idx // MAX_FILES
|
| 24 |
+
subdir = os.path.join(dirpath, f"part_{part:03d}")
|
| 25 |
+
os.makedirs(subdir, exist_ok=True)
|
| 26 |
+
|
| 27 |
+
for filename in files[idx: idx + MAX_FILES]:
|
| 28 |
+
src = os.path.join(dirpath, filename)
|
| 29 |
+
dst = os.path.join(subdir, filename)
|
| 30 |
+
shutil.move(src, dst)
|
| 31 |
+
|
| 32 |
+
print(f" - Created {subdir}")
|
| 33 |
+
|
| 34 |
+
print(f"✔ Completed: {dirpath}\n")
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def walk_and_process(root):
|
| 38 |
+
"""
|
| 39 |
+
递归遍历整个目录树,发现需要拆分的目录就拆分
|
| 40 |
+
"""
|
| 41 |
+
for dirpath, dirnames, filenames in os.walk(root):
|
| 42 |
+
# 过滤掉我们自己创建的 part_000/part_001 目录,避免再次处理
|
| 43 |
+
dirnames[:] = [d for d in dirnames if not d.startswith("part_")]
|
| 44 |
+
|
| 45 |
+
file_count = len([
|
| 46 |
+
f for f in filenames
|
| 47 |
+
if os.path.isfile(os.path.join(dirpath, f))
|
| 48 |
+
])
|
| 49 |
+
|
| 50 |
+
if file_count > 10000:
|
| 51 |
+
print(f"▶ Found big directory: {dirpath} ({file_count} files)")
|
| 52 |
+
split_directory(dirpath)
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
if __name__ == "__main__":
|
| 56 |
+
walk_and_process(ROOT)
|
| 57 |
+
print("🎉 All oversized directories processed.")
|
statistic.py
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# -*- coding: utf-8 -*-
|
| 3 |
+
|
| 4 |
+
import os
|
| 5 |
+
import librosa
|
| 6 |
+
from collections import Counter
|
| 7 |
+
from tqdm import tqdm
|
| 8 |
+
import sys
|
| 9 |
+
|
| 10 |
+
def is_leaf_dir(path):
|
| 11 |
+
"""判断是否为最原子的子文件夹(无子文件夹)"""
|
| 12 |
+
for item in os.listdir(path):
|
| 13 |
+
if os.path.isdir(os.path.join(path, item)):
|
| 14 |
+
return False
|
| 15 |
+
return True
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def get_wav_length(path):
|
| 19 |
+
try:
|
| 20 |
+
y, sr = librosa.load(path, sr=None, mono=True)
|
| 21 |
+
return round(len(y) / sr)
|
| 22 |
+
except Exception as e:
|
| 23 |
+
print(f"读取失败: {path} 错误: {e}")
|
| 24 |
+
return None
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def main(noise_root):
|
| 28 |
+
noise_root = os.path.abspath(noise_root)
|
| 29 |
+
|
| 30 |
+
print("扫描所有 leaf(最原子)子文件夹...\n")
|
| 31 |
+
leaf_dirs = []
|
| 32 |
+
|
| 33 |
+
# 遍历 noise 根目录下所有文件夹
|
| 34 |
+
for dataset in os.listdir(noise_root): # MUSAN、DEMAND、ESC50 …
|
| 35 |
+
dataset_path = os.path.join(noise_root, dataset)
|
| 36 |
+
if not os.path.isdir(dataset_path):
|
| 37 |
+
continue
|
| 38 |
+
|
| 39 |
+
# 深度遍历,找所有最原子的子文件夹
|
| 40 |
+
for root, dirs, files in os.walk(dataset_path):
|
| 41 |
+
if is_leaf_dir(root):
|
| 42 |
+
leaf_dirs.append(root)
|
| 43 |
+
|
| 44 |
+
print("发现的 leaf 文件夹:")
|
| 45 |
+
for d in leaf_dirs:
|
| 46 |
+
print(" -", d)
|
| 47 |
+
|
| 48 |
+
print("\n开始统计...\n")
|
| 49 |
+
|
| 50 |
+
all_results = {}
|
| 51 |
+
|
| 52 |
+
for leaf in leaf_dirs:
|
| 53 |
+
counter = Counter()
|
| 54 |
+
wav_count = 0
|
| 55 |
+
|
| 56 |
+
# 遍历该 leaf 下的所有 wav
|
| 57 |
+
for f in tqdm(os.listdir(leaf), desc=f"[{leaf}]"):
|
| 58 |
+
if not f.lower().endswith(".wav"):
|
| 59 |
+
continue
|
| 60 |
+
|
| 61 |
+
wav_count += 1
|
| 62 |
+
path = os.path.join(leaf, f)
|
| 63 |
+
L = get_wav_length(path)
|
| 64 |
+
if L is not None:
|
| 65 |
+
counter[L] += 1
|
| 66 |
+
|
| 67 |
+
all_results[leaf] = (wav_count, counter)
|
| 68 |
+
|
| 69 |
+
# 打印结果
|
| 70 |
+
print("\n============== 统计结果 ==============\n")
|
| 71 |
+
|
| 72 |
+
for leaf, (cnt, dist) in all_results.items():
|
| 73 |
+
print(f"📁 {leaf}")
|
| 74 |
+
print(f" WAV 数量:{cnt}")
|
| 75 |
+
print(" 时长分布(秒):")
|
| 76 |
+
for L in sorted(dist):
|
| 77 |
+
print(f" {L:2d}s : {dist[L]}")
|
| 78 |
+
print()
|
| 79 |
+
|
| 80 |
+
print("统计完成!")
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
if __name__ == "__main__":
|
| 84 |
+
if len(sys.argv) < 2:
|
| 85 |
+
print("用法: python stats_leaf_folders.py <noise根目录>")
|
| 86 |
+
print("示例: python stats_leaf_folders.py noise")
|
| 87 |
+
sys.exit(1)
|
| 88 |
+
|
| 89 |
+
main(sys.argv[1])
|