Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support more frame formats #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/dense_flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class DenseFlow {
const Size &size, path output_dir, bool verbose);

public:
string supported_exts = ".jpg|.png|.jpeg|.JPG|.PNG|.JPEG";
static void load_frames_wrap(void *arg, bool use_frames, string save_type, bool verbose) {
return static_cast<DenseFlow *>(arg)->load_frames(use_frames, save_type, verbose);
}
Expand Down
4 changes: 2 additions & 2 deletions src/denseflow_gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void DenseFlow::extract_frames_only(bool use_frames, bool verbose) {
if (use_frames) {
directory_iterator end_itr;
for (directory_iterator itr(video_path); itr != end_itr; ++itr) {
if (!is_regular_file(itr->status()) || itr->path().extension() != ".jpg")
if (!is_regular_file(itr->status()) || supported_exts.find(itr->path().extension().string()) == string::npos)
continue;
frames_path.push_back(itr->path());
}
Expand Down Expand Up @@ -246,7 +246,7 @@ void DenseFlow::load_frames(bool use_frames, string save_type, bool verbose) {
if (use_frames) {
directory_iterator end_itr;
for (directory_iterator itr(video_path); itr != end_itr; ++itr) {
if (!is_regular_file(itr->status()) || itr->path().extension() != ".jpg")
if (!is_regular_file(itr->status()) || supported_exts.find(itr->path().extension().string()) == string::npos)
continue;
frames_path.push_back(itr->path());
}
Expand Down