code: def upload_image():
      # 检测图片是否上传成功
      if request.method == "POST":
          if "file" not in request.files:
              return redirect(request.url)
  
          file = request.files["file"]
  
          if file.filename == "":
              return redirect(request.url)
  
          if file and allowed_file(file.filename):
              # 图片上传成功，检测图片中的人脸
              return detect_faces_in_image(file)
  
      # 图片上传失败，输出以下html代码
      return """
      <!doctype html>
      <title>Is this a picture of Obama?</title>
      <h1>Upload a picture and see if it's a picture of Obama!</h1>
      <form method="POST" enctype="multipart/form-data">
        <input type="file" name="file">
        <input type="submit" value="Upload">
      </form>
      """
  
imports: import face_recognition
  from flask import Flask, jsonify, request, redirect
label_desc: Use image node_id 2 for calling a global function with example usage: upload_image() and returns: str, redirect, redirect, detect_faces_in_image