title: Face recognition using python/tensorflow in Spring Boot app
body: <p>I am currently working on a server-side web app for the face recognition (using Spring Boot). Face detection should be done using SSD and face recognition using ArcFace. I’ve done some research and found out that such things, related to machine learning, are best to be done in Python. Thus, the next phase of my research was to find out the best way to use Python machine learning along with the Spring boot app. Two suitable (at least in my opinion) approaches are:</p>
  
  <ol>
  <li><p>Use the pre-trained Tensorflow models (using tensorflow dependency for maven). However, the tensorflow model for face recognition would have to be retrained every time face of new person is added to system. What might be the best way to do that in Java? (I was thinking to somehow run a Python script from Java to retrain the model).</p></li>
  <li><p>Build python app with REST API that would be running on a localhost. Java would just send the commands with the images to that REST API and get results (that means – say I’d sent 30 images and also command to carry out the face recognition on these, and then get a list of recognized faces as a result, or send 10 pictures of new person that should be added to system – i.e. app would learn the face). </p></li>
  </ol>
  
  <p>Could you give me some opinions on which of those 2 approaches is better and why?</p>
  
  <p>ps. Reason why I don't want to build the whole web app in Python is that I already have (some) experience with building Spring boot application while having very little experience with the Python.</p>