Skip to content

fix(dex-ycb): numpy array truth value used in conditional (+1 more) - #18

Open
andrewwhitecdw wants to merge 1 commit into
NVlabs:masterfrom
andrewwhitecdw:bugfix/dex-ycb-assorted-58370f76
Open

fix(dex-ycb): numpy array truth value used in conditional (+1 more)#18
andrewwhitecdw wants to merge 1 commit into
NVlabs:masterfrom
andrewwhitecdw:bugfix/dex-ycb-assorted-58370f76

Conversation

@andrewwhitecdw

@andrewwhitecdw andrewwhitecdw commented Jul 27, 2026

Copy link
Copy Markdown

Small fixes in lib/datasets/dex_ycb.py:

fix: numpy array truth value used in conditional checks

Fix: Replace:

        if cfg.TRAIN.CHROMATIC and cfg.MODE == 'TRAIN' and np.random.rand(1) > 0.1:
            im = chromatic_transform(im)
        if cfg.TRAIN.ADD_NOISE and cfg.MODE == 'TRAIN' and np.random.rand(1) > 0.1:
            im = add_noise(im)

with:

        if cfg.TRAIN.CHROMATIC and cfg.MODE == 'TRAIN' and np.random.rand() > 0.1:
            im = chromatic_transform(im)
        if cfg.TRAIN.ADD_NOISE and cfg.MODE == 'TRAIN' and np.random.rand() > 0.1:
            im = add_noise(im)

fix: numpy array truth value in pixel threshold check

Fix: Replace:

            if len(ind) > 0 and num_pixels[ind] > cfg.TRAIN.MAX_PXIEL_PER_OBJECT:

with:

            if len(ind) > 0 and num_pixels[ind[0]] > cfg.TRAIN.MAX_PXIEL_PER_OBJECT:

Files changed

  • lib/datasets/dex_ycb.py

@andrewwhitecdw
andrewwhitecdw marked this pull request as ready for review August 3, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant