diff options
author | Your Name <you@example.com> | 2021-08-17 08:54:45 -0400 |
---|---|---|
committer | Your Name <you@example.com> | 2021-08-17 08:54:45 -0400 |
commit | 5e4240ea795c992635a3cfc464d760205e07bf05 (patch) | |
tree | b2a19cded0a2194a4554ceca7a1bbb69d1633701 /src/annotator.cc | |
parent | 8c884838ced928d29a8436be8b2808766c5a1e53 (diff) | |
download | annotator-5e4240ea795c992635a3cfc464d760205e07bf05.tar.gz annotator-5e4240ea795c992635a3cfc464d760205e07bf05.tar.bz2 annotator-5e4240ea795c992635a3cfc464d760205e07bf05.zip |
Updated keys
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); |