MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / main

Function main

samples/operators/stack.py:31–50  ·  view source on GitHub ↗

Stack an image with CVCUDA.

()

Source from the content-addressed store, hash-verified

29
30
31def main() -> None:
32 """Stack an image with CVCUDA."""
33 # docs_tag: begin_main
34 args: argparse.Namespace = parse_image_args()
35 # docs_tag: begin_read_image
36 input_image: cvcuda.Tensor = read_image(args.input)
37 height, width, channels = input_image.shape
38 # docs_tag: end_read_image
39
40 # docs_tag: begin_stack
41 # 1. Generate all the images
42 # We will simply use the same image for all to do the stack operation
43 # in the real world, you would have different images/data to stack
44 images: list[cvcuda.Tensor] = [input_image] * 3
45
46 # 2. Perform a stack operation on the images
47 stacked_images: cvcuda.Tensor = cvcuda.stack(images)
48 assert stacked_images.shape == (3, height, width, channels)
49 # docs_tag: end_stack
50 # docs_tag: end_main
51
52
53if __name__ == "__main__":

Callers 1

stack.pyFile · 0.70

Calls 2

parse_image_argsFunction · 0.90
read_imageFunction · 0.90

Tested by

no test coverage detected