diff --git a/function/object-detection-function/README.adoc b/function/object-detection-function/README.adoc index 55091165..3128ab1d 100644 --- a/function/object-detection-function/README.adoc +++ b/function/object-detection-function/README.adoc @@ -41,7 +41,7 @@ convert the result into JSON format and augment the input image with the detecte [source,java,linenums] ---- ObjectDetectionService detectionService = new ObjectDetectionService( - "http://download.tensorflow.org/models/object_detection/faster_rcnn_nas_coco_2018_01_28.tar.gz#frozen_inference_graph.pb", //<1> + "https://download.tensorflow.org/models/object_detection/faster_rcnn_nas_coco_2018_01_28.tar.gz#frozen_inference_graph.pb", //<1> "https://raw.githubusercontent.com/tensorflow/models/master/research/object_detection/data/mscoco_label_map.pbtxt", //<2> 0.4f, //<3> false, //<4> @@ -103,7 +103,7 @@ NOTE: It requires a trained model that supports `Masks` as well as setting the i [source,java,linenums] ---- ObjectDetectionService detectionService = new ObjectDetectionService( - "http://download.tensorflow.org/models/object_detection/mask_rcnn_inception_resnet_v2_atrous_coco_2018_01_28.tar.gz#frozen_inference_graph.pb", // <1> + "https://download.tensorflow.org/models/object_detection/mask_rcnn_inception_resnet_v2_atrous_coco_2018_01_28.tar.gz#frozen_inference_graph.pb", // <1> "https://raw.githubusercontent.com/tensorflow/models/master/research/object_detection/data/mscoco_label_map.pbtxt", // <2> 0.4f, // <3> true, // <4> @@ -152,10 +152,10 @@ Following models can be used for `Instance Segmentation` as well: [frame=none, grid=none] |=== -| http://download.tensorflow.org/models/object_detection/mask_rcnn_inception_resnet_v2_atrous_coco_2018_01_28.tar.gz[mask_rcnn_inception_resnet_v2_atrous_coco_2018_01_28.tar.gz] -| http://download.tensorflow.org/models/object_detection/mask_rcnn_inception_v2_coco_2018_01_28.tar.gz[mask_rcnn_inception_v2_coco_2018_01_28.tar.gz] -| http://download.tensorflow.org/models/object_detection/mask_rcnn_resnet101_atrous_coco_2018_01_28.tar.gz[mask_rcnn_resnet101_atrous_coco_2018_01_28.tar.gz] -| http://download.tensorflow.org/models/object_detection/mask_rcnn_resnet50_atrous_coco_2018_01_28.tar.gz[mask_rcnn_resnet50_atrous_coco_2018_01_28.tar.gz] +| https://download.tensorflow.org/models/object_detection/mask_rcnn_inception_resnet_v2_atrous_coco_2018_01_28.tar.gz[mask_rcnn_inception_resnet_v2_atrous_coco_2018_01_28.tar.gz] +| https://download.tensorflow.org/models/object_detection/mask_rcnn_inception_v2_coco_2018_01_28.tar.gz[mask_rcnn_inception_v2_coco_2018_01_28.tar.gz] +| https://download.tensorflow.org/models/object_detection/mask_rcnn_resnet101_atrous_coco_2018_01_28.tar.gz[mask_rcnn_resnet101_atrous_coco_2018_01_28.tar.gz] +| https://download.tensorflow.org/models/object_detection/mask_rcnn_resnet50_atrous_coco_2018_01_28.tar.gz[mask_rcnn_resnet50_atrous_coco_2018_01_28.tar.gz] |=== In addition to the model, the `ObjectDetectionService` requires a list of labels that correspond to the categories detectable by the selected model. diff --git a/function/object-detection-function/src/main/java/org/springframework/cloud/fn/object/detection/ObjectDetectionService2.java b/function/object-detection-function/src/main/java/org/springframework/cloud/fn/object/detection/ObjectDetectionService2.java index bda73aa2..09c3cc92 100644 --- a/function/object-detection-function/src/main/java/org/springframework/cloud/fn/object/detection/ObjectDetectionService2.java +++ b/function/object-detection-function/src/main/java/org/springframework/cloud/fn/object/detection/ObjectDetectionService2.java @@ -94,8 +94,8 @@ public class ObjectDetectionService2 implements AutoCloseable { } public static void main(String[] args) throws IOException { - String modelUri = "http://dl.bintray.com/big-data/generic/ssdlite_mobilenet_v2_coco_2018_05_09_frozen_inference_graph.pb"; - String labelUri = "http://dl.bintray.com/big-data/generic/mscoco_label_map.pbtxt"; + String modelUri = "https://dl.bintray.com/big-data/generic/ssdlite_mobilenet_v2_coco_2018_05_09_frozen_inference_graph.pb"; + String labelUri = "https://dl.bintray.com/big-data/generic/mscoco_label_map.pbtxt"; ObjectDetectionOutputConverter outputAdapter = new ObjectDetectionOutputConverter( new DefaultResourceLoader().getResource(labelUri), 0.4f, FETCH_NAMES); diff --git a/function/object-detection-function/src/test/java/org/springframework/cloud/fn/object/detection/examples/ExampleInstanceSegmentation.java b/function/object-detection-function/src/test/java/org/springframework/cloud/fn/object/detection/examples/ExampleInstanceSegmentation.java index 31aa1ecf..58ecf276 100644 --- a/function/object-detection-function/src/test/java/org/springframework/cloud/fn/object/detection/examples/ExampleInstanceSegmentation.java +++ b/function/object-detection-function/src/test/java/org/springframework/cloud/fn/object/detection/examples/ExampleInstanceSegmentation.java @@ -52,7 +52,7 @@ public class ExampleInstanceSegmentation { // You can download pre-trained models directly from the zoo: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md // Just use the notation # // For performance reasons you may consider downloading the model locally and use the file:/ URI instead! - String model = "http://download.tensorflow.org/models/object_detection/mask_rcnn_inception_resnet_v2_atrous_coco_2018_01_28.tar.gz#frozen_inference_graph.pb"; + String model = "https://download.tensorflow.org/models/object_detection/mask_rcnn_inception_resnet_v2_atrous_coco_2018_01_28.tar.gz#frozen_inference_graph.pb"; // All labels for the pre-trained models are available at: // https://github.com/tensorflow/models/tree/master/research/object_detection/data diff --git a/function/object-detection-function/src/test/java/org/springframework/cloud/fn/object/detection/examples/ExampleObjectDetection.java b/function/object-detection-function/src/test/java/org/springframework/cloud/fn/object/detection/examples/ExampleObjectDetection.java index f2d3102d..7a8899e1 100644 --- a/function/object-detection-function/src/test/java/org/springframework/cloud/fn/object/detection/examples/ExampleObjectDetection.java +++ b/function/object-detection-function/src/test/java/org/springframework/cloud/fn/object/detection/examples/ExampleObjectDetection.java @@ -40,9 +40,9 @@ public class ExampleObjectDetection { // You can download pre-trained models directly from the zoo: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md // Just use the notation # // For performance reasons you may consider downloading the model locally and use the file:/ URI instead! - String model = "http://download.tensorflow.org/models/object_detection/faster_rcnn_nas_coco_2018_01_28.tar.gz#frozen_inference_graph.pb"; - //Resource model = resourceLoader.getResource("http://download.tensorflow.org/models/object_detection/faster_rcnn_resnet101_fgvc_2018_07_19.tar.gz#frozen_inference_graph.pb"); - //Resource model = resourceLoader.getResource("http://download.tensorflow.org/models/object_detection/faster_rcnn_resnet50_fgvc_2018_07_19.tar.gz#frozen_inference_graph.pb"); + String model = "https://download.tensorflow.org/models/object_detection/faster_rcnn_nas_coco_2018_01_28.tar.gz#frozen_inference_graph.pb"; + //Resource model = resourceLoader.getResource("https://download.tensorflow.org/models/object_detection/faster_rcnn_resnet101_fgvc_2018_07_19.tar.gz#frozen_inference_graph.pb"); + //Resource model = resourceLoader.getResource("https://download.tensorflow.org/models/object_detection/faster_rcnn_resnet50_fgvc_2018_07_19.tar.gz#frozen_inference_graph.pb"); // All labels for the pre-trained models are available at: // https://github.com/tensorflow/models/tree/master/research/object_detection/data diff --git a/function/object-detection-function/src/test/java/org/springframework/cloud/fn/object/detection/examples/SimpleExample.java b/function/object-detection-function/src/test/java/org/springframework/cloud/fn/object/detection/examples/SimpleExample.java index b0b60f36..039cd8dc 100644 --- a/function/object-detection-function/src/test/java/org/springframework/cloud/fn/object/detection/examples/SimpleExample.java +++ b/function/object-detection-function/src/test/java/org/springframework/cloud/fn/object/detection/examples/SimpleExample.java @@ -30,7 +30,7 @@ public class SimpleExample { public static void main(String[] args) { // Select a pre-trained model from the model zoo: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md // Just use the notation # - String model = "http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_ppn_shared_box_predictor_300x300_coco14_sync_2018_07_03.tar.gz#frozen_inference_graph.pb"; + String model = "https://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_ppn_shared_box_predictor_300x300_coco14_sync_2018_07_03.tar.gz#frozen_inference_graph.pb"; // All labels for the pre-trained models are available at: https://github.com/tensorflow/models/tree/master/research/object_detection/data String labels = "https://raw.githubusercontent.com/tensorflow/models/master/research/object_detection/data/mscoco_label_map.pbtxt"; diff --git a/function/semantic-segmentation-function/README.adoc b/function/semantic-segmentation-function/README.adoc index 81c19405..415ca928 100644 --- a/function/semantic-segmentation-function/README.adoc +++ b/function/semantic-segmentation-function/README.adoc @@ -42,7 +42,7 @@ Following snippet demos how to use the PASCAL VOC model to apply mask to an inpu ---- SemanticSegmentation segmentationService = new SemanticSegmentation( - "http://download.tensorflow.org/models/deeplabv3_mnv2_pascal_trainval_2018_01_29.tar.gz#frozen_inference_graph.pb", // <1> + "https://download.tensorflow.org/models/deeplabv3_mnv2_pascal_trainval_2018_01_29.tar.gz#frozen_inference_graph.pb", // <1> true); // <2> byte[] inputImage = GraphicsUtils.loadAsByteArray("classpath:/images/VikiMaxiAdi.jpg"); // <3> @@ -87,13 +87,13 @@ Also, convenience there are a couple of models, extracted from the archive and u [cols=2*,, frame=none, grid=none] |=== |PASCAL VOC 2012 (default) -|http://dl.bintray.com/big-data/generic/deeplabv3_mnv2_pascal_train_aug_frozen_inference_graph.pb +|https://dl.bintray.com/big-data/generic/deeplabv3_mnv2_pascal_train_aug_frozen_inference_graph.pb |CITYSCAPE -|http://dl.bintray.com/big-data/generic/deeplabv3_mnv2_cityscapes_train_2018_02_05_frozen_inference_graph.pb +|https://dl.bintray.com/big-data/generic/deeplabv3_mnv2_cityscapes_train_2018_02_05_frozen_inference_graph.pb |ADE20K -|http://dl.bintray.com/big-data/generic/deeplabv3_xception_ade20k_train_2018_05_29_frozen_inference_graph.pb +|https://dl.bintray.com/big-data/generic/deeplabv3_xception_ade20k_train_2018_05_29_frozen_inference_graph.pb |=== ## References: diff --git a/function/semantic-segmentation-function/src/main/java/org/springframework/cloud/fn/semantic/segmentation/SemanticSegmentation.java b/function/semantic-segmentation-function/src/main/java/org/springframework/cloud/fn/semantic/segmentation/SemanticSegmentation.java index fb872ae4..35171889 100644 --- a/function/semantic-segmentation-function/src/main/java/org/springframework/cloud/fn/semantic/segmentation/SemanticSegmentation.java +++ b/function/semantic-segmentation-function/src/main/java/org/springframework/cloud/fn/semantic/segmentation/SemanticSegmentation.java @@ -221,7 +221,7 @@ public class SemanticSegmentation implements AutoCloseable { public static void main(String[] args) throws IOException { try (SemanticSegmentation segmentationService = new SemanticSegmentation( - "http://download.tensorflow.org/models/deeplabv3_mnv2_cityscapes_train_2018_02_05.tar.gz#frozen_inference_graph.pb", + "https://download.tensorflow.org/models/deeplabv3_mnv2_cityscapes_train_2018_02_05.tar.gz#frozen_inference_graph.pb", SegmentationColorMap.loadColorMap("classpath:/colormap/citymap_colormap.json"), null, 0.45f) ) { byte[] inputImage = GraphicsUtils.loadAsByteArray("classpath:/images/amsterdam-cityscape1.jpg"); @@ -243,7 +243,7 @@ public class SemanticSegmentation implements AutoCloseable { } try (SemanticSegmentation segmentationService = new SemanticSegmentation( - "http://download.tensorflow.org/models/deeplabv3_xception_ade20k_train_2018_05_29.tar.gz#frozen_inference_graph.pb", + "https://download.tensorflow.org/models/deeplabv3_xception_ade20k_train_2018_05_29.tar.gz#frozen_inference_graph.pb", SegmentationColorMap.loadColorMap("classpath:/colormap/ade20k_colormap.json"), null, 0.45f) ) { byte[] inputImage = GraphicsUtils.loadAsByteArray("classpath:/images/interior.jpg"); @@ -263,7 +263,7 @@ public class SemanticSegmentation implements AutoCloseable { } try (SemanticSegmentation segmentationService = new SemanticSegmentation( - "http://download.tensorflow.org/models/deeplabv3_mnv2_pascal_trainval_2018_01_29.tar.gz#frozen_inference_graph.pb", + "https://download.tensorflow.org/models/deeplabv3_mnv2_pascal_trainval_2018_01_29.tar.gz#frozen_inference_graph.pb", SegmentationColorMap.loadColorMap("classpath:/colormap/black_white_colormap.json"), null, 0.45f) ) { byte[] inputImage = GraphicsUtils.loadAsByteArray("classpath:/images/VikiMaxiAdi.jpg");