sberbank-ai commited on
Commit
703c829
1 Parent(s): 4bb3965

refactor: Minor refactor

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -45,14 +45,13 @@ def predict(image_path):
45
  return '\n'.join(result_text)
46
 
47
 
48
- if __name__ == '__main__':
49
- PIPELINE_CONFIG_PATH = get_config_and_download_weights("sberbank-ai/ReadingPipeline-Peter")
50
 
51
- PREDICTOR = PipelinePredictor(pipeline_config_path=PIPELINE_CONFIG_PATH)
52
 
53
- gr.Interface(
54
- predict,
55
- inputs=gr.Image(label="Upload an image", type="filepath"),
56
- outputs=gr.Textbox(label="Text on the image"),
57
- title="Text on the image",
58
- ).launch()
 
45
  return '\n'.join(result_text)
46
 
47
 
48
+ PIPELINE_CONFIG_PATH = get_config_and_download_weights("sberbank-ai/ReadingPipeline-Peter")
 
49
 
50
+ PREDICTOR = PipelinePredictor(pipeline_config_path=PIPELINE_CONFIG_PATH)
51
 
52
+ gr.Interface(
53
+ predict,
54
+ inputs=gr.Image(label="Upload an image of Peter manuscript", type="filepath"),
55
+ outputs=gr.Textbox(label="Text on the image"),
56
+ title="Peter manuscript recognition",
57
+ ).launch()