diff --git a/include/cv/aggregator.hpp b/include/cv/aggregator.hpp index 003173a9..e2103f80 100644 --- a/include/cv/aggregator.hpp +++ b/include/cv/aggregator.hpp @@ -20,10 +20,11 @@ #include "utilities/lockptr.hpp" struct AggregatedRun { - int run_id; // Unique integer ID for this pipeline run - cv::Mat annotatedImage; // The "big image" with bounding boxes drawn - std::vector bboxes; // All bounding boxes in that image - std::vector coords; // Matching lat-longs for each bounding box + int run_id; // Unique integer ID for this pipeline run + cv::Mat annotatedImage; // The "big image" with bounding boxes drawn + std::vector bboxes; // All bounding boxes in that image + std::vector coords; // Matching lat-longs for each bounding box + std::vector targetTypes; // The corrsponding target types for each detection }; struct CVResults { diff --git a/src/camera/mock.cpp b/src/camera/mock.cpp index 730c3a61..2d483501 100644 --- a/src/camera/mock.cpp +++ b/src/camera/mock.cpp @@ -119,6 +119,7 @@ std::optional MockCamera::takePicture(const std::chrono::milliseconds "&alt_ft=" + std::to_string(static_cast((telemetry.altitude_agl_m * 3.281))) + //NOLINT "&heading=" + std::to_string(telemetry.heading_deg) + "&format=png"); + // httplib::Result res = cli.Get("/generate?&format=png"); if (!res || res->status != 200) { LOG_F(ERROR, "Failed to query server for images"); diff --git a/src/cv/aggregator.cpp b/src/cv/aggregator.cpp index 1e61b098..93b246ef 100644 --- a/src/cv/aggregator.cpp +++ b/src/cv/aggregator.cpp @@ -83,12 +83,12 @@ void CVAggregator::worker(ImageData image, int thread_num) { run.annotatedImage = pipeline_results.imageData.DATA.clone(); run.bboxes.reserve(pipeline_results.targets.size()); run.coords.reserve(pipeline_results.targets.size()); - + run.targetTypes.reserve(pipeline_results.targets.size()); for (auto& det : pipeline_results.targets) { run.bboxes.push_back(det.bbox); run.coords.push_back(det.coord); + run.targetTypes.push_back(det.likely_airdrop); } - { Lock lock(this->mut); this->results->runs.push_back(std::move(run)); diff --git a/src/network/gcs_routes.cpp b/src/network/gcs_routes.cpp index 0247f588..75fe9b4d 100644 --- a/src/network/gcs_routes.cpp +++ b/src/network/gcs_routes.cpp @@ -383,6 +383,8 @@ DEF_GCS_HANDLE(Get, targets, all) { proto_bbox->set_y1(run.bboxes[i].y1); proto_bbox->set_x2(run.bboxes[i].x2); proto_bbox->set_y2(run.bboxes[i].y2); + // Add a target type + target.add_target_type(run.targetTypes[i]); } // copy the target to a record object to store