You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Guides/DatasetPreparation.md
+48-1
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ In my case, I used the FFHQ Dataset, with its 70k 1024x1024px images, so there i
15
15
Public Datasets I see fitting / you could use in this step:
16
16
17
17
[ImageNet](https://image-net.org/index.php) (1,281,167 training images, 50,000 validation images and 100,000 test images)
18
-
CelebA (202'599 images of faces)
18
+
CelebA (202'599 images of faces, but these are only 178x218 .. so too small to use as HR. So check image sizes and image count before you suggest any dataset here ..)
Average hyperiqa score of ./images1024x1024/ with 69999 images is: 0.5311755728915932
35
35
Done! Results are in ./hyperiqa_score_images1024.txt.
36
36
37
+
So the average FFHQ hyperiqa score is 0.5311755728915932
38
+
Highest Score: 33630.png with 0.760104060173035
39
+
Lowest Score: 68564.png with 0.203323021531105
40
+
41
+
I cutoff the top 2k images and we now achieve an average score of 0.683929971337318, folder size of 2.7GB
42
+
37
43
The second route: Score-based cutoff. In this case, you decide on a specific score after which you will only keep images that performed better. If this step is feasable depends on how many images you have available and if you will have a sufficient amount of images left after that. I suggest going with the image-count cutoff. But this could be an alternative, a cutoff score I might suggest is somewhere around 0.6565659766966426, adjust as needed.
38
44
39
45
TODO: Describe how to run hyperIAQ here
40
46
47
+
PS additionally you can also from the next 100 images (when ordered by score) extract a few validation images, around 4 might suffice, its just to track training status/changes. From those I subjectively selected 4 which I like to look at because during a training process I will look a lot at those images to check progression of the model training and if it goes into a direction I like or if config parameters need to be adjusted.
48
+
41
49
42
50
4. Generate multiscales
43
51
44
52
What we are doing here is to create multiscale images from our current processed dataset. In my FaceUp case, it is because the dataset consists of photos of faces which are all around the same distance to the camera lense, filling out a big portion of the photograph. But someones input image might be a photograph of 2 people, where the faces make up like a fourth of the image, meaning they are further away. Since our model is trained on crops, we create multiscales, so the model also learns like what maybe a whole face would look like in a single crop. (imagine looking at a selection of puzzle pieces. But you would have never seen the whole puzzle.)
45
53
54
+
In my case for FaceUp I simply apply 1, 0.75 and 0.5 scale, 0.5 in this case corresponds to the smallest image for this dataset which will be 512x512.
55
+
56
+
scale_list = [1, 0.75]
57
+
shortest_edge = 512
58
+
59
+
the shortest_edge will save the smallest image additionally, which in this case corresponds to 512x512 (so if i had 1, 0.57, 0.5 in this case would output 4 images, the 512x512 being duplicates, since it additionally saves the shortest_edge image
60
+
61
+
this will basically triple my dataset
62
+
63
+
Folder size now 5.1GB with 6k images
64
+
46
65
5. Crop to sub-images
47
66
48
67
This increases training speed, specifically the input speed for processing. We crop to 512x512 pixel images.
49
68
69
+
Folder size now 19.4GB with 52k image files
70
+
71
+
Average hyperiqa score of FaceUp/ with 52000 images is: 0.7059247512565209
72
+
73
+
6. After-Processing-Cleanup
74
+
75
+
Like seen above ran hyperiqa again on all the 52k sub-images.
76
+
Now since they are a lot, we can again repeat the process. Sort according to score descending. Then check how many images received a score >= 0.656, in this case 44952. We dont need that many images, I can cut off way sooner. If I take the top 30k images, I stay above 0.7 score, which is great. In this case though I believe the top 25k images suffice, should be a sufficient number for also training a DAT model.
77
+
78
+
Like this we arrive at a new average hyperiqa score of 0.743899064958096
79
+
Folder size is now 10.3GB with 25k 512x512 images
80
+
81
+
After sorting after file size, looking at the resulting smallest images I decided to go even lower. From 25k to 15k images. hyperiqa score is now 0.75733778428634, Folder size 6.2GB with 15k 512x512 images. This feels nice.
82
+
83
+
Lets try out the top 10k images. hyperiqa score 0.766106883633137, Folder size 4.2GB, 10k 512x512 images.
84
+
85
+
I then renamed all the 10k files and simply gave them each a number starting from 0 to 9999. I also created a hyperiqa_score.txt file again with those images.
86
+
87
+
I will keep the other folder though in case of training a model gives not the desired results.
88
+
89
+
7. Validation Images
90
+
91
+
Insice the validation folder with the 4 images I created a hr folder, moved them there, then created x2 and x4 folders, and created box downscales of these images in these corresponding folders.
92
+
50
93
6. Generate meta info txt file
51
94
95
+
I then created a meta_info.txt file
96
+
52
97
7. Release
53
98
99
+
Then I simply took the FaceUp (with the 10k images), validation, hyperiqa_score.txt (this is not needed but I wanted to integrate it) and the meta_info.txt file and zipped them up in a 7zip file which I then uploaded to google drive.
54
100
101
+
Then I started training a model, so I could then in discord release the model (to showcase the dataset) together with this dataset.
0 commit comments