-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate.sh
More file actions
executable file
·28 lines (24 loc) · 1.16 KB
/
Copy pathgenerate.sh
File metadata and controls
executable file
·28 lines (24 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
# Generate samples from a trained WaveDiT checkpoint.
#
# bash generate.sh checkpoints/WaveDiT_CFM/best.pth [output_dir]
#
# Checkpoints are self-contained, so no architecture flags are needed here.
set -euo pipefail
CHECKPOINT="${1:?usage: bash generate.sh <checkpoint.pth> [output_dir]}"
OUTPUT_DIR="${2:-generated_samples}"
# --- Edit these as needed ---
CFG_SCALE=1.0
NUM_FLOW_STEPS=10
SAMPLER=heun
SAVE_SIZE=(182 218 182) # final crop (D H W); matches typical raw MRI size
CONDITIONS=("age=25.0" "age=45.0" "age=65.0" "age=85.0")
NUM_SAMPLES=5 # per condition set
PYTHONPATH=. python3 scripts/generate.py "${CHECKPOINT}" "${OUTPUT_DIR}" \
--cfg-scale "${CFG_SCALE}" --num-flow-steps "${NUM_FLOW_STEPS}" --sampler "${SAMPLER}" \
--save-size "${SAVE_SIZE[@]}" \
specific --num-samples "${NUM_SAMPLES}" --conditions "${CONDITIONS[@]}"
# --- Linear age interpolation alternative ---
# PYTHONPATH=. python3 scripts/generate.py "${CHECKPOINT}" "${OUTPUT_DIR}" \
# --num-flow-steps "${NUM_FLOW_STEPS}" --sampler "${SAMPLER}" --save-size "${SAVE_SIZE[@]}" \
# linear --condition age --min 6 --max 95 --num 100