Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -201,9 +201,9 @@ def Aspergillus_Detect():
|
|
| 201 |
|
| 202 |
def classify_images(files):
|
| 203 |
predict, result1 = genus_classify_images(files)
|
| 204 |
-
if predict == 'Aspergillus':
|
| 205 |
-
|
| 206 |
-
|
| 207 |
return result1
|
| 208 |
|
| 209 |
import shutil
|
|
@@ -223,8 +223,8 @@ def upload_file(files):
|
|
| 223 |
|
| 224 |
return file_paths
|
| 225 |
|
| 226 |
-
# Define the path to the directory you want to delete files from
|
| 227 |
-
directory_path = test_path
|
| 228 |
|
| 229 |
# Iterate through all files in the directory and delete them
|
| 230 |
def delete_folder(directory_path):
|
|
@@ -237,7 +237,7 @@ def delete_folder(directory_path):
|
|
| 237 |
shutil.rmtree(file_path)
|
| 238 |
except Exception as e:
|
| 239 |
print(f"Failed to delete {file_path}: {e}")
|
| 240 |
-
delete_folder(
|
| 241 |
|
| 242 |
"""# main of gradio"""
|
| 243 |
|
|
|
|
| 201 |
|
| 202 |
def classify_images(files):
|
| 203 |
predict, result1 = genus_classify_images(files)
|
| 204 |
+
# if predict == 'Aspergillus':
|
| 205 |
+
# result2 = Aspergillus_Detect()
|
| 206 |
+
# return f'{result1}\n\n{result2}'
|
| 207 |
return result1
|
| 208 |
|
| 209 |
import shutil
|
|
|
|
| 223 |
|
| 224 |
return file_paths
|
| 225 |
|
| 226 |
+
# # Define the path to the directory you want to delete files from
|
| 227 |
+
# directory_path = test_path
|
| 228 |
|
| 229 |
# Iterate through all files in the directory and delete them
|
| 230 |
def delete_folder(directory_path):
|
|
|
|
| 237 |
shutil.rmtree(file_path)
|
| 238 |
except Exception as e:
|
| 239 |
print(f"Failed to delete {file_path}: {e}")
|
| 240 |
+
# delete_folder(test_path)
|
| 241 |
|
| 242 |
"""# main of gradio"""
|
| 243 |
|