class_docstr: Args:
      use_gpu (bool): whether use gpu
      threshold (float): threshold to reserve the result for output.
class_docstr_tok: ["Args",":","use_gpu","(","bool",")",":","whether","use","gpu","threshold","(","float",")",":","threshold","to","reserve","the","result","for","output","."]
code: def create_gradio_app(self):
      import os
      import tempfile
      import gradio as gr
  
      from PIL import Image
  
      def inference(img, threshold):
          with tempfile.TemporaryDirectory() as tempdir_name:
              self.predict(
                  image=img,
                  threshold=threshold,
                  visualization=True,
                  save_dir=tempdir_name,
              )
              result_names = os.listdir(tempdir_name)
              return Image.open(
                  os.path.join(tempdir_name, result_names[0])
              )
  
      interface = gr.Interface(
          inference,
          inputs=[
              gr.inputs.Image(type="filepath"),
              gr.Slider(0.0, 1.0, value=0.5),
          ],
          outputs=gr.Image(label="segmentation"),
          title="SOLOv2",
          allow_flagging="never",
      )
  
      return interface
  
imports: import base64
  import os
  import time
  from functools import reduce
  from typing import Union
  import numpy
  import solov2.data_feed
  import solov2.processor
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.module import serving
label_desc: Use image node_id 4 for calling the DetectorSOLOv2 obj's underlying member method code with example usage: obj.create_gradio_app() and returns: interface, Image