FFHQ-Aging-Dataset / scripts /05_run_segmentation.sh
PIEthonista's picture
update
f91b4c8
#!/bin/bash
# Script to run DeepLabV3 Segmentation on images
log_dir="logs"
mkdir -p $log_dir
timestamp=$(date +"%Y%m%d_%H%M%S")
log_file="$log_dir/$timestamp.log"
start_time=$(date +"%Y-%m-%d %H:%M:%S")
start_sec=$(date +%s)
echo "Script started at: $start_time" | tee -a "$log_file"
# python -m src.run_deeplab --resolution 512 --dataset_root images/images512x512 --output_dir segmaps/segmaps512x512
# python -m src.run_deeplab --resolution 256 --dataset_root images/images256x256 --output_dir segmaps/segmaps256x256
# python -m src.run_deeplab --resolution 1024 --dataset_root images/custom1024x1024/male --output_dir segmaps/custom1024x1024/male
# python -m src.run_deeplab --resolution 1024 --dataset_root images/custom1024x1024/female --output_dir segmaps/custom1024x1024/female
# python -m src.run_deeplab --resolution 1024 --dataset_root images/custom1024x1024/female2 --output_dir segmaps/custom1024x1024/female2
python -m src.run_deeplab --resolution 1024 --dataset_root images/custom1024x1024/exemplars_male --output_dir segmaps/custom1024x1024/exemplars_male
# python -m src.run_deeplab --resolution 1024 --dataset_root images/custom1024x1024/exemplars_female --output_dir segmaps/custom1024x1024/exemplars_female
end_time=$(date +"%Y-%m-%d %H:%M:%S")
end_sec=$(date +%s)
echo "Script ended at: $end_time" | tee -a "$log_file"
# Calculate duration in different formats
duration_sec=$((end_sec - start_sec))
duration_min=$(echo "scale=2; $duration_sec / 60" | bc)
duration_hr=$(echo "scale=2; $duration_sec / 3600" | bc)
echo "Total duration: " | tee -a "$log_file"
echo "- In hours: ${duration_hr} hours" | tee -a "$log_file"
echo "- In minutes: ${duration_min} minutes" | tee -a "$log_file"
echo "- In seconds: ${duration_sec} seconds" | tee -a "$log_file"