gabehubner commited on
Commit
b8a0bef
·
verified ·
1 Parent(s): 49e21f1

Add evaluation results and reconstructions

Browse files
Files changed (4) hide show
  1. .gitattributes +2 -0
  2. README.md +198 -50
  3. input_grid.png +3 -0
  4. recon_grid.png +3 -0
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ input_grid.png filter=lfs diff=lfs merge=lfs -text
37
+ recon_grid.png filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,66 +1,214 @@
1
  ---
2
- tags:
3
- - pytorch
4
- - vae
5
- - diffusion
6
- - image-generation
7
- - cc3m
8
  license: mit
9
- datasets:
10
- - pixparse/cc3m-wds
11
- library_name: transformers
12
- pipeline_tag: image-to-image
 
 
 
 
 
 
 
 
 
 
 
13
  ---
14
 
15
- # VAE - UNet-Style Autoencoder for 256x256 Image Reconstruction
16
 
17
- This model is a UNet-style Variational Autoencoder (VAE) trained on the [CC3M](https://huggingface.co/datasets/pixparse/cc3m-wds) dataset for high-quality image reconstruction and generation. It integrates adversarial, perceptual, and identity-preserving loss terms to improve semantic and visual fidelity.
18
 
19
- ## Architecture
20
 
21
- - **Encoder/Decoder**: Multi-scale UNet architecture
22
- - **Latent Space**: 8-channel latent bottleneck with reparameterization (mu, logvar)
23
- - **Losses**:
24
- - L1 reconstruction loss
25
- - KL divergence with annealing
26
- - LPIPS perceptual loss (VGG backbone)
27
- - Identity loss via MoCo-v2 embeddings
28
- - Adversarial loss via Patch Discriminator w/ Spectral Norm
29
 
30
- $$
31
- \mathcal{L}_{total} = \mathcal{L}_{recon} + \mathcal{L}_{PIPS} + 0.5 * \mathcal{L}_{GAN} + 0.1 *\mathcal{L}_{ID} + 10^{-6} *\mathcal{L}_{KL}
32
- $$
33
 
34
- ## Training Config
35
 
36
- | Hyperparameter | Value |
37
- |-----------------------|----------------------------|
38
- | Dataset | CC3M (850k images) |
39
- | Image Resolution | 256 x 256 |
40
- | Batch Size | 16 |
41
- | Optimizer | AdamW |
42
- | Learning Rate | 5e-5 |
43
- | Precision | bf16 (mixed precision) |
44
- | Total Steps | 210,000 |
45
- | GAN Start Step | 50,000 |
46
- | KL Annealing | Yes (10% of training) |
47
- | Augmentations | Crop, flip, jitter, blur, rotation |
48
 
49
- Trained using a cosine learning rate schedule with gradient clipping and automatic mixed precision (`torch.cuda.amp`)
50
 
51
- ## Usage Example
52
 
53
- ```python
54
- import torch
55
- from transfusion.modeling.vae.vae import VAE
56
- from transfusion.config.model import VAEConfig
 
 
 
57
 
58
- config = VAEConfig(...)
59
- vae = VAE(config, is_training=False)
60
 
61
- ckpt = torch.load("vae_final_model.pt", map_location="cpu")
62
- vae.load_state_dict(ckpt["vae_state_dict"], strict=False)
63
- vae.eval()
64
 
65
- with torch.no_grad():
66
- output, _, _ = vae(input_tensor)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language: en
 
 
 
 
 
3
  license: mit
4
+ model-index:
5
+ - name: vae-256px-cc3m
6
+ results:
7
+ - task:
8
+ type: image-generation
9
+ dataset:
10
+ name: cc3m-val
11
+ type: image
12
+ metrics:
13
+ - type: FID
14
+ value: 9.458456993103027
15
+ - type: LPIPS
16
+ value: 0.16319363744094453
17
+ - type: MoCo-ID-Loss
18
+ value: 0.0010187711972133096
19
  ---
20
 
21
+ # Model Card for Model ID
22
 
23
+ <!-- Provide a quick summary of what the model is/does. -->
24
 
 
25
 
 
 
 
 
 
 
 
 
26
 
27
+ ## Model Details
 
 
28
 
29
+ ### Model Description
30
 
31
+ <!-- Provide a longer summary of what this model is. -->
 
 
 
 
 
 
 
 
 
 
 
32
 
 
33
 
 
34
 
35
+ - **Developed by:** [More Information Needed]
36
+ - **Funded by [optional]:** [More Information Needed]
37
+ - **Shared by [optional]:** [More Information Needed]
38
+ - **Model type:** [More Information Needed]
39
+ - **Language(s) (NLP):** en
40
+ - **License:** mit
41
+ - **Finetuned from model [optional]:** [More Information Needed]
42
 
43
+ ### Model Sources [optional]
 
44
 
45
+ <!-- Provide the basic links for the model. -->
 
 
46
 
47
+ - **Repository:** [More Information Needed]
48
+ - **Paper [optional]:** [More Information Needed]
49
+ - **Demo [optional]:** [More Information Needed]
50
+
51
+ ## Uses
52
+
53
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
54
+
55
+ ### Direct Use
56
+
57
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
58
+
59
+ [More Information Needed]
60
+
61
+ ### Downstream Use [optional]
62
+
63
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
64
+
65
+ [More Information Needed]
66
+
67
+ ### Out-of-Scope Use
68
+
69
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
70
+
71
+ [More Information Needed]
72
+
73
+ ## Bias, Risks, and Limitations
74
+
75
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
76
+
77
+ [More Information Needed]
78
+
79
+ ### Recommendations
80
+
81
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
82
+
83
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
84
+
85
+ ## How to Get Started with the Model
86
+
87
+ Use the code below to get started with the model.
88
+
89
+ [More Information Needed]
90
+
91
+ ## Training Details
92
+
93
+ ### Training Data
94
+
95
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
96
+
97
+ [More Information Needed]
98
+
99
+ ### Training Procedure
100
+
101
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
102
+
103
+ #### Preprocessing [optional]
104
+
105
+ [More Information Needed]
106
+
107
+
108
+ #### Training Hyperparameters
109
+
110
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
111
+
112
+ #### Speeds, Sizes, Times [optional]
113
+
114
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
115
+
116
+ [More Information Needed]
117
+
118
+ ## Evaluation
119
+
120
+ <!-- This section describes the evaluation protocols and provides the results. -->
121
+
122
+ ### Testing Data, Factors & Metrics
123
+
124
+ #### Testing Data
125
+
126
+ <!-- This should link to a Dataset Card if possible. -->
127
+
128
+ [More Information Needed]
129
+
130
+ #### Factors
131
+
132
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
133
+
134
+ [More Information Needed]
135
+
136
+ #### Metrics
137
+
138
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
139
+
140
+ [More Information Needed]
141
+
142
+ ### Results
143
+
144
+ [More Information Needed]
145
+
146
+ #### Summary
147
+
148
+
149
+
150
+ ## Model Examination [optional]
151
+
152
+ <!-- Relevant interpretability work for the model goes here -->
153
+
154
+ [More Information Needed]
155
+
156
+ ## Environmental Impact
157
+
158
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
159
+
160
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
161
+
162
+ - **Hardware Type:** [More Information Needed]
163
+ - **Hours used:** [More Information Needed]
164
+ - **Cloud Provider:** [More Information Needed]
165
+ - **Compute Region:** [More Information Needed]
166
+ - **Carbon Emitted:** [More Information Needed]
167
+
168
+ ## Technical Specifications [optional]
169
+
170
+ ### Model Architecture and Objective
171
+
172
+ [More Information Needed]
173
+
174
+ ### Compute Infrastructure
175
+
176
+ [More Information Needed]
177
+
178
+ #### Hardware
179
+
180
+ [More Information Needed]
181
+
182
+ #### Software
183
+
184
+ [More Information Needed]
185
+
186
+ ## Citation [optional]
187
+
188
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
189
+
190
+ **BibTeX:**
191
+
192
+ [More Information Needed]
193
+
194
+ **APA:**
195
+
196
+ [More Information Needed]
197
+
198
+ ## Glossary [optional]
199
+
200
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
201
+
202
+ [More Information Needed]
203
+
204
+ ## More Information [optional]
205
+
206
+ [More Information Needed]
207
+
208
+ ## Model Card Authors [optional]
209
+
210
+ [More Information Needed]
211
+
212
+ ## Model Card Contact
213
+
214
+ [More Information Needed]
input_grid.png ADDED

Git LFS Details

  • SHA256: 754f10c32157ac3cb1cc7ee4659407b4e2ada6b713a50d8faef52d517b1f2922
  • Pointer size: 133 Bytes
  • Size of remote file: 71.3 MB
recon_grid.png ADDED

Git LFS Details

  • SHA256: cf023fc8f811689cb1a8eda86dc7362f823d0e709a7c8412eae92bf7563d6a78
  • Pointer size: 133 Bytes
  • Size of remote file: 75.2 MB