Spaces:
Runtime error
Runtime error
nyonyong
commited on
Commit
·
8cd31d2
1
Parent(s):
ac5854a
Directory fix
Browse files- app.py +1 -0
- process.py +6 -3
app.py
CHANGED
|
@@ -17,6 +17,7 @@ def HCR(im):
|
|
| 17 |
ps.textRecognition()
|
| 18 |
#subprocess.call('ls', shell=True)
|
| 19 |
hcr = ps.getHcrResult("/home/user/app"+Dir.txt_file_path)
|
|
|
|
| 20 |
#subprocess.call('cd'+ Dir.yolo_dir, shell=True)
|
| 21 |
ps.clearDir()
|
| 22 |
|
|
|
|
| 17 |
ps.textRecognition()
|
| 18 |
#subprocess.call('ls', shell=True)
|
| 19 |
hcr = ps.getHcrResult("/home/user/app"+Dir.txt_file_path)
|
| 20 |
+
subprocess.call('ls', shell=True)
|
| 21 |
#subprocess.call('cd'+ Dir.yolo_dir, shell=True)
|
| 22 |
ps.clearDir()
|
| 23 |
|
process.py
CHANGED
|
@@ -20,6 +20,7 @@ def clearDir():
|
|
| 20 |
|
| 21 |
if os.path.isfile(user_input):
|
| 22 |
os.remove(user_input)
|
|
|
|
| 23 |
return print('Message: user input clear - {}', os.path.isfile(user_input))
|
| 24 |
else:
|
| 25 |
print('Message: no user input')
|
|
@@ -27,14 +28,16 @@ def clearDir():
|
|
| 27 |
#cropped_img_path = "/runs/detect/" + cropped_img_folder_name
|
| 28 |
if os.path.isdir(crops):
|
| 29 |
shutil.rmtree(crops) #'/runs/detect/user_output'
|
|
|
|
| 30 |
return print('Message: crop folder clear - {}', os.path.isdir(crops))
|
| 31 |
else:
|
| 32 |
print('Message: no crop folder')
|
| 33 |
|
| 34 |
#txt_file_path = "/log_demo_result.txt"
|
| 35 |
-
if os.path.isfile(
|
| 36 |
-
os.remove(
|
| 37 |
-
|
|
|
|
| 38 |
else:
|
| 39 |
print('Message: no result')
|
| 40 |
|
|
|
|
| 20 |
|
| 21 |
if os.path.isfile(user_input):
|
| 22 |
os.remove(user_input)
|
| 23 |
+
print(user_input)
|
| 24 |
return print('Message: user input clear - {}', os.path.isfile(user_input))
|
| 25 |
else:
|
| 26 |
print('Message: no user input')
|
|
|
|
| 28 |
#cropped_img_path = "/runs/detect/" + cropped_img_folder_name
|
| 29 |
if os.path.isdir(crops):
|
| 30 |
shutil.rmtree(crops) #'/runs/detect/user_output'
|
| 31 |
+
print(crops)
|
| 32 |
return print('Message: crop folder clear - {}', os.path.isdir(crops))
|
| 33 |
else:
|
| 34 |
print('Message: no crop folder')
|
| 35 |
|
| 36 |
#txt_file_path = "/log_demo_result.txt"
|
| 37 |
+
if os.path.isfile("log_demo_result.txt"):
|
| 38 |
+
os.remove("log_demo_result.txt")
|
| 39 |
+
print("log_demo_result.txt")
|
| 40 |
+
return print('Message: result clear - {}', os.path.isfile("log_demo_result.txt"))
|
| 41 |
else:
|
| 42 |
print('Message: no result')
|
| 43 |
|