"tools/python/vscode:/vscode.git/clone" did not exist on "326348811495c3b3f4fdd6c69cf9408594eb180c"
Unverified Commit 2492836b authored by yinchimaoliang's avatar yinchimaoliang Committed by GitHub
Browse files

[Fix]: gather-models (#153)

* Change gather_models script.

* Add usage.
parent 86fa43ba
"""Script to gather benchmarked models and prepare them for upload.
Usage:
python gather_models.py ${root_path} ${out_dir}
"""
import argparse import argparse
import glob import glob
import json import json
...@@ -163,7 +169,8 @@ def main(): ...@@ -163,7 +169,8 @@ def main():
model_publish_dir = osp.join(models_out, model['config'].rstrip('.py')) model_publish_dir = osp.join(models_out, model['config'].rstrip('.py'))
mmcv.mkdir_or_exist(model_publish_dir) mmcv.mkdir_or_exist(model_publish_dir)
model_name = model_publish_dir + '_' + model['model_time'] model_name = model['config'].split('/')[-1].rstrip(
'.py') + '_' + model['model_time']
publish_model_path = osp.join(model_publish_dir, model_name) publish_model_path = osp.join(model_publish_dir, model_name)
trained_model_path = osp.join(models_root, model['config'], trained_model_path = osp.join(models_root, model['config'],
'epoch_{}.pth'.format(model['epochs'])) 'epoch_{}.pth'.format(model['epochs']))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment