Cyril666 commited on
Commit
da9a957
·
1 Parent(s): 586ca03

First model version

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -51,13 +51,19 @@ def infer(filepath):
51
  cv2.imwrite('result.jpg', visual_image)
52
  return 'result.jpg', pd.DataFrame(result_words)
53
 
 
 
 
 
 
 
 
54
 
55
  iface = gr.Interface(
56
  fn=infer,
57
  title="张博强毕设展示",
58
- description="毕设题目:自然场景中任意形状文字的检测与识别\n目前进度:检测",
59
  inputs=[gr.inputs.Image(label="image", type="filepath")],
60
- outputs=[gr.outputs.Image(), gr.outputs.Dataframe(headers=['word'])], #
61
  examples=['figs/test/CANDY.png', 'figs/test/ESPLANADE.png', 'figs/test/KAPPA.png'],
62
- #article="<a href=\"https://github.com/MhLiao/MaskTextSpotterV3\">GitHub Repo</a>",
63
  ).launch(enable_queue=True, cache_examples=True)
 
51
  cv2.imwrite('result.jpg', visual_image)
52
  return 'result.jpg', pd.DataFrame(result_words)
53
 
54
+ description = gr.Markdown('''## Step 1 (Preprocess Input Image)
55
+ - Drop an image containing a near-frontal face to the **Input Image**.
56
+ - If there are multiple faces in the image, hit the Edit button in the upper right corner and crop the input image beforehand.
57
+ - Hit the **Detect & Align Face** button.
58
+ - Hit the **Reconstruct Face** button.
59
+ - The final result will be based on this **Reconstructed Face**. So, if the reconstructed image is not satisfactory, you may want to change the input image.
60
+ ''')
61
 
62
  iface = gr.Interface(
63
  fn=infer,
64
  title="张博强毕设展示",
65
+ description=description,
66
  inputs=[gr.inputs.Image(label="image", type="filepath")],
67
+ outputs=[gr.outputs.Image(), gr.outputs.Dataframe(headers=['word'])],
68
  examples=['figs/test/CANDY.png', 'figs/test/ESPLANADE.png', 'figs/test/KAPPA.png'],
 
69
  ).launch(enable_queue=True, cache_examples=True)