From 189006399a5b531088e240a2f203618d2206dcf2 Mon Sep 17 00:00:00 2001 From: Trenton Schulz Date: Wed, 5 Aug 2020 10:44:24 +0200 Subject: [PATCH] Add a newline on every line. Text files should have a newline as their last character. This isn't strictly required (many tools will work), but it makes parsing of these files easier, plus it keeps the txt files similar with other image datasets. --- mainwindow.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index eae3f25..f1ca855 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -137,8 +137,6 @@ void MainWindow::save_label_data()const { for(int i = 0; i < ui->label_image->m_objBoundingBoxes.size(); i++) { - if(i != 0) fileOutputLabelData << '\n'; - ObjectLabelingBox objBox = ui->label_image->m_objBoundingBoxes[i]; if(ui->checkBox_cropping->isChecked()) @@ -169,7 +167,7 @@ void MainWindow::save_label_data()const fileOutputLabelData << " "; fileOutputLabelData << std::fixed << std::setprecision(6) << width; fileOutputLabelData << " "; - fileOutputLabelData << std::fixed << std::setprecision(6) << height; + fileOutputLabelData << std::fixed << std::setprecision(6) << height << std::endl; } fileOutputLabelData.close();