Cycle all checkpoints in a folder and test the accuracy #762
hongxrsysu
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
`import os
import subprocess
checkpoint_dir = "./work_dirs/roi_trans_swin_tiny_fpn_1x_dota_le90/"
config_path = "./work_dirs/roi_trans_swin_tiny_fpn_1x_dota_le90/roi_trans_swin_tiny_fpn_1x_dota_le90.py"
for filename in os.listdir(checkpoint_dir):
if filename.endswith(".pth"):
checkpoint_path = os.path.join(checkpoint_dir, filename)
cmd = f"python ./tools/test.py {config_path} {checkpoint_path} --eval mAP"
print(f"Testing checkpoint {checkpoint_path}")
process = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, universal_newlines=True)
output = process.stdout
print(output)`
Beta Was this translation helpful? Give feedback.
All reactions