nyonyong commited on
Commit
1b00da7
โ€ข
1 Parent(s): 7e61ba7

Directory fix

Browse files
Files changed (1) hide show
  1. process.py +23 -7
process.py CHANGED
@@ -6,15 +6,31 @@ import directories as Dir
6
 
7
  def clearDir():
8
 
9
- #/text_detection/cookie/user_input
10
- #shutil.rmtree('/cookie')
11
- #os.remove("/cookie/user_input.jpg")
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  #cropped_img_path = "/runs/detect/" + cropped_img_folder_name
14
- shutil.rmtree(Dir.cropped_img_path) #'/runs/detect/user_output'
15
-
16
- #txt_file_path = "/HCR/TextRecognition/log_demo_result.txt"
17
- os.remove(Dir.txt_file_path)
 
 
 
 
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