Hello, How to read specific files (images) based ...
# questions
a
Hello, How to read specific files (images) based on the filename prefix (as example) ? I'm using Partioned Dataset to read and write images with a specific extra dataset. My folder is organized as follow with more than (120.000 images):
Department 1
|-> Zone 1
|---> IMG_00001.tif
|---> MSK_00001.tif
I need to read first IMG_*****.tif then MSK_*****.tif is it possible ? Thanks for your help
Copy code
raw_images:
  type: PartitionedDataSet
  dataset:
    type: flair_ign.extras.datasets.satellite_image.SatelliteImageDataSet
  path: /home/ubuntu/train
  filename_suffix: .tif
  layer: raw
d
I don't think this is directly possible. You can either: 1. modify
ParitionedDataSet
to accept
filename_prefix
, and change the check from
path.endswith(filename_suffix)
to also include this (there are some other changes required, and there are some decisions that might slow down adding this as a feature directly, but it should be pretty straightforward if you want to modify the dataset implementation 2. when you iterate over the list of partitions in the node, just throw out anything ending in
MSK_*.tif
to read
IMG_*.tif
and vice versa. Performance-wise, no big deal, since files are lazy-loaded anyway
👍 1