Spaces:
Runtime error
Runtime error
nyonyong
commited on
Commit
·
b00f0f5
1
Parent(s):
8cd31d2
Directory fix
Browse files- process.py +5 -3
process.py
CHANGED
|
@@ -21,7 +21,7 @@ def clearDir():
|
|
| 21 |
if os.path.isfile(user_input):
|
| 22 |
os.remove(user_input)
|
| 23 |
print(user_input)
|
| 24 |
-
|
| 25 |
else:
|
| 26 |
print('Message: no user input')
|
| 27 |
|
|
@@ -29,7 +29,7 @@ def clearDir():
|
|
| 29 |
if os.path.isdir(crops):
|
| 30 |
shutil.rmtree(crops) #'/runs/detect/user_output'
|
| 31 |
print(crops)
|
| 32 |
-
|
| 33 |
else:
|
| 34 |
print('Message: no crop folder')
|
| 35 |
|
|
@@ -37,10 +37,12 @@ def clearDir():
|
|
| 37 |
if os.path.isfile("log_demo_result.txt"):
|
| 38 |
os.remove("log_demo_result.txt")
|
| 39 |
print("log_demo_result.txt")
|
| 40 |
-
|
| 41 |
else:
|
| 42 |
print('Message: no result')
|
| 43 |
|
|
|
|
|
|
|
| 44 |
def textDetection(im):
|
| 45 |
|
| 46 |
#change dir to yolo folder
|
|
|
|
| 21 |
if os.path.isfile(user_input):
|
| 22 |
os.remove(user_input)
|
| 23 |
print(user_input)
|
| 24 |
+
print('Message: user input clear - {}', os.path.isfile(user_input))
|
| 25 |
else:
|
| 26 |
print('Message: no user input')
|
| 27 |
|
|
|
|
| 29 |
if os.path.isdir(crops):
|
| 30 |
shutil.rmtree(crops) #'/runs/detect/user_output'
|
| 31 |
print(crops)
|
| 32 |
+
print('Message: crop folder clear - {}', os.path.isdir(crops))
|
| 33 |
else:
|
| 34 |
print('Message: no crop folder')
|
| 35 |
|
|
|
|
| 37 |
if os.path.isfile("log_demo_result.txt"):
|
| 38 |
os.remove("log_demo_result.txt")
|
| 39 |
print("log_demo_result.txt")
|
| 40 |
+
print('Message: result clear - {}', os.path.isfile("log_demo_result.txt"))
|
| 41 |
else:
|
| 42 |
print('Message: no result')
|
| 43 |
|
| 44 |
+
return print("All Cleared")
|
| 45 |
+
|
| 46 |
def textDetection(im):
|
| 47 |
|
| 48 |
#change dir to yolo folder
|