Debian Codegraph @

gst/tensordecoders/gstyolosegtensordecoder.h

raw
1 /*
2 * GStreamer gstreamer-yolotensordecoder
3 * Copyright (C) 2024 Collabora Ltd
4 * Authors: Daniel Morin <[email protected]>
5 * Vineet Suryan <[email protected]>
6 * Santosh Mahto <[email protected]>
7 *
8 * gstyolotensordecoder.h
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Library General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Library General Public License for more details.
19 *
20 * You should have received a copy of the GNU Library General Public
21 * License along with this library; if not, write to the
22 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
24 */
25
26
27 #ifndef __GST_YOLO_SEG_TENSOR_DECODER_H__
28 #define __GST_YOLO_SEG_TENSOR_DECODER_H__
29
30 #include <gst/gst.h>
31 #include <gst/video/video.h>
32 #include <gst/base/base.h>
33 #include "gstyolotensordecoder.h"
34
35 /* Yolo segmentation tensor decoder */
36 #define GST_TYPE_YOLO_SEG_TENSOR_DECODER (gst_yolo_seg_tensor_decoder_get_type ())
37
38 G_DECLARE_FINAL_TYPE (GstYoloSegTensorDecoder, gst_yolo_seg_tensor_decoder,
39 GST, YOLO_SEG_TENSOR_DECODER, GstYoloTensorDecoder)
40
41 struct _GstYoloSegTensorDecoder
42 {
43 GstYoloTensorDecoder parent;
44
45 /* Mask width */
46 guint mask_w;
47 /* Mask height */
48 guint mask_h;
49 /* Mask length */
50 gsize mask_length;
51
52 /* Scaling factor to convert bounding-box coordinates to mask coordinates */
53 gfloat bb2mask_gain;
54 /* Region of the mask that contain valid segmentation information */
55 BBox mask_roi;
56
57 /* BufferPool for mask */
58 GstBufferPool *mask_pool;
59
60 /* Those are only valid during the call to
61 * the base call gst_yolo_tensor_decoder_decode_f32
62 */
63 const GstTensor *logits_tensor;
64 GstMapInfo map_info_logits;
65 };
66
67 GST_ELEMENT_REGISTER_DECLARE (yolo_seg_tensor_decoder)
68
69 #endif /* __GST_YOLO_SEG_TENSOR_DECODER_H__ */