Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chenweikai committed Jun 16, 2022
1 parent f1a0cb3 commit 0599c6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion data_generation/data/todo.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
soldier_fight
vampire_torch
12 changes: 4 additions & 8 deletions data_generation/src/batch_generate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,15 @@ int main(int argc, char** argv) {
std::string out_recon_ply_dir = "../output/PLY";
std::string todo_filename = "../data/todo.txt"; // a txt file containing the names of the subjects to be computed
std::vector<std::string> todo_list;
std::ifstream fin;
fin.open(todo_filename);
std::string name;
while (fin >> name) {
todo_list.push_back(name);
}

int octree_depth = 7;
int write_ply = 0;
int write_sdf = 1;
int write_obj = 1;

if (argc < 9) {
std::cout << "usage: ./batch_generate input_mesh_dir out_sdf_dir out_recon_obj_dir out_ply_dir octree_depth flag_writeSDF [Default: 1] flag_writeOBJ [Default: 1] flag_writePLY [Default: 0] [todo_list.txt (optional)]" << std::endl;
std::cout << "usage: ./batch_generate input_mesh_dir out_sdf_dir out_recon_obj_dir out_ply_dir \
octree_depth flag_writeSDF [Default: 1] flag_writeOBJ [Default: 1] flag_writePLY [Default: 0] [todo_list.txt (optional)]" << std::endl;
std::cout << "Insufficient input argument. Please refer to the usage info for more details. Currently run the default setting for illustration!" << std::endl;
} else {
input_data_dir = std::string(argv[1]);
Expand All @@ -52,10 +47,11 @@ int main(int argc, char** argv) {
todo_filename = std::string(argv[9]);
} else {
// If no todo list is provided, collect all the samples under the input data directory.
std::cout << "Adding all .obj files under the input data directory to the todo list ..." << std::endl;
todo_list.clear();
for (const auto & entry : fs::directory_iterator(input_data_dir)) {
std::string path = entry.path();
std::string ext = path.substr(path.find_last_of("."));
std::string ext = path.substr(path.find_last_of(".") + 1);
// Currently only load obj files
if (ext == "obj") {
std::string base_filename = path.substr(path.find_last_of("/\\") + 1, path.find_last_of(".") - path.find_last_of("/\\") - 1);
Expand Down

0 comments on commit 0599c6d

Please sign in to comment.