Skip to content
Advertisement

Loading a .tiff dataset in FiftyOne through browser

I have a .tiff image dataset that I want to load in FiftyOne. I’ve gone through the Docs and only found Geotiff dataType so I load it as a fiftyone.types.ImageDirectory. I got: Type image/tiff may not be supported.
Came on SOF searching for a solution and came across this answer from Eric https://stackoverflow.com/a/73775999/19902725 Suggesting using a browser extension or Safari as it natively supports loading .tiff

1 – The extensions work by intercepting the URL and checking if it ends with a .TIFF so it itself could handle the request. Fiftyone loads the DS using a URL but loads the individual images in it dynamically which won’t trigger the extension to load the image. ‘At least in Brave browser’
2 – Switched to Safari after giving up on the extension route but the loaded images are cropped to less than a quarter of the original image (1440 × 1080)

Any other solutions?

Advertisement

Answer

An alternative is to use the newly added support for multiple media fields per sample. With this, you could generate a png or jpg for each tiff image and store these alternate filepaths on your samples in a new field, then toggle between tiff and png/jpg media in the App.

sample = fo.Sample(filepath="/path/to/img.tiff")
sample["jpg_filepath"] = "/path/to/img.jpg"
dataset.add_sample(sample)

dataset.app_config.media_fields.append("jpg_filepath")
dataset.save()  # must save after edits
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement