Skip to content

Commit

Permalink
修复重复check问题
Browse files Browse the repository at this point in the history
  • Loading branch information
YaoFANGUK committed Apr 12, 2022
1 parent adff19e commit 6d34de5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 0 additions & 4 deletions backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from paddle import fluid
from tools.constant import *

fluid.install_check.run_check()
# 判断代码路径是否合法
IS_LEGAL_PATH = True
config = configparser.ConfigParser()
Expand All @@ -42,11 +41,9 @@
interface_config.read(interface_file, encoding='utf-8')
# 设置识别语言
REC_CHAR_TYPE = config['DEFAULT']['Language']
print(f"{interface_config['Main']['RecSubLang']}{REC_CHAR_TYPE}")

# 设置识别模式
MODE_TYPE = config['DEFAULT']['Mode']
print(f"{interface_config['Main']['RecMode']}{MODE_TYPE}")
ACCURATE_MODE_ON = False
if MODE_TYPE == 'accurate':
ACCURATE_MODE_ON = True
Expand Down Expand Up @@ -110,7 +107,6 @@
if len(fluid.cuda_places()) > 0:
# 如果有GPU则使用GPU
USE_GPU = True
print(interface_config['Main']['GPUSpeedUp'])

# 使用快速字幕检测算法时,背景颜色
BG_MOD = BackgroundColor.DARK
Expand Down
7 changes: 6 additions & 1 deletion backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
import numpy as np
from tqdm import tqdm
import sys

from paddle import fluid
fluid.install_check.run_check()
sys.path.insert(0, os.path.dirname(__file__))
import config
from config import interface_config
Expand Down Expand Up @@ -90,6 +91,10 @@ def __init__(self, vd_path, sub_area=None):
self.raw_subtitle_path = os.path.join(self.subtitle_output_dir, 'raw.txt')
# 自定义ocr对象
self.ocr = OcrRecogniser()
print(f"{interface_config['Main']['RecSubLang']}{config.REC_CHAR_TYPE}")
print(f"{interface_config['Main']['RecMode']}{config.MODE_TYPE}")
if config.USE_GPU:
print(interface_config['Main']['GPUSpeedUp'])
# 处理进度
self.progress = 0
# 是否完成
Expand Down

0 comments on commit 6d34de5

Please sign in to comment.