Utilities Documentation¶
Open Seismic uses some utilities functions in order to conduct proper inference. The documentation below goes in-depth as to the purpose and usage of the major utility functions.
Inference Argument Parsing and Copying Files¶
- core.python.utils.argparse_util.args()¶
This function helps parse command line arguments. The configuration JSON file arguments will be passed to their respective submodules (conversion, OpenVINO optimization, and inference). However, this function is purely concerned with inference arguments. The other arguments are used for the user’s own conversion script or the model optimizer script that comes with OpenVINO.
- The main arguments are as follows:
model: OpenVINO model folder path for swappable componentsgiven_model_name: Open Seismic model namedata: Data folder pathbenchmarking: Flag to enable/disable model benchmarkingoutput: Prediction output pathinfer_type: (sync/async/fine_cube_sync/fine_cube_async/coarse_cube_sync/section_sync/section_async) Type of inferencestreams: Number of streams for inference
The optional arguments are as follows. Note that although they are optional, certain inference tasks need these arguments in order to run:
slice: (full/inline/crossline/timeslice) ONLY FOR FINE CUBE/SECTION INFER. Slice type for cutting into datawindow: (...;l1i:l2i,w1i:w2i,h1i:h2i;...) ONLY FOR COARSE CUBE INFER. Infer oncube_i[l1i:l2i,w1i:w2i,h1i:h2i].subsampl: ONLY FOR FINE CUBE/SECTION INFER. Look at every n-th pointslice_no: ONLY FOR FINE CUBE/SECTION INFER. Slice numberim_size: ONLY FOR FINE CUBE/COARSE CUBE/SECTION INFER. Side length of cube/section to window inreturn_to_fullsize: ONLY FOR FINE CUBE INFER. Output will be the full size of the input (done through interpolation)
- Returns
Argument Namespace Object mapping arguments to their respective values.
- core.python.utils.argparse_util.copyfile(src, dst, file)¶
This simple function copies a file named
filefrom thesrcpath to thedstpath.- Parameters
src – Path of the source file.
dst – Path of the destination file.
file – Name of the file to be copied.
- Returns
None
Inference Utility Functions and Classes¶
JSON to Command Line Arguments¶
- core.python.utils.jsonparse_util.get_params_string(filename)¶
A simple function that takes in a configuration file path
file_pathand parses it to convert the keys to command line tags and the values to their respective command line tag values.- Parameters
file_path – Path to JSON file.
- Returns
String representing arguments in a command line.
Model Paths Dictionary¶
This model_paths.py file in the core/python/utils folder maps Open Seismic model names
to a tuple containing (1) the xml path and (2) the bin path. The dictionary is structured
as follows:
fseg_bin = models_path + sep + 'fault' + sep + 'model' + sep + 'shp-fseg-60.bin'
salt_xml = models_path + sep + 'salt' + sep + 'model' + sep + 'saved_model.xml'
salt_bin = models_path + sep + 'salt' + sep + 'model' + sep + 'saved_model.bin'