Minor fixes

This commit is contained in:
AlexeyAB
2018-06-01 14:58:30 +03:00
parent 73a2c52df0
commit ba70801e98
4 changed files with 8 additions and 3 deletions

View File

@ -18,7 +18,7 @@ darknet.exe partial cfg/yolo-voc.cfg yolo-voc.weights yolo-voc.conv.23 23
darknet.exe partial cfg/yolov2.cfg yolov2.weights yolov2.conv.23 23
darknet.exe partial cfg/yolov3.cfg yolov3.weights yolov3.conv.105 105
darknet.exe partial cfg/yolov3.cfg yolov3.weights yolov3.conv.81 81
darknet.exe partial cfg/yolov3-tiny.cfg yolov3-tiny.weights yolov3-tiny.conv.15 15

View File

@ -297,7 +297,8 @@ void forward_region_layer(const region_layer l, network_state state)
box truth = float_to_box(state.truth + t*5 + b*l.truths);
int class_id = state.truth[t * 5 + b*l.truths + 4];
if (class_id >= l.classes) {
printf("Warning: in txt-labels class_id=%d >= classes=%d in cfg-file\n", class_id, l.classes);
printf(" Warning: in txt-labels class_id=%d >= classes=%d in cfg-file. In txt-labels class_id should be [from 0 to %d] \n", class_id, l.classes, l.classes-1);
getchar();
continue; // if label contains class_id more than number of classes in the cfg-file
}

View File

@ -212,6 +212,9 @@ void replace_image_to_label(char *input_path, char *output_path) {
//find_replace(output_path, "JPEGImages", "labels", output_path); // PascalVOC
find_replace(output_path, "VOC2007/JPEGImages", "VOC2007/labels", output_path); // PascalVOC
find_replace(output_path, "VOC2012/JPEGImages", "VOC2012/labels", output_path); // PascalVOC
//find_replace(output_path, "/raw/", "/labels/", output_path);
// replace only ext of files
find_replace_extension(output_path, ".jpg", ".txt", output_path);
find_replace_extension(output_path, ".JPG", ".txt", output_path); // error

View File

@ -202,7 +202,8 @@ void forward_yolo_layer(const layer l, network_state state)
box truth = float_to_box_stride(state.truth + t*(4 + 1) + b*l.truths, 1);
int class_id = state.truth[t*(4 + 1) + b*l.truths + 4];
if (class_id >= l.classes) {
printf("Warning: in txt-labels class_id=%d >= classes=%d in cfg-file\n", class_id, l.classes);
printf(" Warning: in txt-labels class_id=%d >= classes=%d in cfg-file. In txt-labels class_id should be [from 0 to %d] \n", class_id, l.classes, l.classes - 1);
getchar();
continue; // if label contains class_id more than number of classes in the cfg-file
}
if(!truth.x) break;