sberbank-ai commited on
Commit
8b72d70
1 Parent(s): ae42aba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import os
2
- os.system("pip install git+https://github.com/ai-forever/ReadingPipeline.git@onnx")
3
 
4
  import cv2
5
  import json
@@ -24,10 +24,12 @@ def get_config_and_download_weights(repo_id, device='cpu'):
24
  pipeline_config = json.load(f)
25
  pipeline_config['main_process']['SegmPrediction']['model_path'] = segm_model_path
26
  pipeline_config['main_process']['SegmPrediction']['config_path'] = segm_config_path
 
27
  pipeline_config['main_process']['SegmPrediction']['device'] = device
28
  pipeline_config['main_process']['SegmPrediction']['onnx'] = True
29
  pipeline_config['main_process']['OCRPrediction']['model_path'] = ocr_model_path
30
  pipeline_config['main_process']['OCRPrediction']['config_path'] = ocr_config_path
 
31
  pipeline_config['main_process']['OCRPrediction']['device'] = device
32
  pipeline_config['main_process']['OCRPrediction']['onnx'] = True
33
 
 
1
  import os
2
+ os.system("pip install git+https://github.com/ai-forever/ReadingPipeline.git")
3
 
4
  import cv2
5
  import json
 
24
  pipeline_config = json.load(f)
25
  pipeline_config['main_process']['SegmPrediction']['model_path'] = segm_model_path
26
  pipeline_config['main_process']['SegmPrediction']['config_path'] = segm_config_path
27
+ pipeline_config['main_process']['SegmPrediction']['num_threads'] = 2
28
  pipeline_config['main_process']['SegmPrediction']['device'] = device
29
  pipeline_config['main_process']['SegmPrediction']['onnx'] = True
30
  pipeline_config['main_process']['OCRPrediction']['model_path'] = ocr_model_path
31
  pipeline_config['main_process']['OCRPrediction']['config_path'] = ocr_config_path
32
+ pipeline_config['main_process']['OCRPrediction']['num_threads'] = 2
33
  pipeline_config['main_process']['OCRPrediction']['device'] = device
34
  pipeline_config['main_process']['OCRPrediction']['onnx'] = True
35