[英]Is it possible to output JSON data from the OpenPose library in real-time?
我試圖使用OpenPose姿勢估計庫(C ++)輸出身體位置信息,以便使用SuperCollider創建聲音。
JSON信息作為文件輸出,我想實時輸出數據。 我嘗試瀏覽過OpenPose的源代碼,但找不到指定輸出格式的任何特定部分。 “ filestream”文件夾中的頭文件似乎僅包含變量聲明,如下所示:
#ifndef
OPENPOSE_FILESTREAM_DATA_SAVER_HPP
#define
OPENPOSE_FILESTREAM_DATA_SAVER_HPP
#include <openpose/core/common.hpp>
#include <openpose/utilities/string.hpp>
namespace op
{
class OP_API FileSaver
{
protected:
explicit FileSaver(const std::string& directoryPath);
virtual ~FileSaver();
std::string getNextFileName(const unsigned long long index) const;
std::string getNextFileName(const std::string& fileNameNoExtension) const;
private:
const std::string mDirectoryPath;
};
}
#endif // OPENPOSE_FILESTREAM_DATA_SAVER_HPP
我希望找到一個文件路徑或類似的路徑,以引導我了解數據從何處輸出。 如果有人熟悉這個庫並且可以向我指出正確的方向,將不勝感激。
我的計划是使用Quarks API通過OSC將關鍵點數據發送到SuperCollider。 我正在使用MacOS X 10.11.6。
如果您已經下載了openpose示例代碼,則在文件openpose.cpp中 ,您將找到以下行
DEFINE_string(write_json,"","Directory to write OpenPose output in JSON format. It includes body, hand, and face pose keypoints (2-D and 3-D), as well as pose candidates (if `--part_candidates` enabled).");
json輸出文件的路徑由main的參數--write_json指定。 例如:
c:> openpose.exe --video“ D:\\ user \\ video.avi”-write_json“ D:\\ user \\ desktop \\ output.json”
輸入是視頻“ D:\\ user \\ video.avi ”,而json輸出是“ D:\\ user \\ desktop \\ output.json ”
注意:如果不使用參數--write_json,則不會寫入json輸出。
更新1:如果要直接訪問關鍵點,可以按照如何訪問姿勢關鍵點進行操作
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.