(path)
| 26 | |
| 27 | from sat.data_utils import SimpleDistributedWebDataset, MetaDistributedWebDataset |
| 28 | def test_simpleds_reading(path): |
| 29 | def process_fn(stream): |
| 30 | for x in stream: |
| 31 | tmp1 = Image.open(io.BytesIO(x['jpg'])).convert('RGB') |
| 32 | yield tmp1 |
| 33 | |
| 34 | d = SimpleDistributedWebDataset(path, process_fn, 0) |
| 35 | it = iter(d) |
| 36 | t = time.time() |
| 37 | for i in range(2048): |
| 38 | tmp = next(it) |
| 39 | print("SimpleDS: Time to read 2048 images: ", time.time() - t) |
| 40 | |
| 41 | def test_metads_reading(path): |
| 42 | def process_fn(stream): |
nothing calls this directly
no test coverage detected