You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by bo...@apache.org on 2021/04/06 14:05:17 UTC

[incubator-streampipes-extensions] 01/03: [STREAMPIPES-339] adaptions to changes in ObjectDetection

This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes-extensions.git

commit ae31c1c681091f9dbb1e76e4937e34b9091cb6a1
Author: bossenti <bo...@posteo.de>
AuthorDate: Mon Mar 29 09:49:30 2021 +0200

    [STREAMPIPES-339] adaptions to changes in ObjectDetection
---
 .../imageprocessing/jvm/processor/imagecropper/ImageCropper.java       | 3 ++-
 .../jvm/processor/imagecropper/ImageCropperController.java             | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/streampipes-processors-image-processing-jvm/src/main/java/org/apache/streampipes/processors/imageprocessing/jvm/processor/imagecropper/ImageCropper.java b/streampipes-processors-image-processing-jvm/src/main/java/org/apache/streampipes/processors/imageprocessing/jvm/processor/imagecropper/ImageCropper.java
index 8390326..d3a20d7 100644
--- a/streampipes-processors-image-processing-jvm/src/main/java/org/apache/streampipes/processors/imageprocessing/jvm/processor/imagecropper/ImageCropper.java
+++ b/streampipes-processors-image-processing-jvm/src/main/java/org/apache/streampipes/processors/imageprocessing/jvm/processor/imagecropper/ImageCropper.java
@@ -58,8 +58,9 @@ public class ImageCropper implements EventProcessor<ImageCropperParameters> {
 
         if (finalImage.isPresent()) {
           Event outEvent = new Event();
+          outEvent.addField("timestamp", Long.toString(in.getFieldByRuntimeName("timestamp").getAsPrimitive().getAsLong()));
           outEvent.addField("image", Base64.getEncoder().encodeToString(finalImage.get()));
-          outEvent.addField("classesindex", box.get("classesindex"));
+          outEvent.addField("classname", box.get("classname"));
           outEvent.addField("score", box.get("score"));
           out.collect(outEvent);
         }
diff --git a/streampipes-processors-image-processing-jvm/src/main/java/org/apache/streampipes/processors/imageprocessing/jvm/processor/imagecropper/ImageCropperController.java b/streampipes-processors-image-processing-jvm/src/main/java/org/apache/streampipes/processors/imageprocessing/jvm/processor/imagecropper/ImageCropperController.java
index 80fdc1d..604a0aa 100644
--- a/streampipes-processors-image-processing-jvm/src/main/java/org/apache/streampipes/processors/imageprocessing/jvm/processor/imagecropper/ImageCropperController.java
+++ b/streampipes-processors-image-processing-jvm/src/main/java/org/apache/streampipes/processors/imageprocessing/jvm/processor/imagecropper/ImageCropperController.java
@@ -45,7 +45,7 @@ public class ImageCropperController extends StandaloneEventProcessingDeclarer<Im
             .category(DataProcessorType.FILTER)
             .requiredStream(RequiredBoxStream.getBoxStream())
             .outputStrategy(OutputStrategies.append(
-                    EpProperties.integerEp(Labels.empty(), "classesindex", "https://streampipes.org/Label"),
+                    EpProperties.integerEp(Labels.empty(), "classname", "https://streampipes.org/classname"),
                     EpProperties.doubleEp(Labels.empty(), "score", "https://streampipes.org/Label")
             ))
             .build();