test_yaml.py 1.1 KB

1234567891011121314151617181920212223242526272829
  1. import warnings
  2. warnings.filterwarnings('ignore')
  3. import os, tqdm
  4. from ultralytics import YOLO
  5. if __name__ == '__main__':
  6. error_result = []
  7. for yaml_path in tqdm.tqdm(os.listdir('ultralytics/cfg/models/v8')):
  8. if 'rtdetr' not in yaml_path and 'cls' not in yaml_path and 'world' not in yaml_path:
  9. try:
  10. model = YOLO(f'ultralytics/cfg/models/v8/{yaml_path}')
  11. model.info(detailed=True)
  12. model.profile([640, 640])
  13. model.fuse()
  14. except Exception as e:
  15. error_result.append(f'{yaml_path} {e}')
  16. for yaml_path in tqdm.tqdm(os.listdir('ultralytics/cfg/models/v10')):
  17. if 'rtdetr' not in yaml_path and 'cls' not in yaml_path and 'world' not in yaml_path:
  18. try:
  19. model = YOLO(f'ultralytics/cfg/models/v10/{yaml_path}')
  20. model.info(detailed=True)
  21. model.profile([640, 640])
  22. model.fuse()
  23. except Exception as e:
  24. error_result.append(f'{yaml_path} {e}')
  25. for i in error_result:
  26. print(i)