Skip to content

Commit

Permalink
Add short form parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
PINTO0309 committed Sep 7, 2022
1 parent 0662133 commit 0e63f63
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,32 @@ $ sne4onnx -h

usage:
sne4onnx [-h]
--input_onnx_file_path INPUT_ONNX_FILE_PATH
--input_op_names INPUT_OP_NAMES
--output_op_names OUTPUT_OP_NAMES
[--output_onnx_file_path OUTPUT_ONNX_FILE_PATH]
[--non_verbose]
-if INPUT_ONNX_FILE_PATH
-ion INPUT_OP_NAMES
-oon OUTPUT_OP_NAMES
[-of OUTPUT_ONNX_FILE_PATH]
[-n]

optional arguments:
-h, --help
show this help message and exit.
show this help message and exit

--input_onnx_file_path INPUT_ONNX_FILE_PATH
Input onnx file path.
-if INPUT_ONNX_FILE_PATH, --input_onnx_file_path INPUT_ONNX_FILE_PATH
Input onnx file path.

--input_op_names INPUT_OP_NAMES
List of OP names to specify for the input layer of the model.
e.g. --input_op_names aaa bbb ccc
-ion INPUT_OP_NAMES [INPUT_OP_NAMES ...], --input_op_names INPUT_OP_NAMES [INPUT_OP_NAMES ...]
List of OP names to specify for the input layer of the model.
e.g. --input_op_names aaa bbb ccc

--output_op_names OUTPUT_OP_NAMES
List of OP names to specify for the output layer of the model.
e.g. --output_op_names ddd eee fff
-oon OUTPUT_OP_NAMES [OUTPUT_OP_NAMES ...], --output_op_names OUTPUT_OP_NAMES [OUTPUT_OP_NAMES ...]
List of OP names to specify for the output layer of the model.
e.g. --output_op_names ddd eee fff

--output_onnx_file_path OUTPUT_ONNX_FILE_PATH
Output onnx file path. If not specified, extracted.onnx is output.
-of OUTPUT_ONNX_FILE_PATH, --output_onnx_file_path OUTPUT_ONNX_FILE_PATH
Output onnx file path. If not specified, extracted.onnx is output.

--non_verbose
Do not show all information logs. Only error logs are displayed.
-n, --non_verbose
Do not show all information logs. Only error logs are displayed.
```

## 3. In-script Usage
Expand Down
2 changes: 1 addition & 1 deletion sne4onnx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from sne4onnx.onnx_network_extraction import extraction, main

__version__ = '1.0.9'
__version__ = '1.0.10'
5 changes: 5 additions & 0 deletions sne4onnx/onnx_network_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,14 @@ def extraction(
def main():
parser = ArgumentParser()
parser.add_argument(
'-if',
'--input_onnx_file_path',
type=str,
required=True,
help='Input onnx file path.'
)
parser.add_argument(
'-ion',
'--input_op_names',
type=str,
nargs='+',
Expand All @@ -180,6 +182,7 @@ def main():
e.g. --input_op_names aaa bbb ccc"
)
parser.add_argument(
'-oon',
'--output_op_names',
type=str,
nargs='+',
Expand All @@ -189,12 +192,14 @@ def main():
e.g. --output_op_names ddd eee fff"
)
parser.add_argument(
'-of',
'--output_onnx_file_path',
type=str,
default='extracted.onnx',
help='Output onnx file path. If not specified, extracted.onnx is output.'
)
parser.add_argument(
'-n',
'--non_verbose',
action='store_true',
help='Do not show all information logs. Only error logs are displayed.'
Expand Down

0 comments on commit 0e63f63

Please sign in to comment.