INeedNZT commited on
Commit
77fb2cb
·
1 Parent(s): eff5902

Abandon using datasets, use git download instead

Browse files
Files changed (2) hide show
  1. tar_files.txt +0 -100
  2. waymo_train.py +0 -113
tar_files.txt DELETED
@@ -1,100 +0,0 @@
1
- segment-10017090168044687777_6380_000_6400_000_with_camera_labels.tfrecord.tar
2
- segment-10023947602400723454_1120_000_1140_000_with_camera_labels.tfrecord.tar
3
- segment-1005081002024129653_5313_150_5333_150_with_camera_labels.tfrecord.tar
4
- segment-10061305430875486848_1080_000_1100_000_with_camera_labels.tfrecord.tar
5
- segment-10072140764565668044_4060_000_4080_000_with_camera_labels.tfrecord.tar
6
- segment-10072231702153043603_5725_000_5745_000_with_camera_labels.tfrecord.tar
7
- segment-10075870402459732738_1060_000_1080_000_with_camera_labels.tfrecord.tar
8
- segment-10082223140073588526_6140_000_6160_000_with_camera_labels.tfrecord.tar
9
- segment-10094743350625019937_3420_000_3440_000_with_camera_labels.tfrecord.tar
10
- segment-10096619443888687526_2820_000_2840_000_with_camera_labels.tfrecord.tar
11
- segment-10107710434105775874_760_000_780_000_with_camera_labels.tfrecord.tar
12
- segment-10153695247769592104_787_000_807_000_with_camera_labels.tfrecord.tar
13
- segment-10206293520369375008_2796_800_2816_800_with_camera_labels.tfrecord.tar
14
- segment-10212406498497081993_5300_000_5320_000_with_camera_labels.tfrecord.tar
15
- segment-1022527355599519580_4866_960_4886_960_with_camera_labels.tfrecord.tar
16
- segment-10226164909075980558_180_000_200_000_with_camera_labels.tfrecord.tar
17
- segment-10231929575853664160_1160_000_1180_000_with_camera_labels.tfrecord.tar
18
- segment-10235335145367115211_5420_000_5440_000_with_camera_labels.tfrecord.tar
19
- segment-10241508783381919015_2889_360_2909_360_with_camera_labels.tfrecord.tar
20
- segment-10275144660749673822_5755_561_5775_561_with_camera_labels.tfrecord.tar
21
- segment-10327752107000040525_1120_000_1140_000_with_camera_labels.tfrecord.tar
22
- segment-10391312872392849784_4099_400_4119_400_with_camera_labels.tfrecord.tar
23
- segment-10444454289801298640_4360_000_4380_000_with_camera_labels.tfrecord.tar
24
- segment-10455472356147194054_1560_000_1580_000_with_camera_labels.tfrecord.tar
25
- segment-10485926982439064520_4980_000_5000_000_with_camera_labels.tfrecord.tar
26
- segment-10498013744573185290_1240_000_1260_000_with_camera_labels.tfrecord.tar
27
- segment-10500357041547037089_1474_800_1494_800_with_camera_labels.tfrecord.tar
28
- segment-10517728057304349900_3360_000_3380_000_with_camera_labels.tfrecord.tar
29
- segment-1051897962568538022_238_170_258_170_with_camera_labels.tfrecord.tar
30
- segment-10526338824408452410_5714_660_5734_660_with_camera_labels.tfrecord.tar
31
- segment-10584247114982259878_490_000_510_000_with_camera_labels.tfrecord.tar
32
- segment-10588771936253546636_2300_000_2320_000_with_camera_labels.tfrecord.tar
33
- segment-10596949720463106554_1933_530_1953_530_with_camera_labels.tfrecord.tar
34
- segment-10599748131695282446_1380_000_1400_000_with_camera_labels.tfrecord.tar
35
- segment-10625026498155904401_200_000_220_000_with_camera_labels.tfrecord.tar
36
- segment-10664823084372323928_4360_000_4380_000_with_camera_labels.tfrecord.tar
37
- segment-10676267326664322837_311_180_331_180_with_camera_labels.tfrecord.tar
38
- segment-10723911392655396041_860_000_880_000_with_camera_labels.tfrecord.tar
39
- segment-10724020115992582208_7660_400_7680_400_with_camera_labels.tfrecord.tar
40
- segment-10734565072045778791_440_000_460_000_with_camera_labels.tfrecord.tar
41
- segment-10750135302241325253_180_000_200_000_with_camera_labels.tfrecord.tar
42
- segment-10770759614217273359_1465_000_1485_000_with_camera_labels.tfrecord.tar
43
- segment-10786629299947667143_3440_000_3460_000_with_camera_labels.tfrecord.tar
44
- segment-10793018113277660068_2714_540_2734_540_with_camera_labels.tfrecord.tar
45
- segment-1083056852838271990_4080_000_4100_000_with_camera_labels.tfrecord.tar
46
- segment-10876852935525353526_1640_000_1660_000_with_camera_labels.tfrecord.tar
47
- segment-10923963890428322967_1445_000_1465_000_with_camera_labels.tfrecord.tar
48
- segment-10927752430968246422_4940_000_4960_000_with_camera_labels.tfrecord.tar
49
- segment-10940952441434390507_1888_710_1908_710_with_camera_labels.tfrecord.tar
50
- segment-10963653239323173269_1924_000_1944_000_with_camera_labels.tfrecord.tar
51
- segment-10964956617027590844_1584_680_1604_680_with_camera_labels.tfrecord.tar
52
- segment-10975280749486260148_940_000_960_000_with_camera_labels.tfrecord.tar
53
- segment-11004685739714500220_2300_000_2320_000_with_camera_labels.tfrecord.tar
54
- segment-11017034898130016754_697_830_717_830_with_camera_labels.tfrecord.tar
55
- segment-11060291335850384275_3761_210_3781_210_with_camera_labels.tfrecord.tar
56
- segment-11070802577416161387_740_000_760_000_with_camera_labels.tfrecord.tar
57
- segment-11076364019363412893_1711_000_1731_000_with_camera_labels.tfrecord.tar
58
- segment-11113047206980595400_2560_000_2580_000_with_camera_labels.tfrecord.tar
59
- segment-11119453952284076633_1369_940_1389_940_with_camera_labels.tfrecord.tar
60
- segment-11126313430116606120_1439_990_1459_990_with_camera_labels.tfrecord.tar
61
- segment-11139647661584646830_5470_000_5490_000_with_camera_labels.tfrecord.tar
62
- segment-11183906854663518829_2294_000_2314_000_with_camera_labels.tfrecord.tar
63
- segment-11199484219241918646_2810_030_2830_030_with_camera_labels.tfrecord.tar
64
- segment-11219370372259322863_5320_000_5340_000_with_camera_labels.tfrecord.tar
65
- segment-11236550977973464715_3620_000_3640_000_with_camera_labels.tfrecord.tar
66
- segment-11252086830380107152_1540_000_1560_000_with_camera_labels.tfrecord.tar
67
- segment-11318901554551149504_520_000_540_000_with_camera_labels.tfrecord.tar
68
- segment-11343624116265195592_5910_530_5930_530_with_camera_labels.tfrecord.tar
69
- segment-11355519273066561009_5323_000_5343_000_with_camera_labels.tfrecord.tar
70
- segment-11379226583756500423_6230_810_6250_810_with_camera_labels.tfrecord.tar
71
- segment-11388947676680954806_5427_320_5447_320_with_camera_labels.tfrecord.tar
72
- segment-11392401368700458296_1086_429_1106_429_with_camera_labels.tfrecord.tar
73
- segment-11454085070345530663_1905_000_1925_000_with_camera_labels.tfrecord.tar
74
- segment-1146261869236413282_1680_000_1700_000_with_camera_labels.tfrecord.tar
75
- segment-11486225968269855324_92_000_112_000_with_camera_labels.tfrecord.tar
76
- segment-11489533038039664633_4820_000_4840_000_with_camera_labels.tfrecord.tar
77
- segment-11566385337103696871_5740_000_5760_000_with_camera_labels.tfrecord.tar
78
- segment-11588853832866011756_2184_462_2204_462_with_camera_labels.tfrecord.tar
79
- segment-11623618970700582562_2840_367_2860_367_with_camera_labels.tfrecord.tar
80
- segment-11674150664140226235_680_000_700_000_with_camera_labels.tfrecord.tar
81
- segment-11718898130355901268_2300_000_2320_000_with_camera_labels.tfrecord.tar
82
- segment-1172406780360799916_1660_000_1680_000_with_camera_labels.tfrecord.tar
83
- segment-11799592541704458019_9828_750_9848_750_with_camera_labels.tfrecord.tar
84
- segment-11839652018869852123_2565_000_2585_000_with_camera_labels.tfrecord.tar
85
- segment-11846396154240966170_3540_000_3560_000_with_camera_labels.tfrecord.tar
86
- segment-11847506886204460250_1640_000_1660_000_with_camera_labels.tfrecord.tar
87
- segment-1191788760630624072_3880_000_3900_000_with_camera_labels.tfrecord.tar
88
- segment-11918003324473417938_1400_000_1420_000_with_camera_labels.tfrecord.tar
89
- segment-11925224148023145510_1040_000_1060_000_with_camera_labels.tfrecord.tar
90
- segment-11928449532664718059_1200_000_1220_000_with_camera_labels.tfrecord.tar
91
- segment-11940460932056521663_1760_000_1780_000_with_camera_labels.tfrecord.tar
92
- segment-11967272535264406807_580_000_600_000_with_camera_labels.tfrecord.tar
93
- segment-11971497357570544465_1200_000_1220_000_with_camera_labels.tfrecord.tar
94
- segment-12012663867578114640_820_000_840_000_with_camera_labels.tfrecord.tar
95
- segment-12027892938363296829_4086_280_4106_280_with_camera_labels.tfrecord.tar
96
- segment-1208303279778032257_1360_000_1380_000_with_camera_labels.tfrecord.tar
97
- segment-12161824480686739258_1813_380_1833_380_with_camera_labels.tfrecord.tar
98
- segment-12174529769287588121_3848_440_3868_440_with_camera_labels.tfrecord.tar
99
- segment-12179768245749640056_5561_070_5581_070_with_camera_labels.tfrecord.tar
100
- segment-12200383401366682847_2552_140_2572_140_with_camera_labels.tfrecord.tar
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
waymo_train.py DELETED
@@ -1,113 +0,0 @@
1
- # MIT License
2
- #
3
- # Copyright (c) 2024 Jingming Xia.
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
22
-
23
- """Waymo raw and depth map dataset."""
24
-
25
- import requests
26
- import datasets
27
-
28
-
29
- _DESCRIPTION = """\
30
- This dataset consists of raw and depth map data extracted from the first 100 TFRecords of the training portion of the Waymo Perception dataset.
31
- Specifically, each frame includes RGB images from three cameras (FRONT, FRONT_LEFT, FRONT_RIGHT) and depth maps generated from these cameras along with the TOP LiDAR sensor.
32
- """
33
-
34
- _HOMEPAGE = "https://waymo.com/open/data/perception"
35
-
36
- _LICENSE = "MIT License"
37
-
38
- def load_urls_from_repo(repo_url):
39
- response = requests.get(repo_url)
40
- response.raise_for_status()
41
- return [line.strip() for line in response.text.splitlines() if line.strip()]
42
-
43
- tar_files_list = load_urls_from_repo("https://huggingface.co/datasets/oceanfish/waymo_train/raw/main/tar_files.txt")
44
-
45
- _URLS = {
46
- "rgb": [f"rgb/{tar}" for tar in tar_files_list],
47
- "depth": [f"depth/{tar}" for tar in tar_files_list]
48
- }
49
-
50
- _IMG_EXTENSIONS = [".png"]
51
-
52
-
53
- class WaymoTrain(datasets.GeneratorBasedBuilder):
54
- """Waymo raw and depth map dataset."""
55
-
56
- VERSION = datasets.Version("1.1.0")
57
-
58
- def _info(self):
59
- # For each frame of rgbs and depth maps, there are FRONT, FRONT_LEFT, FRONT_RIGHT
60
- features = datasets.Features(
61
- {
62
- "rgb": datasets.Sequence(datasets.Value("binary")),
63
- "depth": datasets.Sequence(datasets.Value("binary"))
64
- }
65
- )
66
- return datasets.DatasetInfo(
67
- description=_DESCRIPTION,
68
- features=features,
69
- homepage=_HOMEPAGE,
70
- license=_LICENSE
71
- )
72
-
73
- def _is_image_file(self, filename):
74
- return any(filename.endswith(extension) for extension in _IMG_EXTENSIONS)
75
-
76
- def _split_generators(self, dl_manager):
77
- archives = dl_manager.download(_URLS)
78
-
79
- return [
80
- datasets.SplitGenerator(
81
- name=datasets.Split.TRAIN,
82
- gen_kwargs={
83
- "rgb_archives": [
84
- dl_manager.iter_archive(archive) for archive in archives["rgb"]
85
- ],
86
- "depth_archives": [
87
- dl_manager.iter_archive(archive) for archive in archives["depth"]
88
- ]
89
- },
90
- )
91
- ]
92
-
93
- def _generate_examples(self, rgb_archives, depth_archives):
94
- idx = 0
95
- for rgb_archive, depth_archive in zip(rgb_archives, depth_archives):
96
- rgb_iterator = iter(rgb_archive)
97
- depth_iterator = iter(depth_archive)
98
- try:
99
- while True:
100
- frame_rgbs = []
101
- frame_depths = []
102
-
103
- for _ in range(3):
104
- rgb_path, rgb_file = next(rgb_iterator)
105
- depth_path, depth_file = next(depth_iterator)
106
- if self._is_image_file(rgb_path) and self._is_image_file(depth_path):
107
- frame_rgbs.append(rgb_file.read())
108
- frame_depths.append(depth_file.read())
109
-
110
- yield idx, {"rgb": frame_rgbs, "depth": frame_depths}
111
- idx += 1
112
- except StopIteration:
113
- pass