diff --git a/src/cv/pipeline.cpp b/src/cv/pipeline.cpp index 25cfa45e..4e9cafd6 100644 --- a/src/cv/pipeline.cpp +++ b/src/cv/pipeline.cpp @@ -127,12 +127,12 @@ PipelineResults Pipeline::run(const ImageData& imageData) { } } - LOG_F(INFO, "Finished Pipeline on an image"); - - // Wrap up the final annotated image to return + // Wrap up the final annotated image to compress and return ImageData processedData = imageData; - processedData.DATA = processedImage; + std::optional compressed = compressImg(processedImage); + processedData.DATA = compressed.value_or(processedImage);; + LOG_F(INFO, "Finished Pipeline on an image"); // Return a PipelineResults that includes: // 1) The final big image with bounding boxes drawn // 2) The bounding boxes + localized GPS coords diff --git a/src/network/gcs_routes.cpp b/src/network/gcs_routes.cpp index 1e3102b6..edf7ee0f 100644 --- a/src/network/gcs_routes.cpp +++ b/src/network/gcs_routes.cpp @@ -380,10 +380,8 @@ DEF_GCS_HANDLE(Get, targets, all) { // Set the run ID target.set_run_id(run.run_id); - std::optional optCompressedImg = compressImg(run.annotatedImage); - cv::Mat compressed_image = optCompressedImg.has_value() ? - optCompressedImg->clone() : run.annotatedImage; - std::string b64 = cvMatToBase64(compressed_image); + + std::string b64 = cvMatToBase64(run.annotatedImage); target.set_picture(b64); // Ensure coords and bboxes vectors are the same size (should be guaranteed by Aggregator