#ifndef OPENPOSE_FILESTREAM_POSE_JSON_COCO_SAVER_HPP #define OPENPOSE_FILESTREAM_POSE_JSON_COCO_SAVER_HPP #include #include #include #include namespace op { /** * The CocoJsonSaver class creates a COCO validation json file with details about the processed images. It * inherits from Recorder. */ class OP_API CocoJsonSaver { public: /** * This constructor of CocoJsonSaver extends the Recorder::Recorder(const std::string & filePathToSave) * constructor. * @param filePathToSave const std::string parameter with the final file path where the generated json file * will be saved. */ explicit CocoJsonSaver( const std::string& filePathToSave, const PoseModel poseModel, const bool humanReadable = true, const CocoJsonFormat cocoJsonFormat = CocoJsonFormat::Body, const int mCocoJsonVariant = 0); virtual ~CocoJsonSaver(); void record( const Array& poseKeypoints, const Array& poseScores, const std::string& imageName, const unsigned long long frameNumber); private: const PoseModel mPoseModel; const CocoJsonFormat mCocoJsonFormat; const int mCocoJsonVariant; JsonOfstream mJsonOfstream; bool mFirstElementAdded; DELETE_COPY(CocoJsonSaver); }; } #endif // OPENPOSE_FILESTREAM_POSE_JSON_COCO_SAVER_HPP