diff --git a/examples/dnn_yolo_train_ex.cpp b/examples/dnn_yolo_train_ex.cpp index 2ffdd5ac2..ea3ac3961 100644 --- a/examples/dnn_yolo_train_ex.cpp +++ b/examples/dnn_yolo_train_ex.cpp @@ -395,7 +395,6 @@ try dlib::rand rnd(time(nullptr) + seed); matrix image, rotated; std::pair, std::vector> temp; - temp.first.set_size(image_size, image_size); random_cropper cropper; cropper.set_seed(time(nullptr) + seed); cropper.set_chip_dims(image_size, image_size); @@ -424,6 +423,7 @@ try for (auto& box : temp.second) box.rect = tform(box.rect); + temp.first.set_size(image_size, image_size); tform = letterbox_image(rotated, temp.first); for (auto& box : temp.second) box.rect = tform(box.rect);