scanner-research / scanner

Efficient video analysis at scale
https://scanner-research.github.io/
Apache License 2.0
615 stars 108 forks source link

Pose Detection App - Number of Scales Error - CPU_ONLY #234

Closed jpablomch closed 5 years ago

jpablomch commented 5 years ago

Running the pose detection example gives the following error:

Error:
Temporarily, the number of scales (`--scale_number`) cannot be greater than 1 for `CPU_ONLY` version.

Coming from:
- /opt/scanner-base/thirdparty/build/openpose/src/openpose/wrapper/wrapperAuxiliary.cpp:wrapperConfigureSecurityChecks():133
- /opt/scanner-base/thirdparty/build/openpose/src/openpose/wrapper/wrapperAuxiliary.cpp:wrapperConfigureSecurityChecks():152
- /opt/scanner-base/thirdparty/build/openpose/include/openpose/wrapper/wrapper.hpp:configure():941
terminate called after throwing an instance of 'std::runtime_error'

I tried changing pose_num_scales from 3 to 1:

frame = db.sources.FrameColumn()
poses_out = db.ops.OpenPose(
    frame=frame,
    pose_num_scales=1,      #3 
    pose_scale_gap=0.33,
    device=device)

This results in the following error:

Using CPUs
  0%|       | 0/3 [00:01<?, ?it/s, tasks=3, jobs=1, workers=1]F1118 06:51:00.231807   255 python_kernel.cpp:335] ValueError: cannot reshape array of size 0 into shape (130,3)

At:
  /root/.local/lib/python3.5/site-packages/scannerpy/stdlib/poses.py(157): from_buffer
  /root/.local/lib/python3.5/site-packages/scannerpy/stdlib/readers.py(31): poses
  main.py(17): pose_draw
  /root/.local/lib/python3.5/site-packages/scannerpy/op.py(427): wrapper_exec
  /root/.local/lib/python3.5/site-packages/scannerpy/database.py(949): execute
*** Check failure stack trace: ***
    @     0x7ff1a1d425cd  google::LogMessage::Fail()
    @     0x7ff1a1d44433  google::LogMessage::SendToLog()
    @     0x7ff1a1d4215b  google::LogMessage::Flush()
    @     0x7ff1a1d44e1e  google::LogMessageFatal::~LogMessageFatal()
    @     0x7ff17bcfece1  scanner::PythonKernel::execute()
    @     0x7ff17bcbaf5c  scanner::internal::EvaluateWorker::feed()
    @     0x7ff17bc71b66  _ZN7scanner8internal12_GLOBAL__N_115evaluate_driverERNS_5QueueISt5tupleIJSt5dequeINS0_10TaskStreamESaIS5_EENS0_13EvalWorkEntryEEEEESB_NS0_18EvaluateWorkerArgsE
    @     0x7ff17bc9e486  _ZNSt12_Bind_simpleIFPFvRN7scanner5QueueISt5tupleIJSt5dequeINS0_8internal10TaskStreamESaIS5_EENS4_13EvalWorkEntryEEEEESB_NS4_18EvaluateWorkerArgsEESt17reference_wrapperISA_ESG_SC_EE9_M_invokeIJLm0ELm1ELm2EEEEvSt12_Index_tupleIJXspT_EEE
    @     0x7ff17bc9e4df  std::thread::_Impl<>::_M_run()
    @     0x7ff1a3d3ec80  (unknown)
    @     0x7ff1b20de6ba  start_thread
    @     0x7ff1b1e1441d  clone
    @              (nil)  (unknown)
Aborted
willcrichton commented 5 years ago

I just pushed a fix that should solve both problems.

If you're using Docker, you'll need to wait ~2 hours for the build server to finish, and then you can pull down the latest image.