From 631c47c7fd8435df0a48baa86cbbbcaea7c524a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= <1671644+arrufat@users.noreply.github.com> Date: Mon, 5 Feb 2024 22:07:16 +0900 Subject: [PATCH] fix letterbox_image in yolo example (#2911) --- examples/dnn_yolo_train_ex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);