shuffle image to remove biases
This commit is contained in:
6
main.cpp
6
main.cpp
@ -1,5 +1,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
#include <algorithm>
|
||||||
#include <opencv2/highgui.hpp>
|
#include <opencv2/highgui.hpp>
|
||||||
|
|
||||||
static constexpr char OUTPUT_DIR[] = "./out";
|
static constexpr char OUTPUT_DIR[] = "./out";
|
||||||
@ -48,6 +49,11 @@ int main(int argc, char** argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::random_shuffle(images.begin(), images.end());
|
||||||
|
|
||||||
|
for(const std::filesystem::path& path : images)
|
||||||
|
std::cout<<"Found: "<<path.filename()<<'\n';
|
||||||
|
|
||||||
std::filesystem::path outDirPath(OUTPUT_DIR);
|
std::filesystem::path outDirPath(OUTPUT_DIR);
|
||||||
if(!std::filesystem::is_directory(outDirPath) && !std::filesystem::create_directory(outDirPath))
|
if(!std::filesystem::is_directory(outDirPath) && !std::filesystem::create_directory(outDirPath))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user