|
@@ -9,6 +9,11 @@
|
|
#include <filesystem>
|
|
#include <filesystem>
|
|
#include <regex>
|
|
#include <regex>
|
|
|
|
|
|
|
|
+#include <bits/stdc++.h>
|
|
|
|
+#include <iostream>
|
|
|
|
+#include <sys/stat.h>
|
|
|
|
+#include <sys/types.h>
|
|
|
|
+
|
|
void writeProgress(float progress, bool moveUp = false){
|
|
void writeProgress(float progress, bool moveUp = false){
|
|
int barWidth = 200;
|
|
int barWidth = 200;
|
|
|
|
|
|
@@ -86,6 +91,9 @@ int main(int argc, char *argv[]){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // create output directory
|
|
|
|
+ mkdir(outputFolder.c_str(), 0755);
|
|
|
|
+
|
|
std::vector<std::string> imagesPath;
|
|
std::vector<std::string> imagesPath;
|
|
|
|
|
|
for (const auto & entry : std::filesystem::directory_iterator(folderName)){
|
|
for (const auto & entry : std::filesystem::directory_iterator(folderName)){
|
|
@@ -95,6 +103,11 @@ int main(int argc, char *argv[]){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // check number of files
|
|
|
|
+ if (maxSamples > imagesPath.size()) {
|
|
|
|
+ maxSamples = imagesPath.size();
|
|
|
|
+ }
|
|
|
|
+
|
|
// sort or shuffle the images path
|
|
// sort or shuffle the images path
|
|
if (!random){
|
|
if (!random){
|
|
std::sort(imagesPath.begin(), imagesPath.end(), std::less<std::string>());
|
|
std::sort(imagesPath.begin(), imagesPath.end(), std::less<std::string>());
|