P.s. If it is still slow as you need to load and recreate the interpreter as its lifecycle end on each request you could  try to run TF Serving instance and consume it with Flask:

  
      

      Medium – 17 Jun 20
  

  
    

Serving ML with Flask, TensorFlow Serving and Docker Compose 2

  A short guide on how to serve your deep learning models in production using Flask, Docker-Compose and Tensorflow Serving

  
    Reading time: 4 min read