wangrong
2025-01-03 2c4b8838f89bebca97615c5f0bac2c58e0349771
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once
 
#include <string>
#include <memory>
#include <vector>
 
#include "shapes/vp_rect.h"
 
namespace vp_objects {
    // sub target inside vp_frame_target, created by detectors which MUST infer on small cropped images (detectors are derived from vp_secondary_infer_node).
    // this class has less properties/functions than vp_frame_target.
    // see vp_frame_target also.
    class vp_sub_target
    {
    private:
        /* data */
    public:
        vp_sub_target(int x, 
                        int y, 
                        int width, 
                        int height, 
                        int class_id, 
                        float score, 
                        std::string label, 
                        int frame_index, 
                        int channel_index);
        ~vp_sub_target();
 
        // x of top left
        int x;
        // y of top left
        int y;
        // width of rect
        int width;
        // height of rect
        int height;
 
        // class id
        int class_id;
        // score
        float score;
        // label
        std::string label;
 
        // frame the sub target belongs to
        int frame_index;
        // channel the sub target belongs to
        int channel_index;
 
        // save some info
        std::vector<std::string> attachments;
 
        // clone myself
        std::shared_ptr<vp_sub_target> clone();
 
        // rect area of target
        vp_rect get_rect() const;
    };
 
}