// Path: hackadrone-core/src/main/java/nl/ordina/jtech/hackadrone/io/recognition/Prediction.java
// public class Prediction {
// 
//     private String label;
//     private double percentage;
// 
//     public Prediction(String label, double percentage) {
//         this.label = label;
//         this.percentage = percentage;
//     }
// 
//     public void setLabel(final String label) {
//         this.label = label;
//     }
// 
//     public void setPercentage(final double percentage) {
//         this.percentage = percentage;
//     }
// 
//     public String toString() {
//         return String.format("%s: %.2f ", this.label, this.percentage);
//     }
// 
// }


import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import nl.ordina.jtech.hackadrone.io.recognition.Prediction;
import org.datavec.image.loader.NativeImageLoader;
import org.deeplearning4j.nn.graph.ComputationGraph;
import org.deeplearning4j.util.ModelSerializer;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.dataset.api.preprocessor.DataNormalization;
import org.nd4j.linalg.dataset.api.preprocessor.VGG16ImagePreProcessor;
import org.nd4j.linalg.factory.Nd4j;
import org.nd4j.shade.jackson.databind.ObjectMapper;
package nl.ordina.jtech.hackadrone.io;




public class DeepLearning {

    private static final int HEIGHT = 224;
    private static final int WIDTH = 224;
    private static final int CHANNELS = 3;
    /**
     * Reference to Video Frame
     */
    private VideoFrame videoFrame;

    /**
     * Computational graph for deep learning
     */
    private ComputationGraph computationGraphVGG16;

    private NativeImageLoader nativeImageLoader;

    public DeepLearning() {
        this.nativeImageLoader = new NativeImageLoader(HEIGHT, WIDTH, CHANNELS);
        loadDataModel();
    }

    /**
     * Load the dataset and the computational graph for deep learning
     */
    private void loadDataModel() {
        //TODO Deep Learning Challenge Part 1: load existing data model
        computationGraphVGG16 = null;
    }

    /**
     * Pre process the image to create a matrix
     */
    private INDArray processImage(BufferedImage bufferedImage) {
        //TODO Deep Learning Challenge Part 2: Normalize the Image
        INDArray imageMatrix = null;


        normalizeImage(imageMatrix);
        return imageMatrix;
    }

    /**
     * Classify images
     */
// Path: hackadrone-core/src/main/java/nl/ordina/jtech/hackadrone/io/recognition/Prediction.java
// public class Prediction {
// 
//     private String label;
//     private double percentage;
// 
//     public Prediction(String label, double percentage) {
//         this.label = label;
//         this.percentage = percentage;
//     }
// 
//     public void setLabel(final String label) {
//         this.label = label;
//     }
// 
//     public void setPercentage(final double percentage) {
//         this.percentage = percentage;
//     }
// 
//     public String toString() {
//         return String.format("%s: %.2f ", this.label, this.percentage);
//     }
// 
// }


// Path: hackadrone-core/src/main/java/nl/ordina/jtech/hackadrone/io/DeepLearning.java
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import nl.ordina.jtech.hackadrone.io.recognition.Prediction;
import org.datavec.image.loader.NativeImageLoader;
import org.deeplearning4j.nn.graph.ComputationGraph;
import org.deeplearning4j.util.ModelSerializer;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.dataset.api.preprocessor.DataNormalization;
import org.nd4j.linalg.dataset.api.preprocessor.VGG16ImagePreProcessor;
import org.nd4j.linalg.factory.Nd4j;
import org.nd4j.shade.jackson.databind.ObjectMapper;

package nl.ordina.jtech.hackadrone.io;




public class DeepLearning {

    private static final int HEIGHT = 224;
    private static final int WIDTH = 224;
    private static final int CHANNELS = 3;
    /**
     * Reference to Video Frame
     */
    private VideoFrame videoFrame;

    /**
     * Computational graph for deep learning
     */
    private ComputationGraph computationGraphVGG16;

    private NativeImageLoader nativeImageLoader;

    public DeepLearning() {
        this.nativeImageLoader = new NativeImageLoader(HEIGHT, WIDTH, CHANNELS);
        loadDataModel();
    }

    /**
     * Load the dataset and the computational graph for deep learning
     */
    private void loadDataModel() {
        //TODO Deep Learning Challenge Part 1: load existing data model
        computationGraphVGG16 = null;
    }

    /**
     * Pre process the image to create a matrix
     */
    private INDArray processImage(BufferedImage bufferedImage) {
        //TODO Deep Learning Challenge Part 2: Normalize the Image
        INDArray imageMatrix = null;


        normalizeImage(imageMatrix);
        return imageMatrix;
    }

    /**
     * Classify images
     */
    private List<Prediction> classify(BufferedImage bufferedImage) {