Class SegmentObjectsFromTensorFlowModel

Object
AnchorBean<SegmentStackIntoObjectsPooled<OpenCVModel>>
InitializableBean<SegmentStackIntoObjectsPooled<OpenCVModel>, ImageInitialization>
ImageBean<SegmentStackIntoObjectsPooled<OpenCVModel>>
SegmentationBean<SegmentStackIntoObjectsPooled<OpenCVModel>>
SegmentStackIntoObjectsPooled<OpenCVModel>
SegmentStackIntoObjectsScaleDecode<org.opencv.core.Mat, OpenCVModel>
SegmentObjectsFromTensorFlowModel

public class SegmentObjectsFromTensorFlowModel extends SegmentStackIntoObjectsScaleDecode<org.opencv.core.Mat, OpenCVModel>
Performs instance-segmentation using OpenCV's DNN module and a TensorFlow .pb SavedModel file.

Optionally a .pb.txt file may accompany it.

Author:
Owen Feehan
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    ConcurrentModelPool<OpenCVModel>
    createModelPool(ConcurrencyPlan plan, Logger logger)
     
    protected org.opencv.core.Mat
    deriveInput(Stack stack, Optional<double[]> subtractMeans)
     
    Relative-path to the TensorFlow model file, likely with .pb extension, relative to the models/ directory in the Anchor distribution.
    Relative-path to the TensorFlow model file, likely with .pb.txt extension, relative to the models/ directory in the Anchor distribution.
    protected Optional<String>
     
    void
    setModelBinaryPath(String modelBinaryPath)
    Relative-path to the TensorFlow model file, likely with .pb extension, relative to the models/ directory in the Anchor distribution.
    void
    setModelTextGraphPath(String modelTextGraphPath)
    Relative-path to the TensorFlow model file, likely with .pb.txt extension, relative to the models/ directory in the Anchor distribution.

    Methods inherited from class org.anchoranalysis.image.inference.bean.segment.instance.SegmentStackIntoObjectsScaleDecode

    getClassLabelsPath, getDecode, getDisplayer, getInterpolator, getScaleInput, getSubtractMean, segment, setClassLabelsPath, setDecode, setDisplayer, setInterpolator, setScaleInput, setSubtractMean

    Methods inherited from class org.anchoranalysis.image.inference.bean.segment.instance.SegmentStackIntoObjectsPooled

    resolve, segment

    Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean

    getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization

    Methods inherited from class org.anchoranalysis.bean.AnchorBean

    checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SegmentObjectsFromTensorFlowModel

      public SegmentObjectsFromTensorFlowModel()
  • Method Details

    • createModelPool

      public ConcurrentModelPool<OpenCVModel> createModelPool(ConcurrencyPlan plan, Logger logger) throws CreateModelFailedException
      Specified by:
      createModelPool in class SegmentStackIntoObjectsPooled<OpenCVModel>
      Throws:
      CreateModelFailedException
    • deriveInput

      protected org.opencv.core.Mat deriveInput(Stack stack, Optional<double[]> subtractMeans) throws OperationFailedException
      Specified by:
      deriveInput in class SegmentStackIntoObjectsScaleDecode<org.opencv.core.Mat, OpenCVModel>
      Throws:
      OperationFailedException
    • inputName

      protected Optional<String> inputName()
      Specified by:
      inputName in class SegmentStackIntoObjectsScaleDecode<org.opencv.core.Mat, OpenCVModel>
    • getModelBinaryPath

      public String getModelBinaryPath()
      Relative-path to the TensorFlow model file, likely with .pb extension, relative to the models/ directory in the Anchor distribution.
    • setModelBinaryPath

      public void setModelBinaryPath(String modelBinaryPath)
      Relative-path to the TensorFlow model file, likely with .pb extension, relative to the models/ directory in the Anchor distribution.
    • getModelTextGraphPath

      public String getModelTextGraphPath()
      Relative-path to the TensorFlow model file, likely with .pb.txt extension, relative to the models/ directory in the Anchor distribution.

      If empty, then no such file is specified.

    • setModelTextGraphPath

      public void setModelTextGraphPath(String modelTextGraphPath)
      Relative-path to the TensorFlow model file, likely with .pb.txt extension, relative to the models/ directory in the Anchor distribution.

      If empty, then no such file is specified.