Browse Source

Generation simulations curves script updated

Jérôme BUISINE 1 year ago
parent
commit
fafa4f5f73

+ 32 - 32
analysis/custom_diff_filter.ipynb

@@ -345,7 +345,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 34,
+   "execution_count": 26,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -358,26 +358,26 @@
     "    for sub_zone in sub_zones:\n",
     "        l_img = transform.get_LAB_L(sub_zone)\n",
     "        diff = diff_custom_filter(utils.normalize_2D_arr(l_img), (5, 5), max)\n",
-    "        global_diff = np.mean(diff)\n",
+    "        global_diff = np.std(diff)\n",
     "        diff_list.append(global_diff)\n",
     "\n",
-    "    diff_list = np.array(utils.normalize_arr(diff_list))\n",
+    "    diff_list = np.array(diff_list)\n",
     "    score = np.std(diff_list[0:int(len(sub_zones)/5)])\n",
     "    print(score)"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 18,
+   "execution_count": 13,
    "metadata": {},
    "outputs": [
     {
      "data": {
       "text/plain": [
-       "<matplotlib.image.AxesImage at 0x7fd000294e10>"
+       "<matplotlib.image.AxesImage at 0x7f63b9a36e48>"
       ]
      },
-     "execution_count": 18,
+     "execution_count": 13,
      "metadata": {},
      "output_type": "execute_result"
     },
@@ -400,16 +400,16 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 19,
+   "execution_count": 14,
    "metadata": {},
    "outputs": [
     {
      "data": {
       "text/plain": [
-       "<matplotlib.image.AxesImage at 0x7fd000270b70>"
+       "<matplotlib.image.AxesImage at 0x7f63b61ccc88>"
       ]
      },
-     "execution_count": 19,
+     "execution_count": 14,
      "metadata": {},
      "output_type": "execute_result"
     },
@@ -432,22 +432,22 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 35,
+   "execution_count": 27,
    "metadata": {},
    "outputs": [
     {
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "0.31115810921477804\n",
-      "0.2863208624039204\n",
-      "0.30544312573023824\n",
-      "0.30109083037073037\n",
-      "0.28698510231074903\n",
-      "0.2537386413202566\n",
-      "0.26179450793394426\n",
-      "0.2570850715772455\n",
-      "0.24614578850586727\n"
+      "0.019411785375902203\n",
+      "0.022010065900329633\n",
+      "0.023538288175525304\n",
+      "0.024255978068903696\n",
+      "0.024555364941822696\n",
+      "0.025371094905613262\n",
+      "0.0257215863991888\n",
+      "0.025645858204273037\n",
+      "0.02586192220176574\n"
      ]
     }
    ],
@@ -458,25 +458,25 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 36,
+   "execution_count": 28,
    "metadata": {},
    "outputs": [
     {
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "0.25736744282652596\n",
-      "0.26165733354788334\n",
-      "0.25353770608713555\n",
-      "0.2626080187709018\n",
-      "0.2499189698623857\n",
-      "0.2672460148236176\n",
-      "0.23663404055440662\n",
-      "0.24105279524081868\n",
-      "0.24269022218247438\n",
-      "0.23540123922449976\n",
-      "0.23097366553977633\n",
-      "0.23070742488410378\n"
+      "0.016907859437032855\n",
+      "0.022510883215429146\n",
+      "0.02774428742446508\n",
+      "0.030267113383204484\n",
+      "0.032330051361439856\n",
+      "0.032666832076238675\n",
+      "0.03325133529876735\n",
+      "0.033614614352306754\n",
+      "0.03435194845496702\n",
+      "0.035516845913060015\n",
+      "0.035844373588709205\n",
+      "0.03626505901706533\n"
      ]
     }
    ],

File diff suppressed because it is too large
+ 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