NVIDIA / NVIDIA/DALI

Decoding an int32 or int16 TIFF in DALI

Open
#1,246 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement external contribution welcome
Dominant language
C++
Stars
5.8k
Forks
678
Avg merge
3d 1h
Merged PRs (30d)
27

Description

I'm trying to decode a single channel TIFF (PIL mode='I') in a custom pipeline.

I thought that I could use

ImageDecoder(device = "cpu", output_type = types.GRAY)

Because the documentation states that ImageDecoder falls back on OpenCV decoders for non-jpeg images. In OpenCV, I could specify the IMREAD_ANYDEPTH flag to read int16 TIFFs.

But it appears that the ImageDecoder can only handle uint8 data. I get the error message

"Assert on "IsType(input.type())" failed: Input must be stored as uint8 data."

Is there a work-around I could use to load these images? These are depth images. I don't want to convert them to uint8 grayscale because I would loose a lot of precision, but I can if that is the only solution.

Possibly related to : Multi-channel tiff data pipeline example #1021

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the ImageDecoder entry point and compare its documented non-JPEG fallback with the related multi-channel TIFF example in issue #1021. Reproduce decoding of the PIL mode='I' int16 or int32 TIFF and inspect the uint8 assertion; done means depth data retains its original precision or a documented workaround is provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
computer-vision
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.