-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_db.py
More file actions
20 lines (16 loc) · 799 Bytes
/
Copy pathcreate_db.py
File metadata and controls
20 lines (16 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from pyleaves.leavesdb.db_manager import create_db, build_db_from_json
import argparse
import os
from os.path import join, abspath
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--json_path', default=r'pyleaves/leavesdb/resources/full_dataset_frozen.json', type=str,help='Db json file')
parser.add_argument('--output_folder', default=r'pyleaves/leavesdb/resources' ,type=str,help='Folder Where to save the output')
args = parser.parse_args()
json_path = abspath(args.json_path)
db_dir = abspath(args.output_folder)
print('Creating folder to save db')
os.makedirs(db_dir,exist_ok=True)
db_path = join(db_dir,'leavesdb.db')
build_db_from_json(frozen_json_filepaths=[json_path],
db_path=db_path)