Skip to content
Snippets Groups Projects
Select Git revision
  • 85abebde4ff16a406fd05341bf7d0be009d5321c
  • master default protected
  • blender-v3.6-release
  • main
  • blender-v4.1-release
  • blender-v4.0-release
  • blender-v3.3-release
  • asset-shelf
  • blender-v3.5-release
  • brush-assets-project
  • blender-v2.93-release
  • blender-v3.4-release
  • xr-dev
  • bholodeck-v3.3
  • blender-v3.2-release
  • temp-xr-tracker
  • blender-v3.1-release
  • screenshots-manual
  • gltf_vtree
  • blender-v2.83-release
  • blender-v3.0-release
  • v3.6.18
  • v3.6.19
  • v3.6.20
  • v3.6.21
  • v3.6.22
  • v3.6.23
  • v4.1.1
  • v4.1.0
  • v3.6.10
  • v3.6.11
  • v3.6.12
  • v3.6.13
  • v3.6.14
  • v3.6.15
  • v3.6.16
  • v3.6.17
  • v3.6.9
  • v3.3.16
  • v3.6.8
  • v3.3.15
41 results

space_clip_editor_refine_solution.py

Blame
  • training.py 2.15 KiB
    import subprocess
    import time
    import os
    
    # Start measuring script execution time
    start_time = time.time()
    
    # --------------------------------------------------------------------------
    current_file_directory = os.path.dirname(os.path.abspath(__file__))
    data_dir = os.path.join(current_file_directory, "data")
    
    # weights_file = "model_weights_exp_synth_class_unet_6.h5"
    # weights_file = "model_weights_exp_synth_class_unet_crpr_2.h5"
    # weights_file = "model_weights_exp_synth_class_unet_pores_2.h5"
    # weights_file = "model_weights_exp_synth_real_mix_class_unet_6.h5"
    weights_file = "model_weights_exp_synth_real_mix_class_unet_crpr_2.h5"
    # weights_file = "model_weights_exp_synth_real_mix_class_unet_pores_2.h5"
    
    synth_images_path = os.path.join(data_dir, "synth_data/synth_images")
    # synth_masks_path = os.path.join(data_dir, "synth_data/synth_masks")
    synth_masks_path = os.path.join(data_dir, "synth_data/synth_masks_crpr")
    # synth_masks_path = os.path.join(data_dir, "synth_data/synth_masks_pores")
    real_images_path = os.path.join(data_dir, "real_data/real_images")
    # real_masks_path = os.path.join(data_dir, "real_data/real_masks")
    real_masks_path = os.path.join(data_dir, "real_data/real_masks_crpr")
    # real_masks_path = os.path.join(data_dir, "real_data/real_masks_pores")
    load_synth_data = True
    load_real_data = True
    # --------------------------------------------------------------------------
    experiment_name = weights_file.replace("model_weights_", "").replace(".h5", "")
    
    # Use subprocess to run the test.py script
    script_path = "scripts/train.py"
    subprocess.run(["python", script_path, "--synth_images_path", synth_images_path, "--synth_masks_path", synth_masks_path, "--real_images_path", real_images_path, "--real_masks_path", real_masks_path, "--experiment_name", experiment_name, "--load_synth_data", str(load_synth_data), "--load_real_data", str(load_real_data)])
    
    # Calculate and print the total time taken
    end_time = time.time()
    execution_time = end_time - start_time
    minutes = int(execution_time / 60)
    seconds = int(execution_time % 60)
    print(f"Total time taken: {minutes} minutes and {seconds} seconds")
    
    # --------------------------------------------------------------------------