Pular para o conteúdo principal

Postagens

Mostrando postagens de maio, 2018

The Image Classifier Microservice is public on Docker repository

Using fabric8 docker plugin and the project from A Java microservice for image classification using Thorntail and DeepLearning4J  post I was able to build a docker image and I pushed it to my Docker repository! In this post I am sharing the steps I followed to build the docker image and publish it. Next post I hope to show you how to run on Openshift with some real world application. Step 1: Build an image from the Thorntail project This is simple, you will need just a configuration in the maven descriptor, see the changes in the project pom.xml . Notice that I had to made a manual copy of a JAR file as described in Thorntail's issue #951 , however, I am probably missing something, that may not be a bug,. Let's wait to see what Thorntail team will provide as a feedback for that issue. I wasn't a bug, Bob just commented on the issue, the solution is not use the thin mode. For having help I pinged Thorntail users on #thorntail IRC channel in freenode and Ken Finin...

A Java microservice for image classification using Thorntail and DeepLearning4J

If you want to consume a trained neural network from an application you will probably not want to package the model within your app. Models usually occupies ~50mb of disk size, see these keras trained models for example. A good approach for allowing other applications to use your model is a separated microservice and, if you are a Java developer, Thorntail is the best choice: Native CDI; Native Eclipse Microprofile support; Seamless Integration with JAX-RS; Plugin for creating docker images For image classification nowadays we use CNN neural networks and for Java developers DeepLearning4J is the API you are looking for. You can consume some of the multiple pre-trained models , build your own model or even use a Keras Model ! So yes, we need a microservice for image classification. The microservice should be responsible to run a model that we configure and if we don't provide a model, it should use a default one. It should be accessible using REST and it should cach...

Detecting objects in a JavaFX application using YOLOv2 and DeepLearning4J

A few months ago we published  here the post Detecting Objects using JavaFX and Deep Learning . Recently it was added to Eclipse DeepLearning4J a new model: Yolo2, which is based on YoloV2. It is already available in maven central on DL4J 1.0.0-beta version. Using the application from our older post we just modified two lines of Java code (see the commit )   to use YOLOv2 from the JavaFX application we built earlier. The result is a more precise detector with more classes! If you want to try it just follow the instruction from my previous post . I hope next time I can test YOLOv3, which is the state-of-the-art deep learning model for object detection!  Deep Learning in Java is possible and easy to use due DL4J developers hard work, so thank you guys, you are amazing.

Thorntail development mode: no more redeploys

As a Java developer you know the pain which is having to redeploy the entire application when you want to test the code change you made. You know that there are IDE plugins that can help in this task, but these IDE plugins may only work in certain conditions, like deploying a WAR in an application server. In 2018 this may not be the case, you may not be working with an application server, you may be doing a fat JAR with all your stuff in there.Or you may not be even using an IDE. We already talked about Wildfly Swarm here and it was recently renamed to Thorntail  and it comes with an out of the box plugin that allows you to set a DEV MODE. In DEV MODE your Java server side code can magically be reloaded without any action on your side, you just have to compile the code, it  watches the class changes and reload the server! Yes, guys, this is Java and no redeploy it needed anymore. Thorntail hello world This is Thorntail To show this feature let's start from t...

Measuring and comparing sorting algorithms execution time using JavaFX

JavaFX is a great tool to show data, it has a built in chart API and great tutorials to use it in the internet. I was doing a class on Algorithms and Data Structure because I was concerned about keeping the base concepts fresh in my mind. Using JavaFX I made this small, but still useful, tool to measure execution time of sorting algorithms. See some screenshots: First you select which algorithm you wanted to run and provide the number of elements to run The tree will show which algorithm run faster and the slowe You can visualize each algorithm performance on each amount of elements and compare them Besidesthe visualization part we also have a few interesting features for basic to intermediary Java programmers: It makes use of threads. I tried to put the algorithms running in different threads; The app uses SPI - Java Service Provider Interface - allowing you to plug any algorithm by just implementing the interface SortAlgorithm (should it be SortingAlgorithm?), pa...