Making simple inferencing
Now we have seen that our trained model shows outstanding accuracy on both test and validation sets. So why don't we develop a UI that would help us make the thing easier? As outlined previously, we will develop a simple UI that will allow us to unload a sample image, and then we should be able to detect it through a simple button press. This part is pure Java, so I'm not going to discuss the details here.
If we run the PetClassifier.java
class, it first loads our trained model and acts as the backend deployed the model. Then it calls the UI.java
class to load the user interface, which looks as follows:

UI for the cat versus dog recognizer
In the console, you should experience the following logs/messages:
19:54:52.496 [pool-1-thread-1] INFO org.nd4j.linalg.factory.Nd4jBackend - Loaded [CpuBackend] backend 19:54:52.534 [pool-1-thread-1] WARN org.reflections.Reflections - given scan urls are empty. set urls in the configuration 19:54:52.865 [pool-1-thread-1] INFO org...