aboutsummaryrefslogtreecommitdiff
path: root/src/annotator.cc
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-08-17 08:56:51 -0400
committerYour Name <you@example.com>2021-08-17 08:56:51 -0400
commit2a4ca022ad37ff2452ec3addb8c760a93bb616c6 (patch)
treedd66554b8e7e568a410974df71a95d37f5433d18 /src/annotator.cc
parent8a6b5564c0fc37e6e556d04e17ddba86d4bd3dc1 (diff)
parent5e4240ea795c992635a3cfc464d760205e07bf05 (diff)
downloadannotator-2a4ca022ad37ff2452ec3addb8c760a93bb616c6.tar.gz
annotator-2a4ca022ad37ff2452ec3addb8c760a93bb616c6.tar.bz2
annotator-2a4ca022ad37ff2452ec3addb8c760a93bb616c6.zip
Merge branch 'master' of https://vance.fish/git/annotator
Diffstat (limited to 'src/annotator.cc')
-rw-r--r--src/annotator.cc12
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);