ソースを参照

Merge branch 'release/v0.3.9'

Jérôme BUISINE 5 年 前
コミット
9b2a88f128

ファイルの差分が大きいため隠しています
+ 558 - 0
analysis/custom_diff_filter.ipynb


ファイルの差分が大きいため隠しています
+ 527 - 0
analysis/plane_filter.ipynb


+ 14 - 12
display/display_simulation_curves.py

@@ -100,27 +100,29 @@ def main():
 
     parser = argparse.ArgumentParser(description="Display simulations curves from simulation data")
 
-    parser.add_argument('--folder', type=str, help='Folder which contains simulations data for scenes')
-    parser.add_argument('--model', type=str, help='Name of the model used for simulations')
+    parser.add_argument('--folder', type=str, help='Folder which contains all threshold map data for scenes')
 
     args = parser.parse_args()
 
     p_folder = args.folder
 
-    if args.model:
-        p_model = args.model
-    else:
+    # get threshold folder path
+    threshold_folder = os.path.join(p_folder, cfg.threshold_map_folder)
+
+    for folder in os.listdir(threshold_folder):
+
+        print(folder)
+        folder_path = os.path.join(threshold_folder, folder)
+
         # find p_model from folder if model arg not given (folder path need to have model name)
-        if p_folder.split('/')[-1]:
-            p_model = p_folder.split('/')[-1]
+        if folder_path.split('/')[-1]:
+            model = folder_path.split('/')[-1]
         else:
-            p_model = p_folder.split('/')[-2]
-    
-    print(p_model)
+            model = folder_path.split('/')[-2]
 
-    display_curves(p_folder, p_model)
+        display_curves(folder_path, model)
 
-    print(p_folder)
+   
 
 if __name__== "__main__":
     main()

+ 0 - 6
simulation/generate_all_simulate_curves.sh

@@ -1,6 +0,0 @@
-for file in "threshold_map"/*; do
-
-    echo ${file}
-
-    python display/display_simulation_curves.py --folder ${file}
-done

+ 37 - 0
simulation/run_maxwell_simulation_stats.sh

@@ -0,0 +1,37 @@
+#! bin/bash
+
+# file which contains model names we want to use for simulation
+simulate_models="simulate_models.csv"
+
+# selection of four scenes (only maxwell)
+scenes="A, D, G, H"
+
+feature="sub_blocks_stats_reduced"
+start_index=0
+end_index=24
+number=24
+
+for nb_zones in {4,6,8,10,12}; do
+
+    for mode in {"svd","svdn","svdne"}; do
+        for model in {"svm_model","ensemble_model","ensemble_model_v2"}; do
+
+            FILENAME="data/${model}_N${number}_B${start_index}_E${end_index}_nb_zones_${nb_zones}_${feature}_${mode}"
+            MODEL_NAME="${model}_N${number}_B${start_index}_E${end_index}_nb_zones_${nb_zones}_${feature}_${mode}"
+
+            if grep -xq "${MODEL_NAME}" "${simulate_models}"; then
+                echo "Run simulation for model ${MODEL_NAME}"
+
+                # by default regenerate model
+                python generate/generate_data_model_random.py --output ${FILENAME} --interval "${start_index},${end_index}" --kind ${mode} --feature ${feature} --scenes "${scenes}" --nb_zones "${nb_zones}" --percent 1 --renderer "maxwell" --random 1
+
+                python train_model.py --data ${FILENAME} --output ${MODEL_NAME} --choice ${model}
+
+                python prediction/predict_seuil_expe_maxwell_curve.py --interval "${start_index},${end_index}" --model "saved_models/${MODEL_NAME}.joblib" --mode "${mode}" --feature ${feature} --limit_detection '2'
+
+                python others/save_model_result_in_md_maxwell.py --interval "${start_index},${end_index}" --model "saved_models/${MODEL_NAME}.joblib" --mode "${mode}" --feature ${feature}
+
+            fi
+        done
+    done
+done