Help Center/ Huawei HiLens/ SDK Reference/ Hard Example Upload/ Determining a Hard Example Image
Updated on 2023-06-15 GMT+08:00

Determining a Hard Example Image

This section describes how to determine whether an input image is a hard example.

API Calling

virtual bool Filter(const float inferResult[], const int size);

virtual bool Filter(const std::vector<Bbox> &bboxList, DetectionFilterType type);

Table 1 Parameter description 1

Parameter

Description

inferResult[]

Float array, which contains the confidence score of each class obtained by the classification algorithm

size

Input size

Table 2 Parameter description 2

Parameter

Description

bboxList

std::vector<Bbox>. The Bbox structure is defined as follows:

structBbox 
{
    float xmin;
    float ymin;
    float xmax;
    float ymax;
    float score;
    int label;
    Bbox(floatbboxXmin, floatbboxYmin, floatbboxXmax, floatbboxYmax,     floatbboxScore, intbboxLabel):
    xmin(bboxXmin), ymin(bboxYmin), xmax(bboxXmax), ymax(bboxYmax), score(bboxScore), label(bboxLabel){}
};

Table 3 describes related parameters.

type

Type of the hard example filter. The value can be CrossEntropyFilter, IBT, or CSF. For details, see Introduction to Hard Example Upload.

Table 3 Parameters in the Bbox structure

Value

Description

xmin

Coordinates of a bounding box

ymin

Coordinates of a bounding box

xmax

Coordinates of a bounding box

ymax

Coordinates of a bounding box

score

Score of a bounding box

label

Class of a bounding box

Return Value

A bool value is returned, indicating whether the image is a hard example.