#include "playback.h" #include "ui.h" #include "labeller.h" #include #include #include // Removes flags from args (in-place) and returns vector of flags std::vector extractFlags(std::vector& args) { std::vector ret; auto it = args.begin(); while(it != args.end()) { if((*it)[0] == '-') { while((*it)[0] == '-') { (*it).erase((*it).begin()); } ret.push_back(*it); args.erase(it); } else { it++; } } return ret; } int main(int argc, char *argv[]) { std::string exename = argv[0]; std::vector args(&argv[1], &argv[argc]); std::vector flags = extractFlags(args); if(args.empty()) { std::cout << "Must provide a path to a video to process!" << std::endl; } std::cout << "Loading video " << args[0] << std::endl; std::filesystem::path p(args[0]); std::shared_ptr playback(new frontend::playback(p)); // Format save path auto savedir = std::filesystem::path("save") / p.parent_path().filename(); std::filesystem::create_directories(savedir); auto savepath = savedir / (p.stem().string() + ".csv"); std::cout << "Saves are written to: " << savepath << std::endl; std::shared_ptr labeller(new backend::labeller(savepath)); frontend::ui ui(playback, labeller); ui.begin(); return 0; }