title: UnboundLocalError: local variable 'labels' referenced before assignment
body: <p>when i try to run this function it gives me this error 'UnboundLocalError: local variable 'labels' referenced before assignment' can any one help me please</p>
  
  <pre><code>@app.route('/', methods=['GET', 'POST'])
  def upload_file():
      if request.method == 'POST' and 'photo' in request.files:
          filename = photos.save(request.files['photo'])
          file_url = photos.url(filename)
          with io.open(filename, 'rb') as image_file:
              content = image_file.read()
          image = types.Image(content=content)
          response = vision_client.label_detection(image=image)
          labels = response.label_annotations()
  
      return render_template('index.html', thelabels=labels)
  
  </code></pre>