aoxo
/

Image-to-Image
English
art
aoxo commited on
Commit
7e9318e
1 Parent(s): c59452d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +216 -3
README.md CHANGED
@@ -1,3 +1,216 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - aoxo/photorealism-style-adapter-gta-v
5
+ language:
6
+ - en
7
+ metrics:
8
+ - accuracy
9
+ pipeline_tag: image-to-image
10
+ tags:
11
+ - art
12
+ ---
13
+ # Introducing RealFormer - A new approach to Photorealism over Supersampling
14
+
15
+ Introducing RealFormer, a novel image-to-image transformer model designed for enhancing photorealism in images, particularly focused on transforming synthetic images to more realistic ones.
16
+ ## Model Details
17
+
18
+ ### Model Description
19
+
20
+ RealFormer is an innovative Vision Transformer (ViT) based architecture that combines elements of Linear Attention (approximation attention) with Swin Transformers and adaptive instance normalization (AdaIN) for style transfer. It's designed to transform images,specifically targeted at the video game and animation industry, potentially enhancing their photorealism or applying style transfer.
21
+
22
+ - **Developed by:** Alosh Denny
23
+ - **Funded by [optional]:** EmelinLabs
24
+ - **Shared by [optional]:** EmelinLabs
25
+ - **Model type:** Image-to-Image Transformer
26
+ - **Language(s) (NLP):** None (Pre-trained Generative Image Model)
27
+ - **License:** Apache-2.0
28
+ - **Finetuned from model [optional]:** Novel; Pre-trained (not finetuned)
29
+
30
+ ### Model Sources [optional]
31
+
32
+ - **Dataset:** [Calibration Dataset for Grand Theft Auto V](https://huggingface.co/datasets/aoxo/photorealism-style-adapter-gta-v), [Pre-Training](https://huggingface.co/datasets/aoxo/latent_diffusion_super_sampling)
33
+ - **Repository:** [Swin Transformer](https://github.com/microsoft/Swin-Transformer)
34
+ - **Paper:** [Ze Liu et al. (2021)](https://arxiv.org/abs/2103.14030)
35
+
36
+ ## Uses
37
+
38
+ ### Direct Use
39
+
40
+ RealFormer is designed for image-to-image translation tasks. It can be used directly for:
41
+
42
+ - Enhancing photorealism in synthetic images (e.g., transforming video game graphics to more realistic images)
43
+ - Style transfer between rendered frames and post-processed frames
44
+ - To be incorporated in pipeline with [DLSS](https://developer.nvidia.com/rtx/dlss)
45
+
46
+ ### Downstream Use
47
+
48
+ Potential downstream uses could include:
49
+
50
+ - Integration into game engines for real-time graphics enhancement - AdaIN layers are finetunable for video-game-specific usecases. In this implementation, the models have been pretrained on a variety of video for **super-sampling**, **photorealistic style transfer** and **reverse photorealism**.
51
+ - Pre-processing step in computer vision pipelines to improve input image quality - Decoder layers can be frozen for task-specific usecases.
52
+ - Photo editing software for synthesized image enhancement
53
+
54
+ ### Out-of-Scope Use
55
+
56
+ This model is not recommended for:
57
+
58
+ - Generating or manipulating images in ways that could be deceptive or harmful
59
+ - Tasks requiring perfect preservation of specific image details, as the transformation process may alter some artifacts of the image
60
+ - Medical or forensic image analysis where any alteration could lead to misinterpretation. Remember, this is a model, not a classification or detection model.
61
+
62
+ ## Bias, Risks, and Limitations
63
+
64
+ - The model may introduce biases present in the training data, potentially altering images in ways that reflect these biases.
65
+ - There's a risk of over-smoothing or losing fine details in the image transformation process.
66
+ - The model's performance may vary significantly depending on the input image characteristics and how similar they are to the training data.
67
+ - As with any image manipulation tool, there's a potential for misuse in creating deceptive or altered images.
68
+
69
+ ## How to Get Started with the Model
70
+
71
+ Use the code below to get started with the model.
72
+
73
+ ```python
74
+ # Instantiate the model
75
+ model = ViTImage2Image(img_size=512, patch_size=16, emb_dim=768, num_heads=16, num_layers=8, hidden_dim=3072)
76
+
77
+ # Move model to GPU if available
78
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
79
+ model = model.to(device)
80
+
81
+ # Load an image
82
+ input_image = load_image('path_to_your_image.png')
83
+ input_image = input_image.to(device)
84
+
85
+ # Perform inference
86
+ with torch.no_grad():
87
+ output = model(input_image, input_image) # Using input as both content and style for this example
88
+
89
+ # Visualize or save the output
90
+ visualize_tensor(output, "Output Image")
91
+ ```
92
+
93
+ ## Training Details
94
+
95
+ ### Training Data
96
+
97
+ The model was trained on two
98
+
99
+ [More Information Needed]
100
+
101
+ ### Training Procedure
102
+
103
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
104
+
105
+ #### Preprocessing [optional]
106
+
107
+ [More Information Needed]
108
+
109
+
110
+ #### Training Hyperparameters
111
+
112
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
113
+
114
+ #### Speeds, Sizes, Times [optional]
115
+
116
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
117
+
118
+ [More Information Needed]
119
+
120
+ ## Evaluation
121
+
122
+ <!-- This section describes the evaluation protocols and provides the results. -->
123
+
124
+ ### Testing Data, Factors & Metrics
125
+
126
+ #### Testing Data
127
+
128
+ <!-- This should link to a Dataset Card if possible. -->
129
+
130
+ [More Information Needed]
131
+
132
+ #### Factors
133
+
134
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
135
+
136
+ [More Information Needed]
137
+
138
+ #### Metrics
139
+
140
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
141
+
142
+ [More Information Needed]
143
+
144
+ ### Results
145
+
146
+ [More Information Needed]
147
+
148
+ #### Summary
149
+
150
+
151
+
152
+ ## Model Examination [optional]
153
+
154
+ <!-- Relevant interpretability work for the model goes here -->
155
+
156
+ [More Information Needed]
157
+
158
+ ## Environmental Impact
159
+
160
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
161
+
162
+ 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).
163
+
164
+ - **Hardware Type:** [More Information Needed]
165
+ - **Hours used:** [More Information Needed]
166
+ - **Cloud Provider:** [More Information Needed]
167
+ - **Compute Region:** [More Information Needed]
168
+ - **Carbon Emitted:** [More Information Needed]
169
+
170
+ ## Technical Specifications [optional]
171
+
172
+ ### Model Architecture and Objective
173
+
174
+ [More Information Needed]
175
+
176
+ ### Compute Infrastructure
177
+
178
+ [More Information Needed]
179
+
180
+ #### Hardware
181
+
182
+ [More Information Needed]
183
+
184
+ #### Software
185
+
186
+ [More Information Needed]
187
+
188
+ ## Citation [optional]
189
+
190
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
191
+
192
+ **BibTeX:**
193
+
194
+ [More Information Needed]
195
+
196
+ **APA:**
197
+
198
+ [More Information Needed]
199
+
200
+ ## Glossary [optional]
201
+
202
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
203
+
204
+ [More Information Needed]
205
+
206
+ ## More Information [optional]
207
+
208
+ [More Information Needed]
209
+
210
+ ## Model Card Authors [optional]
211
+
212
+ [More Information Needed]
213
+
214
+ ## Model Card Contact
215
+
216
+ [More Information Needed]