mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
fix letterbox_image in yolo example (#2911)
This commit is contained in:
parent
85aa29a4e8
commit
631c47c7fd
@ -395,7 +395,6 @@ try
|
|||||||
dlib::rand rnd(time(nullptr) + seed);
|
dlib::rand rnd(time(nullptr) + seed);
|
||||||
matrix<rgb_pixel> image, rotated;
|
matrix<rgb_pixel> image, rotated;
|
||||||
std::pair<matrix<rgb_pixel>, std::vector<yolo_rect>> temp;
|
std::pair<matrix<rgb_pixel>, std::vector<yolo_rect>> temp;
|
||||||
temp.first.set_size(image_size, image_size);
|
|
||||||
random_cropper cropper;
|
random_cropper cropper;
|
||||||
cropper.set_seed(time(nullptr) + seed);
|
cropper.set_seed(time(nullptr) + seed);
|
||||||
cropper.set_chip_dims(image_size, image_size);
|
cropper.set_chip_dims(image_size, image_size);
|
||||||
@ -424,6 +423,7 @@ try
|
|||||||
for (auto& box : temp.second)
|
for (auto& box : temp.second)
|
||||||
box.rect = tform(box.rect);
|
box.rect = tform(box.rect);
|
||||||
|
|
||||||
|
temp.first.set_size(image_size, image_size);
|
||||||
tform = letterbox_image(rotated, temp.first);
|
tform = letterbox_image(rotated, temp.first);
|
||||||
for (auto& box : temp.second)
|
for (auto& box : temp.second)
|
||||||
box.rect = tform(box.rect);
|
box.rect = tform(box.rect);
|
||||||
|
Loading…
Reference in New Issue
Block a user