-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathinference.py
26 lines (19 loc) · 905 Bytes
/
inference.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import argparse
import json5
from util.utils import initialize_config
def main(config, checkpoint_path, output_dir):
inferencer_class = initialize_config(config["inference"], pass_args=False)
inferencer = inferencer_class(
config,
checkpoint_path,
output_dir
)
inferencer.inference()
if __name__ == "__main__":
parser = argparse.ArgumentParser("Inference / Enhancement / Test")
parser.add_argument("-C", "--config", type=str, required=True, help="Inference config file.")
parser.add_argument("-cp", "--checkpoint_path", type=str, required=True, help="Model checkpoint")
parser.add_argument("-dist", "--output_dir", type=str, required=True, help="The dir of saving enhanced wav files.")
args = parser.parse_args()
config = json5.load(open(args.config))
main(config, args.checkpoint_path, args.output_dir)