Browse Source

Merge branch 'release/v0.6.1'

Jérôme BUISINE 2 months ago
parent
commit
e36a4b1dec
4 changed files with 77 additions and 3 deletions
  1. 8 2
      experimentConfig.default.js
  2. 13 0
      myfile.csv
  3. 1 1
      utils/convert_folder.sh
  4. 55 0
      utils/extract_stats.py

+ 8 - 2
experimentConfig.default.js

@@ -67,6 +67,7 @@ export const experiments = {
         'p3d_coffee-splash-view0_part6',
         'p3d_contemporary-bathroom-view0_part6',
         'p3d_contemporary-bathroom-view1_part6',
+        'p3d_cornel-box-view0_part6',
         'p3d_crown-view0_part6',
         'p3d_dining-room-view0_part6',
         'p3d_dining-room-view1_part6',
@@ -83,6 +84,8 @@ export const experiments = {
         'p3d_ganesha-view0_part6',
         'p3d_glass-of-water-view0_part6',
         'p3d_glass-view0_part6',
+        'p3d_glasses-view0_part6',
+        'p3d_indirect-view0_part6',
         'p3d_kitchen-view0_part6',
         'p3d_kitchen-view1_part6',
         'p3d_lamp-view0_part6',
@@ -98,13 +101,17 @@ export const experiments = {
         'p3d_living-room-view0_part6',
         'p3d_living-room-view1_part6',
         'p3d_living-room-view2_part6',
-        'p3d_living-room_part6',
+        'p3d_low_table_2spheric_view0_part6',
+        'p3d_low_table_coridor_view0_part6',
+        'p3d_low_table_upper_view0_part6',
+        'p3d_low_table_window-view0_part6',
         'p3d_pavilion-day-view0_part6',
         'p3d_pavilion-day-view1_part6',
         'p3d_pavilion-day-view2_part6',
         'p3d_pavilion-night-view0_part6',
         'p3d_pavilion-night-view1_part6',
         'p3d_pavilion-night-view2_part6',
+        'p3d_rubix-view0_part6',
         'p3d_sanmiguel-view0_part6',
         'p3d_sanmiguel-view1_part6',
         'p3d_sanmiguel-view2_part6',
@@ -123,7 +130,6 @@ export const experiments = {
         'p3d_villa-daylight-view1_part6',
         'p3d_villa-daylight-view2_part6',
         'p3d_vw-van-view0_part6',
-        // 'p3d_water-caustic_view0_part6',
         // 'p3d_whiteroom-daytime-view0_part6',
         'p3d_whiteroom-night-view0_part6'
       ],

+ 13 - 0
myfile.csv

@@ -0,0 +1,13 @@
+50_shades_of_grey;0;12;16;22;26;32;38;46;54;62;70;72;78;88;94;102;
+p3d_pavilion-day-view2_part6;3500;1920;1580;1260;460;820;1980;1140;240;660;1140;660;440;680;760;1140;
+p3d_landscape-view4_part6;240;240;220;200;160;140;180;160;900;200;1280;2320;2840;2120;2300;2680;
+p3d_bedroom-view1_part6;5860;5800;4380;5180;6620;5060;4280;3980;4860;4500;3360;4280;5880;4060;4600;5020;
+p3d_landscape-view0_part6;60;20;20;20;40;60;80;80;600;960;200;260;100;120;100;60;
+p3d_eponge-fractal-5-view0_part6;20;40;40;20;40;60;40;40;40;80;80;40;40;40;80;40;
+p3d_dragon_250-view0_part6;740;640;880;820;920;640;620;680;1360;1480;1540;1180;1040;1080;860;1100;
+p3d_living-room-2-view1_part6;6060;4540;4800;7740;6220;5520;5660;5360;6100;4600;6880;5160;8140;6340;5920;8100;
+p3d_kitchen-view0_part6;5360;5320;3760;4880;3940;6700;6000;3620;4440;5980;5900;5620;5940;5840;3820;4420;
+p3d_landscape-view3_part6;1140;1500;1740;2180;580;760;800;1760;980;1220;1060;1320;640;800;1400;1040;
+p3d_staircase2-view1_part6;2320;2720;2900;3140;3560;4320;5000;5480;2960;2140;2920;2620;2300;780;420;400;
+p3d_kitchen-view1_part6;4820;7100;6400;6440;6420;5340;5000;6520;5220;7840;7380;6060;5620;6140;8260;5640;
+p3d_bedroom-view0_part6;6240;7460;5600;5340;4780;4660;5120;3380;5640;6840;5080;4740;4080;4940;7420;4320;

+ 1 - 1
utils/convert_folder.sh

@@ -43,7 +43,7 @@ do
 
     if [[ "$folder" == ${prefix}* ]]; then
 
-        output_scene_folder=$output_folder/${folder}_${width}_${height}
+        output_scene_folder=$output_folder/${folder}_part6
         mkdir -p $output_scene_folder
 
         for file in $(ls ${folder_path}*)

+ 55 - 0
utils/extract_stats.py

@@ -0,0 +1,55 @@
+# main imports
+import os, sys
+import argparse
+import json
+
+
+def main():
+    """
+    main function which is ran when launching script
+    """ 
+    parser = argparse.ArgumentParser(description="Extract scenes data and save thresholds into .csv")
+
+    parser.add_argument('--file', type=str, help='image to convert', required=True)
+    parser.add_argument('--output', type=str, help='output csv filename', required=True)
+
+    args = parser.parse_args()
+
+    p_file   = args.file
+    p_output = args.output
+
+    f = open(p_file)
+    json_data = json.load(f)
+
+    dict_data = {}
+
+    for element in json_data:
+
+        scene = element['msg']['sceneName']
+
+        if scene not in dict_data:
+            dict_data[scene] = {}
+
+        extracts = element['msg']['extracts']
+
+        for extract in extracts:
+            if extract['index'] not in dict_data[scene]:
+                dict_data[scene][extract['index']] = (extract['quality'], 1)
+            else:
+                dict_data[scene][extract['index']] = (dict_data[scene][extract['index']][0] + extract['quality'], dict_data[scene][extract['index']][1] + 1)
+            
+    
+    output_file = open(p_output, 'w')
+    for scene in dict_data:
+        output_file.write(scene + ';')
+
+        for extract in dict_data[scene]:
+            thresholds_data = dict_data[scene][extract]
+            output_file.write(str(int(thresholds_data[0] / thresholds_data[1])) + ';')
+
+        output_file.write('\n')
+
+
+
+if __name__ == "__main__":
+    main()