From 5e4240ea795c992635a3cfc464d760205e07bf05 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 17 Aug 2021 08:54:45 -0400 Subject: Updated keys --- src/annotator.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/annotator.cc') 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 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 playback(new frontend::playback(p)); + std::shared_ptr 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 labeller(new backend::labeller(savepath)); frontend::ui ui(playback, labeller); -- cgit v1.2.3