From 4ba1fe9e58d533f3f0294c084b018d64ab50a562 Mon Sep 17 00:00:00 2001 From: Ivan Kud Date: Wed, 29 Jan 2025 12:40:34 +0100 Subject: [PATCH] fixed template (#934) --- samples/template/src/client/run.py | 4 ++-- samples/template/src/module/module.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/template/src/client/run.py b/samples/template/src/client/run.py index 9d0a5f9b..68645d93 100644 --- a/samples/template/src/client/run.py +++ b/samples/template/src/client/run.py @@ -110,12 +110,12 @@ # get the result image # the image will be in RGBA format, as specified in the module config img = np.frombuffer(result.frame_content, dtype=np.uint8) - img = img.reshape(result.frame_meta.height, result.frame_meta.width, 4) + img = cv2.imdecode(img, cv2.IMREAD_COLOR) # save the result image # the image will anything that the module has drawn on top of the input image print(f'Saving result image to {result_img_path}') - cv2.imwrite(result_img_path, cv2.cvtColor(img, cv2.COLOR_RGBA2BGRA)) + cv2.imwrite(result_img_path, img) # print the processing logs from the module print('Logs from the module:') diff --git a/samples/template/src/module/module.yml b/samples/template/src/module/module.yml index 0fa20d25..cac549be 100644 --- a/samples/template/src/module/module.yml +++ b/samples/template/src/module/module.yml @@ -30,7 +30,7 @@ parameters: height: 720 # Add paddings to the frame before processing output_frame: - codec: raw-rgba + codec: jpeg # custom drawing on frames function draw_func: module: src.module.overlay_draw_spec