Update script conventions

This commit is contained in:
2026-05-28 16:34:17 +02:00
parent 6390b40be3
commit eeb507ec18
3 changed files with 32 additions and 13 deletions
+5 -7
View File
@@ -1,6 +1,6 @@
# configs/infer_1photon.yaml
experiment:
name: "FlatField_3filters_pos0" # options: SiemenStarLowerLeft, SiemenStarLowerRight
name: "FlatField_2filters" # options: SiemenStarLowerLeft, SiemenStarLowerRight
task: "1Photon"
output_base: "./InferenceResults"
@@ -29,7 +29,7 @@ data:
file_pattern: "2603MaxIV_FlatField3Filters_pos0_12keV/1Photon_CS3_chunk{}.h5" ### 12 keV
NX: 101
NY: 101
file_range: [0, 48] # [0, 48)
file_range: [0, 16] # [0, 16)
roi: [0, 101, 0, 101]
KnifeEdge_2filters:
file_pattern: "2603MaxIV_Edge2Filters_12keV/1Photon_CS3_chunk{}.h5" ### 12 keV
@@ -58,13 +58,11 @@ data:
model:
base_dir: "/home/xie_x1/MLXID/DeepLearning/Results/"
# experiment_name: "260408_1ph_12keV_v251022_03"
# name: "singlePhoton251022_12keV_Noise0.13keV_E150_aug1.pth"
# experiment_name: "260511_1ph_12keV_v251022_00"
# name: "singlePhoton251022_12keV_Noise0.13keV_E150_aug1.pth"
# name: "singlePhoton251022_12keV_Noise0.13keV_E150_aug1.pth" ### std/mean = 0.033
experiment_name: "260512_1ph_12keV_v260511_06"
name: "singlePhoton260511_12keV_Noise0.13keV_E300_aug1.pth"
name: "singlePhoton260511_12keV_Noise0.13keV_E500_aug1.pth" ### std/mean = 0.025
inference:
binning_factor: 10
chunk_size: 16 #
num_aug_ops: 8 # TTA: test-time augmentation
num_aug_ops: 1 # TTA: test-time augmentation
+24 -4
View File
@@ -32,7 +32,28 @@ data:
file_pattern: "2603MaxIV_FlatField3Filters_pos0_12keV/2Photon_CS7_chunk{}.h5" ### 12 keV
NX: 101
NY: 101
file_range: [0, 48] # [0, 48)
file_range: [0, 16] # [0, 16)
roi: [0, 101, 0, 101]
nSize: 7
KnifeEdge_2filters:
file_pattern: "2603MaxIV_Edge2Filters_12keV/2Photon_CS7_chunk{}.h5" ### 12 keV
NX: 101
NY: 101
file_range: [0, 16] # [0, 16)
roi: [0, 101, 0, 101]
nSize: 7
FlatField_2filters:
file_pattern: "2603MaxIV_Flat2Filters_12keV/2Photon_CS7_chunk{}.h5" ### 12 keV
NX: 101
NY: 101
file_range: [0, 16] # [0, 16)
roi: [0, 101, 0, 101]
nSize: 7
Uniformity_test:
file_pattern: "2603MaxIV_Flat2Filters_12keV/2Photon_CS7_chunk{}.h5" ### 12 keV
NX: 101
NY: 101
file_range: [0, 1]
roi: [0, 101, 0, 101]
nSize: 7
@@ -42,10 +63,9 @@ data:
num_workers: 16
model:
version: "251124"
base_dir: "/home/xie_x1/MLXID/DeepLearning/Results/"
experiment_name: "260506_2ph_12keV_v251124_03"
name: "doublePhoton251124_12keV_Noise0.13keV_E150.pth"
experiment_name: "260511_2ph_12keV_v260507_00"
name: "doublePhoton260507_12keV_Noise0.13keV_E300.pth"
inference:
binning_factor: 10
+3 -2
View File
@@ -140,7 +140,7 @@ def save_results(ml_super_frame, count_frame, subpixel_dist,
plt.close()
np.save(output_dir / '2Photon_subpixel_Distribution.npy', subpixel_dist)
std, mean = np.std(subpixel_dist), np.mean(subpixel_dist)
print(f"[Plotting]: Sub-pixel distribution: Std/Mean: {std/mean:.4f}")
print(f"[Plotting]: Sub-pixel distribution: RMS/Mean: {std/mean:.4f}, expected value = {1/np.sqrt(mean):.4f} for uniform distribution")
print(f"Results saved to: {output_dir}")
@@ -149,7 +149,8 @@ if __name__ == "__main__":
output_dir = prepare_output_folder(conf)
### model loading
model = get_double_photon_model_class(conf.model.version)().cuda()
model_version = conf.model.experiment_name.split('_v')[-1][:6]
model = get_double_photon_model_class(model_version)().cuda()
model.load_state_dict(torch.load(f'{conf.model.base_dir}/{conf.model.experiment_name}/Models/{conf.model.name}', weights_only=True))
# model.eval()