Exemple #1
0
 public int PredictClasses(object inputs)
 {
     if (inputs is null)
     {
         throw new ArgumentNullException(nameof(inputs));
     }
     return(NeuralNetworkAPI.IndexOfMax((float[])ForwardPropagation(inputs)));
 }
 public NeuralNetworkBoundBox(float score, float minX, float minY, float maxX, float maxY, float[] classes)
 {
     Score   = score;
     MinX    = minX;
     MinY    = minY;
     MaxX    = maxX;
     MaxY    = maxY;
     Classes = classes;
     Label   = NeuralNetworkAPI.IndexOfMax(classes);
 }
Exemple #3
0
        }        //todo 待实现

        void PrintBoxes(string title, List <NeuralNetworkBoundBox> boundBoxes)
        {
            return;

            Console.WriteLine();
            Console.WriteLine(title);
            foreach (var boundBox in boundBoxes)
            {
                int label = NeuralNetworkAPI.IndexOfMax(boundBox.Classes);
                Console.WriteLine($"标签:{label} 得分:{boundBox.Classes[label]} 最小X:{boundBox.MinX} 最小Y:{boundBox.MinY} 最大X:{boundBox.MaxX} 最大Y:{boundBox.MaxY}");
                Console.WriteLine($"Classes:{string.Join (", ", Array.ConvertAll (boundBox.Classes, classes => classes.ToString ()))}");
            }
        }