File size: 1,690 Bytes
51ce0fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# ERA_Session20

## Objective:
The purpose of this repository is to understand the architecture of Generative Art & Stable Diffusion

## Repository:
```
.
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ config.py
β”œβ”€β”€ diffusion_loss.py
β”œβ”€β”€ image_generator.py
β”œβ”€β”€ inference.ipynb
β”œβ”€β”€ model.py
β”œβ”€β”€ prediction.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ symmetry_loss_analysis.py
└── utils.py
```

## How to execute this repository?

In `inference.ipynb`, 
    - add the prompt in the `prompt` variable
    - configure the required loss function and execute the prediction function

## Results

`prompt = A King riding a horse`

### 1. Without Loss Function

![Alt text](image.png)

### 2. Blue Channel

Computing the average absolute difference between the `blue channel` values of each pixel in the batch and the target value of `0.9`. This allows us to measure how far, on average the blue channel deviates from the desired value of `0.9` across all images in the batch

![Alt text](image-1.png)

### 3. Elastic Deformations

A data augmentation process. Applying the random elastic deformations to get an input image. The Strength and Smoothness of these deformations are controlled by the `alpha` and `sigma` parameters. The process involves generating displacement vectors for each pixel, adding these vectors to an identified grid, and then using the deformed grid to interpolate pixel values from the original image.

![Alt text](image-2.png)

### 4. Saturation

Applied a saturation adjustment to the images, and the error is calculated as the mean absolute pixel-wise difference between the original and the transformed images

![Alt text](image-3.png)