Spaces:
Runtime error
Runtime error
nyonyong
commited on
Commit
โข
1b00da7
1
Parent(s):
7e61ba7
Directory fix
Browse files- process.py +23 -7
process.py
CHANGED
@@ -6,15 +6,31 @@ import directories as Dir
|
|
6 |
|
7 |
def clearDir():
|
8 |
|
9 |
-
|
10 |
-
#
|
11 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
#cropped_img_path = "/runs/detect/" + cropped_img_folder_name
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
18 |
|
19 |
def textDetection(im):
|
20 |
|
|
|
6 |
|
7 |
def clearDir():
|
8 |
|
9 |
+
#์์ฑ๋๋ ํ์ผ๋ค์ ์ญ์ ํจ์ผ๋ก์จ ์ค๋ณต ์ถ๋ ฅ ๋ฐฉ์ง
|
10 |
+
# 1. User input
|
11 |
+
# "/TextDetection/cookie/user_input.jpg" ์ญ์
|
12 |
+
# 2. Cropped images
|
13 |
+
# TextDetection/runs/detect/ ํ์ ํ์ผ ์ ๋ถ ์ญ์
|
14 |
+
# 3. Recognition Result
|
15 |
+
# /TextRecognition/log_demo_result.txt ์ญ์
|
16 |
+
|
17 |
+
user_input = "/home/user/app"+ Dir.yolo_dir +"/cookie/user_input.jpg"
|
18 |
+
crops = "/home/user/app" + Dir.yolo_dir + Dir.cropped_img_path
|
19 |
+
result = "/home/user/app" + Dir.txt_file_path
|
20 |
+
|
21 |
+
if os.path.isfile(user_input):
|
22 |
+
os.remove(user_input)
|
23 |
+
return 'user input clear'
|
24 |
|
25 |
#cropped_img_path = "/runs/detect/" + cropped_img_folder_name
|
26 |
+
if os.path.isdir(crops):
|
27 |
+
shutil.rmtree(crops) #'/runs/detect/user_output'
|
28 |
+
return 'crop folder clear'
|
29 |
+
|
30 |
+
#txt_file_path = "/log_demo_result.txt"
|
31 |
+
if os.path.isfile(result):
|
32 |
+
os.remove(result)
|
33 |
+
return 'result clear'
|
34 |
|
35 |
def textDetection(im):
|
36 |
|