Beispiel #1
0
 /// <summary>
 /// Reads a network model stored in Caffe model files from Stream.
 /// </summary>
 /// <param name="bufferProto">buffer containing the content of the .prototxt file</param>
 /// <param name="bufferModel">buffer containing the content of the .caffemodel file</param>
 /// <returns></returns>
 /// <remarks>This is shortcut consisting from createCaffeImporter and Net::populateNet calls.</remarks>
 public static Net?ReadNetFromCaffe(Stream bufferProto, Stream?bufferModel = null)
 {
     if (bufferProto == null)
     {
         throw new ArgumentNullException(nameof(bufferProto));
     }
     return(Net.ReadNetFromCaffe(
                bufferProto.StreamToArray(),
                bufferModel?.StreamToArray()));
 }
Beispiel #2
0
        /// <summary>
        /// Reads a network model stored in Caffe model files from memory.
        /// </summary>
        /// <param name="prototxtData"></param>
        /// <param name="caffeModelData"></param>
        /// <returns></returns>
        /// <remarks>This is shortcut consisting from createCaffeImporter and Net::populateNet calls.</remarks>
        // ReSharper disable once IdentifierTypo
        public static Net ReadNetFromCaffe(byte[] prototxtData, byte[] caffeModelData = null)
        {
            if (prototxtData == null)
            {
                throw new ArgumentNullException(nameof(prototxtData));
            }
            if (prototxtData.Length > int.MaxValue)
            {
                throw new ArgumentException("Not supported array (too long)");
            }

            return(Net.ReadNetFromCaffe(prototxtData, caffeModelData));
        }
Beispiel #3
0
 /// <summary>
 /// Reads a network model stored in Caffe model files.
 /// </summary>
 /// <param name="prototxt"></param>
 /// <param name="caffeModel"></param>
 /// <returns></returns>
 /// <remarks>This is shortcut consisting from createCaffeImporter and Net::populateNet calls.</remarks>
 // ReSharper disable once IdentifierTypo
 public static Net ReadNetFromCaffe(string prototxt, string?caffeModel = null)
 {
     return(Net.ReadNetFromCaffe(prototxt, caffeModel));
 }
Beispiel #4
0
 /// <summary>
 /// Reads a network model stored in Caffe model files from memory.
 /// </summary>
 /// <param name="bufferProto">buffer containing the content of the .prototxt file</param>
 /// <param name="bufferModel">buffer containing the content of the .caffemodel file</param>
 /// <returns></returns>
 /// <remarks>This is shortcut consisting from createCaffeImporter and Net::populateNet calls.</remarks>
 public static Net?ReadNetFromCaffe(ReadOnlySpan <byte> bufferProto, ReadOnlySpan <byte> bufferModel = default)
 {
     return(Net.ReadNetFromCaffe(bufferProto, bufferModel));
 }
Beispiel #5
0
 /// <summary>
 /// Reads a network model stored in Caffe model files from memory.
 /// </summary>
 /// <param name="bufferProto">buffer containing the content of the .prototxt file</param>
 /// <param name="bufferModel">buffer containing the content of the .caffemodel file</param>
 /// <returns></returns>
 /// <remarks>This is shortcut consisting from createCaffeImporter and Net::populateNet calls.</remarks>
 public static Net?ReadNetFromCaffe(byte[] bufferProto, byte[]?bufferModel = null)
 {
     return(Net.ReadNetFromCaffe(bufferProto, bufferModel));
 }