title: How to run python code with support of GPU
body: <p>I have created a flask service for accepting requests with camera URLs as parameters for finding objects(table, chair etc...) in the camera frame. I have written code in flask for accepting POST requests.</p>
  
  <pre><code>@app.route('/rest/detectObjects', methods=['GET','POST'])
  def detectObjects()
  ...
  json_result = function_call_for_detecting_objects()
  ...
  return
  </code></pre>
  
  <p>In the function, its loads the tf model for object detection and returns the result. A large amount of request needs to be processed simultaneously by the flask server. So I need to execute the function using GPU as the camera access time and image processing for object detection takes much time and CPU utilization. Have a 4 GB GeForce GTX 1050 Ti/PCIe/SSE2. How can I make my python script to make use of GPU for this?</p>