Fu-Chuen commited on
Commit
343d424
·
1 Parent(s): 0a45f6e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -62,6 +62,8 @@ project_path = Path('./')
62
  model_path = Path(project_path,'Model')
63
  test_path = Path(project_path,'Test')
64
  os.makedirs(test_path, exist_ok=True)
 
 
65
  detect_path = Path(project_path,'runs/detect')
66
  weight_path = Path(model_path,'best_Yolo_v8n.pt')
67
  # 指定工作目录
@@ -173,7 +175,7 @@ def Aspergillus_Detect():
173
 
174
  model = YOLO(weight_path) # pretrained YOLOv8n model
175
 
176
- model.predict(test_path, save = True , save_txt = True ) # predict on an image
177
  all_files, all_directories = get_all_files(working_directory)
178
 
179
  image_path = Path(find_the_most_recent_predict_path(all_directories))
 
62
  model_path = Path(project_path,'Model')
63
  test_path = Path(project_path,'Test')
64
  os.makedirs(test_path, exist_ok=True)
65
+ Yolov8n_path = Path(project_path,'Result/Yolov8n')
66
+ os.makedirs(result_path, exist_ok=True)
67
  detect_path = Path(project_path,'runs/detect')
68
  weight_path = Path(model_path,'best_Yolo_v8n.pt')
69
  # 指定工作目录
 
175
 
176
  model = YOLO(weight_path) # pretrained YOLOv8n model
177
 
178
+ model.predict(test_path, save = True , save_txt = True, output_dir = Yolov8n_path ) # predict on an image
179
  all_files, all_directories = get_all_files(working_directory)
180
 
181
  image_path = Path(find_the_most_recent_predict_path(all_directories))