Machine learning MMOD Dlib对象检测器检测到一组不可能的对象标签

Machine learning MMOD Dlib对象检测器检测到一组不可能的对象标签,machine-learning,computer-vision,dlib,Machine Learning,Computer Vision,Dlib,您好,我正在尝试培训道路标志检测器,类似于fhog_对象_检测器_ex.cpp。我在一个文件夹stopsign\u train中有我裁剪的地面真相图像 string stopsign_train = "/media/user/DATA/Dataset/StopSignModeling/train /01/"; std::vector<string> imgListTrain, imgListValidation ; listAllFiles(imgList

您好,我正在尝试培训道路标志检测器,类似于fhog_对象_检测器_ex.cpp。我在一个文件夹stopsign\u train中有我裁剪的地面真相图像

string stopsign_train = "/media/user/DATA/Dataset/StopSignModeling/train             
/01/";

std::vector<string> imgListTrain, imgListValidation ;
listAllFiles(imgListTrain, stopsign_train, "png");

dlib::array<array2d<dlib::rgb_pixel > > images_train ;
std::vector<std::vector<rectangle> > stop_boxes_train ;

 //filling the stop_boxes_train and images_train

    for(unsigned int ii=0; ii < imgListTrain.size(); ii++){
        string fileName = stopsign_train + imgListTrain[ii];
        dlib::array2d<dlib::rgb_pixel > tmpImg ;
        load_png(tmpImg, fileName);
        array2d<rgb_pixel> sizeImg(18, 18);
        resize_image(tmpImg, sizeImg, interpolate_nearest_neighbor());
        images_train.push_back(sizeImg);
        dlib::rectangle tmpRect(dlib::point(2, 2), dlib::point(16, 16)) ;
        std::vector<rectangle> tmpVecRect ;
        tmpVecRect.push_back(tmpRect);
        stop_boxes_train.push_back(tmpVecRect);
    }
typedef scan_fhog_pyramid<pyramid_down<6> > image_scanner_type;
image_scanner_type scanner;
// The sliding window detector will be 16 pixels wide and 16 pixels tall.
scanner.set_detection_window_size(16, 16);
// I have tried 12 by 12 as well as 14 by 14 (samller than the   
 stop_boxes_train rectangle size as well as exact also)
int C = 1;
trainer.set_c(C);
float eps = 0.01 ;
trainer.set_epsilon(eps);
object_detector<image_scanner_type> detector = trainer.train(images_train,    
stop_boxes_train);
string stopsign\u train=“/media/user/DATA/Dataset/StopSignModeling/train
/01/";
std::向量imgListTrain,imgListValidation;
列表所有文件(imgListTrain、停车标志、png);
dlib::阵列图像\u序列;
std::矢量停车箱列车;
//填写列车停靠箱和列车图像
for(无符号整数ii=0;ii
始终存在类似输出的异常,如下所示 ---------------------------------------

num训练图像:2284

异常被抛出! 检测到一组不可能的对象标签。发生这种情况是因为没有 所提供的图像扫描仪检查的对象位置中有一个足够近 匹配一个真相框。要解决此问题,您需要降低 匹配eps或调整图像扫描仪的设置,使其符合此要求 真相箱。或者,您可以调整令人不快的真相矩形,以便 与当前图像扫描仪匹配。此外,如果您正在使用 扫描图像金字塔对象,然后您可以尝试使用更精细的图像金字塔或 添加更多检测模板。例如,如果您的一个现有检测 模板具有匹配的宽度/高度比,且面积小于不符合要求的模板 矩形,然后一个更精细的图像金字塔可能会有所帮助

图像索引0

匹配单位eps:0.5

最佳匹配:0.0926276

真理真理:[(2,2)(16,16)]

真理矩形宽度/高度:1

真理矩形面积:225

最近检测模板rect:[(10,10)(24,24)]

最近检测模板矩形宽度/高度:1


最近的检测模板rect区域:225

尝试从github中提取最新代码,看看会发生什么;)您好,谢谢@DavisKing,我已经稍微更改了代码。stopsign_train是指向火车图像的路径,stopsign_train_gt是格式为(x、y、w、h、lbl)的地面真相。它仍在引发异常(引发异常!检测到一组不可能的对象标签)。但是当我使用//remove\u ungonable\u rectangles\u(培训师、图像培训、停车箱培训)时;它没有,但我还想知道如何检查有多少样本是通过移除不可获取的矩形(培训师、图像、停止框)移除的;这句话的意思是,图像的大小在前后都是一样的。我还想注意一下roi(感兴趣的区域)dlib::矩形大小从12by12到128by128不等。试着从github中提取最新的代码,看看会发生什么;)您好,谢谢@DavisKing,我已经稍微更改了代码。stopsign_train是指向火车图像的路径,stopsign_train_gt是格式为(x、y、w、h、lbl)的地面真相。它仍在引发异常(引发异常!检测到一组不可能的对象标签)。但是当我使用//remove\u ungonable\u rectangles\u(培训师、图像培训、停车箱培训)时;它没有,但我还想知道如何检查有多少样本是通过移除不可获取的矩形(培训师、图像、停止框)移除的;这句话的意思是图像的大小在前后都是一样的。我还想注意一下roi(感兴趣的区域)。dlib::矩形大小从12by12到128by128不等。