MCPcopy Create free account
hub / github.com/OpenDriveLab/OpenLane / Counter

Class Counter

eval/LANE_evaluation/lane2d/include/counter.hpp:39–70  ·  view source on GitHub ↗

before coming to use functions of this class, the lanes should resize to im_width and im_height using resize_lane() in lane_compare.hpp

Source from the content-addressed store, hash-verified

37
38// before coming to use functions of this class, the lanes should resize to im_width and im_height using resize_lane() in lane_compare.hpp
39class Counter
40{
41public:
42 Counter(int _im_width, int _im_height, double _iou_threshold = 0.4, int _lane_width = 10) : tp(0), fp(0), fn(0)
43 {
44 im_width = _im_width;
45 im_height = _im_height;
46 sim_threshold = _iou_threshold;
47 lane_compare = new LaneCompare(_im_width, _im_height, _lane_width, LaneCompare::IOU);
48 };
49 double get_precision(void);
50 double get_recall(void);
51 long getTP(void);
52 long getFP(void);
53 long getFN(void);
54 void setTP(long);
55 void setFP(long);
56 void setFN(long);
57 // direct add tp, fp, tn and fn
58 // first match with hungarian
59 tuple<vector<int>, long, long, long, long> count_im_pair(const vector<vector<Point2f>> &anno_lanes, const vector<vector<Point2f>> &detect_lanes, vector<uint8_t> &anno_lanes_flag, vector<uint8_t> &detect_lanes_flag, bool category_flag);
60 void makeMatch(const vector<vector<double>> &similarity, vector<int> &match1, vector<int> &match2);
61
62private:
63 double sim_threshold;
64 int im_width;
65 int im_height;
66 long tp;
67 long fp;
68 long fn;
69 LaneCompare *lane_compare;
70};
71#endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected