Parcourir la source

Update of output folders

Jerome Buisine il y a 5 ans
Parent
commit
8c66cb1b6a
3 fichiers modifiés avec 5 ajouts et 3 suppressions
  1. 0 1
      predict_noisy_image_svd_lab.py
  2. 3 1
      predict_seuil_expe.py
  3. 2 1
      save_model_result_in_md.py

+ 0 - 1
predict_noisy_image_svd_lab.py

@@ -43,7 +43,6 @@ def main():
     model = joblib.load(p_model_file) 
 
     # load image
-
     img = Image.open(p_img_file)
     LAB_L = image_processing.get_LAB_L_SVD_s(img)
 

+ 3 - 1
predict_seuil_expe.py

@@ -151,7 +151,9 @@ def main():
 
         # end of scene => display of results
 
-        model_treshold_path = threshold_map_folder + '/' + p_model_file.split('/')[1]
+        # construct path using model name for saving threshold map folder
+        model_treshold_path = threshold_map_folder + '/' + p_model_file.split('/')[-1]
+        
         if not os.path.exists(model_treshold_path):
             os.makedirs(model_treshold_path)
 

+ 2 - 1
save_model_result_in_md.py

@@ -65,7 +65,8 @@ def main():
     if not os.path.exists(markdowns_folder):
         os.makedirs(markdowns_folder)
         
-    md_model_path = markdowns_folder + '/' + p_model_file.split('/')[1].replace('.joblib', '.md')
+    # get model name to construct model
+    md_model_path = markdowns_folder + '/' + p_model_file.split('/')[-1].replace('.joblib', '.md')
 
     with open(md_model_path, 'w') as f:
         f.write(output.decode("utf-8"))