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

the image extraction part does not get the images #28

Closed
KnightOfTheMoonlight opened this issue Nov 4, 2016 · 14 comments
Closed

the image extraction part does not get the images #28

KnightOfTheMoonlight opened this issue Nov 4, 2016 · 14 comments

Comments

@KnightOfTheMoonlight
Copy link

KnightOfTheMoonlight commented Nov 4, 2016

Problem: the image extraction part does not get the images.

The denseflow library is build correctly.
And after run bash scripts/extraction_optical_flow.sh SRC_FOLDER OUT_FOLDER NUM_WORKER. I got the correct image paths but did not get the correct rgb and optical flow images.

I checked the code, and I guess it is tools/build_of.py in charge of the image extraction mission. And I guess it must be build/extract_gpu for the image extraction task. The running shell outputs the content of print '{} {} done.format(vid_id, vid_name)

Cause the build/extract_gpu is binary. I do not know how to check the details.

@yjxiong
Copy link
Owner

yjxiong commented Nov 4, 2016

Few things to check here:

  1. Video paths, are they valid?
  2. VideoIO support in OpenCV, is it enabled for OpenCV, see FATAL occured while opening videos in scripts/extract_optical_flow.sh #10 for more details

@KnightOfTheMoonlight
Copy link
Author

Opps. I used my current opencv.

@KnightOfTheMoonlight
Copy link
Author

KnightOfTheMoonlight commented Nov 4, 2016

I have another question, is opencv2.4.12 compatible with boost 1.59?

When compiling, I got the follow message:
../../lib/libopencv_ts.a(ts_gtest.cpp.o): In function 'testing::internal::RE::~RE()':

ts_gtest.cpp:(.text._ZN7testing8internal2RED2Ev+0xf): undefined reference to 'regfreeA'

ts_gtest.cpp:(.text._ZN7testing8internal2RED2Ev+0x18): undefined reference to 'regfreeA'

../../lib/libopencv_ts.a(ts_gtest.cpp.o): In function 'testing::internal::RE::FullMatch(char const*, testing::internal::RE const&)':

ts_gtest.cpp:(.text._ZN7testing8internal2RE9FullMatchEPKcRKS1_+0x2a): undefined reference to 'regexecA'

../../lib/libopencv_ts.a(ts_gtest.cpp.o): In function 'testing::internal::RE::PartialMatch(char const*, testing::internal::RE const&)':

ts_gtest.cpp:(.text._ZN7testing8internal2RE12PartialMatchEPKcRKS1_+0x2a): undefined reference to 'regexecA'

../../lib/libopencv_ts.a(ts_gtest.cpp.o): In function 'testing::internal::RE::Init(char const*)':

ts_gtest.cpp:(.text._ZN7testing8internal2RE4InitEPKc+0x62): undefined reference to 'regcompA'

ts_gtest.cpp:(.text._ZN7testing8internal2RE4InitEPKc+0x88): undefined reference to 'regcompA'

collect2: error: ld returned 1 exit status

make[2]: *** [bin/opencv_perf_core] Error 1

make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2

And from my search, it might be connected to boost.

@yjxiong
Copy link
Owner

yjxiong commented Nov 4, 2016

Haven't met this before. Sorry I cannot help on it. Maybe try other version of Boost before digging into the problem.

@KnightOfTheMoonlight
Copy link
Author

KnightOfTheMoonlight commented Nov 5, 2016

