|
11 | 11 | from utils import find_files_in_directory, predict_with_mask, std_mean_normalization
|
12 | 12 |
|
13 | 13 | from keras.models import load_model
|
14 |
| -from appdata.seismic.faults.faultSeg.unet3 import * |
15 |
| -from appdata.seismic.faults.faultSeg.unet3 import cross_entropy_balanced |
| 14 | +from appdata.geophysics.faults.faultSeg.unet3 import * |
| 15 | +from appdata.geophysics.faults.faultSeg.unet3 import cross_entropy_balanced |
16 | 16 |
|
17 | 17 | st.markdown("### 🛈 FaultSeg3D: using synthetic datasets to train an end-to-end convolutional neural network for 3D seismic fault segmentation by Xinming Wu (Links: [Paper](https://library.seg.org/doi/10.1190/geo2018-0646.1), [GitHub](https://github.com/xinwucwp/faultSeg))")
|
18 | 18 |
|
|
78 | 78 | st.info("Here you can select several different weights for computing faults. Try out different ones to find the best for your project.")
|
79 | 79 |
|
80 | 80 | inference_form = st.form("Inference")
|
81 |
| - weight_file_list = sorted(find_files_in_directory(r'appdata/seismic/faults/faultSeg/model/', '.hdf5')) |
| 81 | + weight_file_list = sorted(find_files_in_directory(r'appdata/geophysics/faults/faultSeg/model/', '.hdf5')) |
82 | 82 | weight_selected = inference_form.selectbox(
|
83 | 83 | 'Available weights',
|
84 | 84 | (weight_file_list))
|
85 | 85 |
|
86 | 86 | if (len(weight_file_list) == 0):
|
87 | 87 | st.error('''There is no weights in the model folder.
|
88 | 88 | Please download the pretrained models from https://drive.google.com/drive/folders/1q8sAoLJgbhYHRubzyqMi9KkTeZWXWtNd
|
89 |
| - and place them here EFramework/appdata/seismic/faults/faultSeg/model. |
| 89 | + and place them here EFramework/appdata/geophysics/faults/faultSeg/model. |
90 | 90 | ''')
|
91 | 91 | inference_submit = inference_form.form_submit_button("Submit")
|
92 | 92 | if inference_submit:
|
|
95 | 95 | numpy_data = st.session_state[module_name]['numpy_data'].get_cube()
|
96 | 96 | if (weight_selected == "pretrained_model.hdf5"):
|
97 | 97 | # load json and create model
|
98 |
| - json_file = open('appdata/seismic/faults/faultSeg/model/model3.json', 'r') |
| 98 | + json_file = open('appdata/geophysics/faults/faultSeg/model/model3.json', 'r') |
99 | 99 | loaded_model_json = json_file.read()
|
100 | 100 | json_file.close()
|
101 | 101 | loaded_model = model_from_json(loaded_model_json)
|
102 | 102 | # load weights into new model
|
103 |
| - loaded_model.load_weights("appdata/seismic/faults/faultSeg/model/"+weight_selected) |
| 103 | + loaded_model.load_weights("appdata/geophysics/faults/faultSeg/model/"+weight_selected) |
104 | 104 |
|
105 | 105 | print("Loaded model from disk")
|
106 | 106 |
|
|
110 | 110 | st.session_state[module_name]['numpy_result'] = Numpy3D(100*predict)
|
111 | 111 | st.session_state[module_name]['is_predicted'] = True
|
112 | 112 | else:
|
113 |
| - loaded_model = load_model("appdata/seismic/faults/faultSeg/model/"+weight_selected, custom_objects={'cross_entropy_balanced': cross_entropy_balanced}) |
| 113 | + loaded_model = load_model("appdata/geophysics/faults/faultSeg/model/"+weight_selected, custom_objects={'cross_entropy_balanced': cross_entropy_balanced}) |
114 | 114 | print("Loaded model from disk")
|
115 | 115 | numpy_data = std_mean_normalization(numpy_data)
|
116 | 116 | print (numpy_data.shape)
|
|
0 commit comments