File: pyglet_imshow.py

package info (click to toggle)
python-imgviz 1.5.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,132 kB
  • sloc: python: 3,354; makefile: 15
file content (25 lines) | stat: -rwxr-xr-x 537 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python

import imgviz


def get_images():
    data = imgviz.data.arc2017()
    yield data["rgb"]
    yield imgviz.depth2rgb(data["depth"], min_value=0.3, max_value=1)
    yield imgviz.label2rgb(data["class_label"])


def main():
    imgviz.io.pyglet_imshow(next(get_images()), "ndarray")
    imgviz.io.pyglet_run()

    imgviz.io.pyglet_imshow(get_images(), "generator")
    imgviz.io.pyglet_run()

    imgviz.io.pyglet_imshow(list(get_images()), "list")
    imgviz.io.pyglet_run()


if __name__ == "__main__":
    main()