Parcourir la source

update of convert_folder script

Jérôme BUISINE il y a 3 ans
Parent
commit
ef55aebb85

+ 1 - 1
main/extract_stats_images_all_reduced.cpp

@@ -398,7 +398,7 @@ int main(int argc, char *argv[]){
             try {
                 
                 float* RGBpixels = rawls::getPixelsRAWLS(imagesPath.at(i));
-                std::cout << "Read image n°" << nsamples << " / " << nsamples << " for tile n°" << t_index << " / " << tiles.size() << std::endl;
+                std::cout << "Read image n°" << i << " / " << nsamples << " for tile n°" << t_index << " / " << tiles.size() << std::endl;
 
                 unsigned index = 0;
                 for (int y = tile.p1.y; y < tile.p2.y; ++y) {

+ 9 - 2
run/convert_folder.sh

@@ -36,14 +36,21 @@ do
         filename=$folder$file
         filename_fixed=${filename//\/\//\/}
 
-        IFS='.' read -ra ADDR <<< "${file}"
 
+        IFS='/' read -ra ADDR <<< "${scene}"
+        folder=${ADDR[-1]}
+
+        # get output expected path
+        output_scene_path=$output_folder/$folder
+
+        
+        IFS='.' read -ra ADDR <<< "${file}"        
         filename_without_ext=${ADDR[0]}
         outfile="${filename_without_ext}.${ext}"
 
         # check if filename contains 
         if [[ "$file" == ${prefix}* ]]; then
-            ./main/rawls_convert --image ${filename_fixed} --outfile ${output_folder}/${outfile}
+            echo ./main/rawls_convert --image ${filename_fixed} --outfile ${output_scene_path}/${outfile}
         fi
     done 
   done

+ 5 - 0
run/run_all_estimators.py

@@ -1,5 +1,6 @@
 import os
 import argparse
+import time
 
 def main():
 
@@ -37,7 +38,11 @@ def main():
             outfilename = os.path.join(output_folder, scene + '_10000.rawls')
 
             if not os.path.exists(outfilename):
+                t1 = time.time()
                 os.system('./build/main/extract_stats_images --folder {0} --bwidth {1} --bheight {2} --outfile {3} --estimator {4}'.format(scene_path, x_tile, y_tile, p_est, outfilename))
+                t2 = time.time()
+                delta = (t2 - t1)
+                print(f'Extraction for {scene}, took {delta}')
             else:
                 print('Already generated')
 

+ 1 - 1
run/run_all_estimators_reduced.py

@@ -43,7 +43,7 @@ def main():
             if not all(checked_folder):
                 print(f'Extraction of estimators for {scene} scene')
                 t1 = time.time()
-                os.system('./build/main/extract_stats_images_all_reduced --folder {0} --bwidth {1} --bheight {2} --nfiles {3} --output {4}'.format(scene_path, x_tile, y_tile, p_nfiles, p_output))
+                print('./build/main/extract_stats_images_all_reduced --folder {0} --bwidth {1} --bheight {2} --nfiles {3} --output {4}'.format(scene_path, x_tile, y_tile, p_nfiles, p_output))
                 t2 = time.time()
                 delta = (t2 - t1)
                 print(f'Extraction for {scene}, took {delta}')