I have found the respective keywords under my boost and system boost like below:
SYSTEM ONE:
include file:
xxx@amax-SYS-7048GR-TR:/usr/include$ grep -n -H -R "regexecA"
boost/regex.h:61:using boost::regexecA;
boost/regex/v4/cregex.hpp:163:BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA*, const char*, regsize_t, regmatch_t*, int);
boost/regex/v4/cregex.hpp:182:#define regexec regexecA
library file:
xxx@amax-SYS-7048GR-TR:/harddrives/epsilon/xxx/libraries/boost$ cd /usr/lib/x86_64-linux-gnu/ xxx@amax-SYS-7048GR-TR:/usr/lib/x86_64-linux-gnu$grep -n -H -R "regexecA"
Binary file libboost_regex.so.1.54.0matches grep: libGLESv2.so: No such file or directory Binary file libboost_regex.so.1.55.0 matches grep: mesa-egl/libEGL.so: No such file or directory grep: mesa-egl/libGLESv2.so: No such file or directory`

MINE:
include and library file:
xxx@amax-SYS-7048GR-TR:/harddrives/epsilon/xxx/libraries/boost$ grep -n -H -R "regexecA" include/boost/regex.h:61:using boost::regexecA;
include/boost/regex/v4/cregex.hpp:163:BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA*, const char*, regsize_t, regmatch_t*, int);
include/boost/regex/v4/cregex.hpp:182:#define regexec regexecA boost_1_59_0/libs/regex/example/timer/regex_timer.cpp:331: regexecA(&r, s2.c_str(), nsubs, matches.get(), 0);
boost_1_59_0/libs/regex/example/timer/regex_timer.cpp:337: result = regexecA(&r, s2.c_str(), nsubs, matches.get(), 0);
boost_1_59_0/libs/regex/example/timer/regex_timer.cpp:341: cout << "POSIX regexecA time: " << (tim * 1000000 / iters) << "us" << endl;
boost_1_59_0/libs/regex/doc/posix_api.qbk:41: int regexecA(const regex_tA*, const char*, unsigned int, regmatch_t*, int);
boost_1_59_0/libs/regex/doc/posix_api.qbk:58: #define regexec regexecA
boost_1_59_0/libs/regex/doc/html/boost_regex/ref/posix.html:77:<span class="keyword">int</span> <span class="identifier">regexecA</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">regex_tA</span><span class="special">*,</span> <span class="keyword">const</span> <span class="keyword">char</span><span class="special">*,</span> <span class="keyword">unsigned</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">regmatch_t</span><span class="special">*,</span> <span class="keyword">int</span><span class="special">);</span> boost_1_59_0/libs/regex/doc/html/boost_regex/ref/posix.html:94:<span class="preprocessor">#define</span> <span class="identifier">regexec</span> <span class="identifier">regexecA</span>
boost_1_59_0/libs/regex/test/regress/test_deprecated.cpp:105: if(boost::regexecA(&re, search_text.c_str(), max_subs, matches, posix_match_options) == 0)
boost_1_59_0/libs/regex/test/c_compiler_checks/posix_api_check.c:48: result = regexecA(&re, text, 1, matches, REG_NOTBOL | REG_NOTEOL | REG_STARTEND);
boost_1_59_0/libs/regex/test/c_compiler_checks/posix_api_check.cpp:49: result = regexecA(&re, text, 1, matches, REG_NOTBOL | REG_NOTEOL | REG_STARTEND);
boost_1_59_0/libs/regex/src/posix_api.cpp:217:BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA* expression, const char* buf, regsize_t n, regmatch_t* array, int eflags) Binary file boost_1_59_0/bin.v2/libs/regex/build/gcc-4.8/release/link-static/threading-multi/libboost_regex.a matches
Binary file boost_1_59_0/bin.v2/libs/regex/build/gcc-4.8/release/link-static/threading-multi/posix_api.o matches
Binary file boost_1_59_0/bin.v2/libs/regex/build/gcc-4.8/release/threading-multi/libboost_regex.so.1.59.0 matches
Binary file boost_1_59_0/bin.v2/libs/regex/build/gcc-4.8/release/threading-multi/posix_api.o matches
boost_1_59_0/boost/regex.h:61:using boost::regexecA;
boost_1_59_0/boost/regex/v4/cregex.hpp:163:BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA*, const char*, regsize_t, regmatch_t*, int);
boost_1_59_0/boost/regex/v4/cregex.hpp:182:#define regexec regexecA
Binary file lib/libboost_regex.so.1.59.0 matches
Binary file lib/libboost_regex.a matches
Binary file lib/libboost_regex.so matches

all the keywords are found like above. So boost has these keywords and compiled to xxx.so, for my boost and the system one. While, there are two versions of boost, 1.54 and 1.55.

So I guess it is because opencv can not find it. I check the cmake file of opencv2.4.12 you provided, and could not find any clue of boost.
Do you have any suggestions?

@KnightOfTheMoonlight
Copy link
Author

KnightOfTheMoonlight commented Nov 6, 2016

Finally!!!
This undefined bug is because boost and linux system have the same regex.h file. And renaming this file of boost temporally can fix this. ref: https://groups.google.com/forum/#!searchin/caffe-users/regex.h/caffe-users/zTfFsRnNl9c/ckD-bar6BAAJ
So at the end I use my boost 1.59 and opencv2.4.12. and make the right opencv path for denseflow. this bug is fixed.

@wcj021312
Copy link

@KnightOfTheMoonlight hello, I meet the same problem when I run bash scripts/extraction_optical_flow.sh SRC_FOLDER OUT_FOLDER NUM_WORKER ,the image extraction part does not get the images. can you give me some suggest about the image extraction? Thank you .

@KnightOfTheMoonlight
Copy link
Author

@wcj021312 Did you check all the details above first?

@wcj021312
Copy link

wcj021312 commented Jul 26, 2017

@KnightOfTheMoonlight Video paths is true, and opencv support videoIO, what detail that I need to check? example?

@KnightOfTheMoonlight
Copy link
Author

KnightOfTheMoonlight commented Jul 27, 2017

@wcj021312
So could I assume you have already successfully run the bash build_all.sh? My problem comes from some building issues.
By the way, did you get the videos by this -> https://github.com/yjxiong/temporal-segment-networks#get-the-videos?

@wcj021312
Copy link

wcj021312 commented Jul 30, 2017 via email

@yjxiong
Copy link
Owner

yjxiong commented Jul 30, 2017

@wcj021312
In case you are using your own videos, make sure they are put in a two-level directory structure. This is assumed in the extraction script.
https://github.com/yjxiong/temporal-segment-networks/blob/master/tools/build_of.py#L115

Or you can change the script to fit your storage pattern.

@ymxv
Copy link

ymxv commented Mar 22, 2019

Opps. I used my current opencv.

hello,i meet the same question, when i run scripts/extract_optical_flow, there is no images generated, but the path generated, and i checked build_of.py ,i don't think the flowing code has worked, do you have any idea? thank u!

cmd = os.path.join(df_path + 'build/extract_gpu')+' -f {} -x {} -y {} -i {} -b 20 -t 1 -d {} -s 1 -o {} -w {} -h {}'.format(quote(vid_path), quote(flow_x_path), quote(flow_y_path), quote(image_path), dev_id, out_format, new_size[0], new_size[1])
os.system(cmd)

@jimmy-ng
Copy link

@ymxv You can solve it by using this command instead:
cmd = os.path.join(df_path + 'build/extract_gpu')+' -f={} -x={} -y={} -i={} -b=20 -t= 1 -d={} -s=1 -o={} -w={} -h={}'.format(quote(vid_path), quote(flow_x_path), quote(flow_y_path), quote(image_path), dev_id, out_format, new_size[0], new_size[1])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants