public void LookupFalseTest()
        {
            GroundTruth.CreateGroundTruthLookup();

            string[] imageArray = GroundTruth.GetImageKeys();
            bool     isHealthy  = GroundTruth.Lookup("DSC00041.JPG");

            Assert.IsFalse(isHealthy);
        }
        public void GetImageKeysTest()
        {
            GroundTruth.CreateGroundTruthLookup();

            string[] imageArray  = GroundTruth.GetImageKeys();
            int      numEntries  = imageArray.Length;
            int      numPictures = 1787;

            Assert.IsTrue(numEntries == numPictures);
        }
Exemple #3
0
        /// <summary>
        /// This is the starting point of the server program. Here we assign the app a configuration and initialize Machine Learning engines.
        /// </summary>
        /// <param name="configuration">An IConfiguration object</param>
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;

            // Set Firebase URL:
            RestfulDBConnection.FIREBASE_URL = Configuration["FirebaseURL"];

            // Initialize Machine Learning Components:
            MLModel.CreatePredictionEngine();
            GroundTruth.CreateGroundTruthLookup();

            // Get the Machine Learning Warmed Up:
            MLModel.Predict("https://firebasestorage.googleapis.com/v0/b/agricultureai-15ce0.appspot.com/o/DSC00025.JPG?alt=media");
        }
        public void getNumTrueAndFalse()
        {
            int numTrue  = 0;
            int numFalse = 0;

            GroundTruth.CreateGroundTruthLookup();
            string[] imageArray = GroundTruth.GetImageKeys();

            int numImages = imageArray.Length;

            for (int i = 0; i < imageArray.Length; i++)
            {
                if (GroundTruth.Lookup((imageArray[i]).ToString()) == true)
                {
                    numTrue++;
                }
                else
                {
                    numFalse++;
                }
            }

            Assert.IsTrue((numFalse + numTrue) == numImages);
        }