Luke commited on
Commit
19e324f
·
1 Parent(s): 3496bd9

no message

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -9,6 +9,15 @@ from Plan.pytesseractJsOCR import pytesseractJs_recognition
9
  from Plan.pytesseractOCR import ocr_recognition
10
  from Preprocess.preprocessImg import PreprocessImg
11
 
 
 
 
 
 
 
 
 
 
12
  # 取得所有語言清單
13
  languages = os.popen('tesseract --list-langs').read().split('\n')[1:-1]
14
 
 
9
  from Plan.pytesseractOCR import ocr_recognition
10
  from Preprocess.preprocessImg import PreprocessImg
11
 
12
+ # 切換到 node_app 目錄
13
+ os.chdir("node_app")
14
+ # 如果 node_modules 目錄不存在,則執行 npm install
15
+ if not os.path.exists("node_modules"):
16
+ subprocess.run(["npm", "install"])
17
+ # 切換回上級目錄
18
+ os.chdir("..")
19
+
20
+
21
  # 取得所有語言清單
22
  languages = os.popen('tesseract --list-langs').read().split('\n')[1:-1]
23