diff options
Diffstat (limited to 'src/annotator.cc')
-rw-r--r-- | src/annotator.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/annotator.cc b/src/annotator.cc index f1fccbc..1a6d557 100644 --- a/src/annotator.cc +++ b/src/annotator.cc @@ -29,14 +29,18 @@ int main(int argc, char *argv[]) { std::vector<std::string> flags = extractFlags(args); if(args.empty()) { std::cout << "Must provide a path to a video to process!" << std::endl; + return 1; + } + int frameCap = -1; + if(args.size() >= 2) { + frameCap = std::stoi(args[1]); + std::cout << "Only using first " << frameCap << " frames." << std::endl; } std::cout << "Loading video " << args[0] << std::endl; std::filesystem::path p(args[0]); - std::shared_ptr<frontend::playback> playback(new frontend::playback(p)); + std::shared_ptr<frontend::playback> playback(new frontend::playback(p, frameCap)); // 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"); + auto savepath = std::filesystem::path("saves") / p.parent_path().filename() / (p.stem().string() + ".csv"); std::cout << "Saves are written to: " << savepath << std::endl; std::shared_ptr<backend::labeller> labeller(new backend::labeller(savepath)); frontend::ui ui(playback, labeller); |