Class Core


  • public class Core
    extends Wrapper
    This class represents an OpenVINO runtime Core entity.

    User applications can create several Core class instances, but in this case the underlying plugins are created multiple times and not shared between several Core instances. The recommended way is to have a single Core instance per application.

    • Constructor Summary

      Constructors 
      Constructor Description
      Core()  
      Core​(java.lang.String xmlConfigFile)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CompiledModel compile_model​(Model model, java.lang.String device)
      Creates a compiled model from a source model object.
      protected void delete​(long nativeObj)  
      Any get_property​(java.lang.String device, java.lang.String name)
      Gets properties related to device behaviour.
      static void loadNativeLibs()
      Use this method to initialize native libraries.
      Model read_model​(java.lang.String modelPath)
      Same as read_model(String, String) but with empty weights path
      Model read_model​(java.lang.String modelPath, java.lang.String weightPath)
      Reads models from IR/ONNX/PDPD formats.
      void set_property​(java.lang.String device, java.util.Map<java.lang.String,​java.lang.String> prop)
      Sets properties for a device, acceptable keys can be found in openvino/runtime/properties.hpp.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NATIVE_LIBRARY_NAME

        public static final java.lang.String NATIVE_LIBRARY_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • Core

        public Core()
      • Core

        public Core​(java.lang.String xmlConfigFile)
    • Method Detail

      • loadNativeLibs

        public static void loadNativeLibs()
        Use this method to initialize native libraries. Other files like plugins.xml and *.mvcmd will be also copied to temporal location which makes them visible in runtime. To Do: fix for Android!
      • read_model

        public Model read_model​(java.lang.String modelPath,
                                java.lang.String weightPath)
        Reads models from IR/ONNX/PDPD formats.
        Parameters:
        modelPath - Path to a model.
        weightPath - Path to a data file.

        For IR format (*.bin):

        • if path is empty, will try to read a bin file with the same name as xml and
        • if the bin file with the same name is not found, will load IR without weights.
        For ONNX format (*.onnx):
        • the bin_path parameter is not used.
        For PDPD format (*.pdmodel)
        • the bin_path parameter is not used.
        Returns:
        A model.
      • compile_model

        public CompiledModel compile_model​(Model model,
                                           java.lang.String device)
        Creates a compiled model from a source model object.

        Users can create as many compiled models as they need and use them simultaneously (up to the limitation of the hardware resources).

        Parameters:
        model - Model object acquired from read_model(java.lang.String).
        device - Name of a device to load a model to.
        Returns:
        A compiled model.
      • get_property

        public Any get_property​(java.lang.String device,
                                java.lang.String name)
        Gets properties related to device behaviour.

        The method extracts information that can be set via the set_property method.

        Parameters:
        device - Name of a device to get a property value.
        name - Property name.
        Returns:
        Value of a property corresponding to the property name.
      • set_property

        public void set_property​(java.lang.String device,
                                 java.util.Map<java.lang.String,​java.lang.String> prop)
        Sets properties for a device, acceptable keys can be found in openvino/runtime/properties.hpp.
        Parameters:
        device - Name of a device to get a property value.
        prop - Map of pairs: (property name, property value).
      • delete

        protected void delete​(long nativeObj)
        Overrides:
        delete in class Wrapper