forked from openai/guided-diffusion
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwithout_classifier.sh
More file actions
executable file
·84 lines (70 loc) · 2.21 KB
/
Copy pathwithout_classifier.sh
File metadata and controls
executable file
·84 lines (70 loc) · 2.21 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
# Demo Script - WITHOUT Classifier Guidance
# Generates baseline samples for comparison
cd /home/senum/projects/guided-diffusion/guided-diffusion
echo "🎨 GUIDED DIFFUSION - WITHOUT CLASSIFIER GUIDANCE"
echo "=================================================="
echo ""
echo "📋 Configuration:"
echo " - Model: 64x64 ImageNet"
echo " - Mode: Unconditional (no classifier)"
echo " - Samples: 4 images"
echo " - Steps: 250 (fast mode)"
echo " - Output: outputs/without_classifier/"
echo ""
echo "🚀 Starting generation..."
echo ""
# Create output directory
mkdir -p outputs/without_classifier
python simple_demo.py \
--model_path models/64x64_diffusion.pt \
--attention_resolutions 32,16,8 \
--class_cond True \
--diffusion_steps 1000 \
--dropout 0.1 \
--image_size 64 \
--learn_sigma True \
--noise_schedule cosine \
--num_channels 192 \
--num_head_channels 64 \
--num_res_blocks 3 \
--resblock_updown True \
--use_new_attention_order True \
--use_scale_shift_norm True \
--timestep_respacing 250 \
--num_samples 4 \
--batch_size 2 \
--seed 55 \
--output_dir outputs/without_classifier
echo ""
echo "✅ Generation complete!"
echo ""
echo "📁 Viewing results..."
# View results from the specific output directory
python -c "
import numpy as np
from PIL import Image
import os
import glob
output_dir = 'outputs/without_classifier'
npz_files = glob.glob(f'{output_dir}/samples_*.npz')
if not npz_files:
print('❌ No samples found!')
exit(1)
latest_file = max(npz_files, key=os.path.getctime)
print(f'\n📂 Loading: {latest_file}')
data = np.load(latest_file)
images = data['arr_0']
print(f'✓ Loaded {len(images)} images')
os.makedirs(output_dir, exist_ok=True)
for i, img in enumerate(images):
save_path = f'{output_dir}/sample_{i+1:02d}.png'
Image.fromarray(img).save(save_path)
print(f' ✓ {save_path}')
print(f'\n✅ Results saved to: {output_dir}/')
print(f'📊 Compare with classifier results using: ./with_classifier_guidance.sh')
"
echo ""
echo "=================================================="
echo "✅ DONE! Check outputs/without_classifier/"
echo "=================================================="