Untitled
raw download clone
TEXT
views 34
,
size 1105 b
void SingleTracker::save_log3() {
    if (is_sent_log)
        return;

    if (this->track_name.empty())
        return;

//    this->save_image(frame);
    Json::Value jsonData;

    if (!is_saved)
        return;
    std::cout << std::to_string(track_id) << "-------- save_log3 " << std::endl;
    jsonData["camera_id"] = 2;
    jsonData["path"] = path;
    jsonData["mongo_id"] = track_name;
    jsonData["score"] = score;

    if (this->track_name == "0") {
        std::vector<double> vt(dlib::trans(this->vector128).begin(), dlib::trans(this->vector128).end());
        Json::Value vtData(Json::arrayValue);
        for (int j = 0; j < vt.size(); j++) {
            vtData.append(Json::Value(vt[j]));
        }
        jsonData["vector"] = vtData;
    } else {
        jsonData["vector"] = "";
    }

    Json::FastWriter fastWriter;
    std::string jsString = fastWriter.write(jsonData);
    std::cout << "body_res" << jsString << std::endl;
    RestClient::Response res = RestClient::post(URL_SAVE_LOG3, "application/json", jsString);
    is_sent_log = true;

}
close fullscreen
Login or Register to edit or fork this paste. It's free.