Commit
·
13270de
1
Parent(s):
0821ef0
formatting
Browse files- .gitignore +1 -1
- .pre-commit-config.yaml +2 -1
- Procfile +1 -1
- README.md +1 -1
- black.toml +1 -1
- configs/augmentations.json +341 -342
- run.sh +1 -1
- setup.sh +1 -1
- src/app.py +2 -6
- src/utils.py +1 -1
- src/visuals.py +12 -3
.gitignore
CHANGED
@@ -57,4 +57,4 @@ docs/_build/
|
|
57 |
target/
|
58 |
|
59 |
.ipynb_checkpoints
|
60 |
-
\.idea
|
|
|
57 |
target/
|
58 |
|
59 |
.ipynb_checkpoints
|
60 |
+
\.idea
|
.pre-commit-config.yaml
CHANGED
@@ -3,6 +3,7 @@ repos:
|
|
3 |
rev: v2.3.0
|
4 |
hooks:
|
5 |
- id: flake8
|
|
|
6 |
- id: trailing-whitespace
|
7 |
- id: end-of-file-fixer
|
8 |
- id: requirements-txt-fixer
|
@@ -14,4 +15,4 @@ repos:
|
|
14 |
rev: 19.3b0
|
15 |
hooks:
|
16 |
- id: black
|
17 |
-
args: [--config=black.toml]
|
|
|
3 |
rev: v2.3.0
|
4 |
hooks:
|
5 |
- id: flake8
|
6 |
+
args: [--max-line-length=88]
|
7 |
- id: trailing-whitespace
|
8 |
- id: end-of-file-fixer
|
9 |
- id: requirements-txt-fixer
|
|
|
15 |
rev: 19.3b0
|
16 |
hooks:
|
17 |
- id: black
|
18 |
+
args: [--config=black.toml]
|
Procfile
CHANGED
@@ -1 +1 @@
|
|
1 |
-
web: sh setup.sh && streamlit run src/app.py
|
|
|
1 |
+
web: sh setup.sh && streamlit run src/app.py
|
README.md
CHANGED
@@ -24,4 +24,4 @@ And then just follow the address you see in console. You should see something si
|
|
24 |
## Online playground:
|
25 |
You can also play with the current deployed version:
|
26 |
[https://albumentations-demo.herokuapp.com/](https://albumentations-demo.herokuapp.com/)
|
27 |
-
It is deployed on free service with very limited computing power and can be quite unstable.
|
|
|
24 |
## Online playground:
|
25 |
You can also play with the current deployed version:
|
26 |
[https://albumentations-demo.herokuapp.com/](https://albumentations-demo.herokuapp.com/)
|
27 |
+
It is deployed on free service with very limited computing power and can be quite unstable.
|
black.toml
CHANGED
@@ -18,4 +18,4 @@ exclude = '''
|
|
18 |
| dist
|
19 |
)/
|
20 |
)
|
21 |
-
'''
|
|
|
18 |
| dist
|
19 |
)/
|
20 |
)
|
21 |
+
'''
|
configs/augmentations.json
CHANGED
@@ -1,503 +1,502 @@
|
|
1 |
{
|
2 |
-
"
|
3 |
-
"ToSepia": [],
|
4 |
-
"ChannelShuffle": [],
|
5 |
-
"InvertImg": [],
|
6 |
-
"VerticalFlip": [],
|
7 |
-
"HorizontalFlip": [],
|
8 |
-
"Flip": [],
|
9 |
-
"Transpose": [],
|
10 |
-
"RandomGridShuffle": [
|
11 |
{
|
12 |
-
"
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
],
|
18 |
"limits_list": [
|
19 |
[
|
20 |
1,
|
21 |
-
|
22 |
],
|
23 |
[
|
24 |
1,
|
25 |
-
|
26 |
]
|
27 |
],
|
28 |
-
"
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
32 |
}
|
33 |
],
|
34 |
-
"
|
35 |
{
|
36 |
-
"param_name": "
|
37 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
"limits_list": [
|
39 |
-
|
40 |
-
|
41 |
],
|
42 |
-
"
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
],
|
48 |
-
"
|
|
|
49 |
{
|
50 |
-
"
|
51 |
-
"
|
52 |
-
|
53 |
-
|
54 |
-
100
|
55 |
],
|
56 |
-
"
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
],
|
62 |
-
"
|
63 |
{
|
64 |
-
"
|
65 |
-
"type": "int_interval",
|
66 |
"limits_list": [
|
67 |
-
|
68 |
100
|
69 |
],
|
70 |
-
"
|
71 |
-
|
72 |
-
|
73 |
-
]
|
74 |
-
}
|
75 |
-
],
|
76 |
-
"GaussNoise": [
|
77 |
{
|
78 |
-
"
|
79 |
-
"type": "int_interval",
|
80 |
"limits_list": [
|
81 |
-
|
82 |
-
|
83 |
],
|
84 |
-
"
|
85 |
-
|
86 |
-
50.0
|
87 |
-
]
|
88 |
},
|
89 |
{
|
90 |
-
"
|
91 |
-
"type": "int_interval",
|
92 |
"limits_list": [
|
93 |
-
|
94 |
-
100
|
95 |
],
|
96 |
-
"
|
|
|
|
|
|
|
|
|
|
|
97 |
}
|
98 |
],
|
99 |
-
"
|
100 |
{
|
101 |
-
"
|
102 |
-
|
103 |
-
|
104 |
-
-1.0,
|
105 |
-
1.0
|
106 |
],
|
107 |
-
"
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
111 |
}
|
112 |
],
|
113 |
-
"
|
|
|
114 |
{
|
115 |
-
"
|
116 |
-
|
|
|
|
|
117 |
"limits_list": [
|
118 |
-
|
119 |
-
|
120 |
],
|
121 |
-
"
|
122 |
-
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
}
|
126 |
],
|
|
|
127 |
"HueSaturationValue": [
|
128 |
{
|
129 |
-
"param_name": "hue_shift_limit",
|
130 |
-
"type": "int_interval",
|
131 |
-
"limits_list": [
|
132 |
-
-100,
|
133 |
-
100
|
134 |
-
],
|
135 |
"defaults": [
|
136 |
-20,
|
137 |
20
|
138 |
-
]
|
139 |
-
},
|
140 |
-
{
|
141 |
-
"param_name": "sat_shift_limit",
|
142 |
-
"type": "int_interval",
|
143 |
"limits_list": [
|
144 |
-100,
|
145 |
100
|
146 |
],
|
|
|
|
|
|
|
|
|
147 |
"defaults": [
|
148 |
-30,
|
149 |
30
|
150 |
-
]
|
151 |
-
},
|
152 |
-
{
|
153 |
-
"param_name": "val_shift_limit",
|
154 |
-
"type": "int_interval",
|
155 |
"limits_list": [
|
156 |
-100,
|
157 |
100
|
158 |
],
|
|
|
|
|
|
|
|
|
159 |
"defaults": [
|
160 |
-20,
|
161 |
20
|
162 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
}
|
164 |
],
|
165 |
-
"
|
166 |
{
|
167 |
-
"
|
168 |
-
|
169 |
-
|
170 |
-
-255,
|
171 |
-
255
|
172 |
],
|
173 |
-
"
|
174 |
-
|
175 |
-
20
|
176 |
-
]
|
177 |
},
|
178 |
{
|
179 |
-
"
|
180 |
-
|
181 |
-
|
182 |
-
-255,
|
183 |
-
255
|
184 |
],
|
185 |
-
"defaults": [
|
186 |
-
-20,
|
187 |
-
20
|
188 |
-
]
|
189 |
-
},
|
190 |
-
{
|
191 |
-
"param_name": "b_shift_limit",
|
192 |
-
"type": "int_interval",
|
193 |
"limits_list": [
|
194 |
-
|
195 |
-
|
196 |
],
|
197 |
-
"
|
198 |
-
|
199 |
-
|
200 |
-
]
|
|
|
201 |
}
|
202 |
],
|
|
|
203 |
"JpegCompression": [
|
204 |
{
|
205 |
-
"
|
206 |
-
|
207 |
-
|
208 |
],
|
209 |
-
"type": "min_max",
|
210 |
"limits_list": [
|
211 |
0,
|
212 |
100
|
213 |
],
|
214 |
-
"defaults_list": [
|
215 |
-
80,
|
216 |
-
100
|
217 |
-
]
|
218 |
-
}
|
219 |
-
],
|
220 |
-
"ImageCompression": [
|
221 |
-
{
|
222 |
-
"param_name": "compression_type",
|
223 |
-
"type": "radio",
|
224 |
-
"options_list": [
|
225 |
-
0,
|
226 |
-
1
|
227 |
-
]
|
228 |
-
},
|
229 |
-
{
|
230 |
"param_name": [
|
231 |
"quality_lower",
|
232 |
"quality_upper"
|
233 |
],
|
234 |
-
"type": "min_max"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
"limits_list": [
|
236 |
-
|
237 |
100
|
238 |
],
|
239 |
-
"
|
240 |
-
|
241 |
-
100
|
242 |
-
]
|
243 |
}
|
244 |
],
|
245 |
-
"
|
246 |
{
|
247 |
-
"param_name": "clip_limit",
|
248 |
-
"type": "int_interval",
|
249 |
-
"limits_list": [
|
250 |
-
1,
|
251 |
-
100
|
252 |
-
],
|
253 |
"defaults": [
|
254 |
-
|
255 |
-
|
256 |
-
]
|
257 |
-
},
|
258 |
-
{
|
259 |
-
"param_name": "tile_grid_size",
|
260 |
-
"type": "several_ints",
|
261 |
-
"subparam_names": [
|
262 |
-
"height",
|
263 |
-
"width"
|
264 |
],
|
265 |
"limits_list": [
|
266 |
-
|
267 |
-
|
268 |
-
100
|
269 |
-
],
|
270 |
-
[
|
271 |
-
1,
|
272 |
-
100
|
273 |
-
]
|
274 |
],
|
275 |
-
"
|
276 |
-
|
277 |
-
8
|
278 |
-
]
|
279 |
}
|
280 |
],
|
281 |
-
"
|
282 |
{
|
283 |
-
"
|
284 |
-
|
|
|
|
|
285 |
"limits_list": [
|
286 |
-
|
287 |
-
|
288 |
],
|
289 |
-
"
|
|
|
290 |
},
|
291 |
{
|
292 |
-
"
|
293 |
-
|
|
|
|
|
294 |
"limits_list": [
|
295 |
-
|
296 |
-
|
297 |
],
|
298 |
-
"
|
|
|
299 |
},
|
300 |
{
|
301 |
-
"
|
302 |
-
|
|
|
|
|
303 |
"limits_list": [
|
304 |
-
|
305 |
-
|
306 |
],
|
307 |
-
"
|
308 |
-
|
309 |
-
{
|
310 |
-
"param_name": "fill_value",
|
311 |
-
"type": "rgb"
|
312 |
}
|
313 |
],
|
314 |
-
"
|
315 |
{
|
316 |
-
"
|
317 |
-
|
318 |
-
|
319 |
],
|
320 |
-
"type": "min_max",
|
321 |
"limits_list": [
|
322 |
-
|
323 |
1.0
|
324 |
],
|
325 |
-
"
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
{
|
331 |
-
"
|
332 |
-
|
|
|
|
|
333 |
"limits_list": [
|
334 |
-
|
335 |
-
|
336 |
],
|
337 |
-
"
|
|
|
338 |
}
|
339 |
-
|
340 |
],
|
341 |
"RandomFog": [
|
342 |
{
|
343 |
-
"
|
344 |
-
|
345 |
-
|
346 |
],
|
347 |
-
"type": "min_max",
|
348 |
"limits_list": [
|
349 |
0.0,
|
350 |
1.0
|
351 |
],
|
352 |
-
"
|
353 |
-
|
354 |
-
|
355 |
-
]
|
|
|
356 |
},
|
357 |
{
|
358 |
-
"
|
359 |
-
"type": "int_interval",
|
360 |
"limits_list": [
|
361 |
0.0,
|
362 |
1.0
|
363 |
],
|
364 |
-
"
|
|
|
365 |
}
|
366 |
],
|
367 |
-
"
|
368 |
{
|
369 |
-
"
|
370 |
-
|
371 |
-
"limits_list": [
|
372 |
-
1,
|
373 |
3
|
374 |
],
|
375 |
-
"defaults": [
|
376 |
-
1,
|
377 |
-
1
|
378 |
-
]
|
379 |
-
},
|
380 |
-
{
|
381 |
-
"param_name": "fill_value",
|
382 |
-
"type": "int_interval",
|
383 |
-
"limits_list": [
|
384 |
-
0,
|
385 |
-
255
|
386 |
-
],
|
387 |
-
"defaults": 0
|
388 |
-
}
|
389 |
-
],
|
390 |
-
"Solarize": [
|
391 |
-
{
|
392 |
-
"param_name": "threshold",
|
393 |
-
"type": "int_interval",
|
394 |
"limits_list": [
|
395 |
-
|
396 |
-
255
|
397 |
-
],
|
398 |
-
"defaults": 128
|
399 |
-
}
|
400 |
-
],
|
401 |
-
"Equalize": [
|
402 |
-
{
|
403 |
-
"param_name": "mode",
|
404 |
-
"type": "radio",
|
405 |
-
"options_list": [
|
406 |
-
"cv",
|
407 |
-
"pil"
|
408 |
-
]
|
409 |
-
},
|
410 |
-
{
|
411 |
-
"param_name": "by_channels",
|
412 |
-
"type": "checkbox",
|
413 |
-
"defaults": 1
|
414 |
-
}
|
415 |
-
],
|
416 |
-
"CenterCrop": [
|
417 |
-
{
|
418 |
-
"param_name": "height",
|
419 |
-
"type": "int_interval",
|
420 |
-
"placeholder": {
|
421 |
-
"limits_list": [
|
422 |
1,
|
423 |
-
|
424 |
],
|
425 |
-
|
426 |
-
}
|
427 |
-
},
|
428 |
-
{
|
429 |
-
"param_name": "width",
|
430 |
-
"type": "int_interval",
|
431 |
-
"placeholder": {
|
432 |
-
"limits_list": [
|
433 |
1,
|
434 |
-
|
435 |
-
],
|
436 |
-
"defaults": "image_half_width"
|
437 |
-
}
|
438 |
-
}
|
439 |
-
],
|
440 |
-
"Crop": [
|
441 |
-
{
|
442 |
-
"param_name": [
|
443 |
-
"x_min",
|
444 |
-
"x_max"
|
445 |
-
],
|
446 |
-
"type": "min_max",
|
447 |
-
"placeholder": {
|
448 |
-
"limits_list": [
|
449 |
-
0,
|
450 |
-
"image_width"
|
451 |
-
],
|
452 |
-
"defaults_list": [
|
453 |
-
0,
|
454 |
-
"image_half_width"
|
455 |
]
|
456 |
-
},
|
457 |
-
"min_diff": 1
|
458 |
-
},
|
459 |
-
{
|
460 |
-
"param_name": [
|
461 |
-
"y_min",
|
462 |
-
"y_max"
|
463 |
],
|
464 |
-
"
|
465 |
-
"
|
466 |
-
"
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
"defaults_list": [
|
471 |
-
0,
|
472 |
-
"image_half_height"
|
473 |
-
]
|
474 |
-
},
|
475 |
-
"min_diff": 1
|
476 |
}
|
477 |
],
|
478 |
"RandomScale": [
|
479 |
{
|
480 |
-
"
|
481 |
-
|
|
|
|
|
482 |
"limits_list": [
|
483 |
-0.9,
|
484 |
2.0
|
485 |
],
|
486 |
-
"
|
487 |
-
|
488 |
-
0.1
|
489 |
-
]
|
490 |
},
|
491 |
{
|
492 |
-
"param_name": "interpolation",
|
493 |
-
"type": "radio",
|
494 |
"options_list": [
|
495 |
0,
|
496 |
1,
|
497 |
2,
|
498 |
3,
|
499 |
4
|
500 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
501 |
}
|
502 |
-
]
|
503 |
-
|
|
|
|
|
|
|
|
|
|
1 |
{
|
2 |
+
"Blur": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
{
|
4 |
+
"defaults": [
|
5 |
+
3,
|
6 |
+
7
|
7 |
+
],
|
8 |
+
"limits_list": [
|
9 |
+
3,
|
10 |
+
100
|
11 |
+
],
|
12 |
+
"param_name": "blur_limit",
|
13 |
+
"type": "int_interval"
|
14 |
+
}
|
15 |
+
],
|
16 |
+
"CLAHE": [
|
17 |
+
{
|
18 |
+
"defaults": [
|
19 |
+
1,
|
20 |
+
4
|
21 |
+
],
|
22 |
+
"limits_list": [
|
23 |
+
1,
|
24 |
+
100
|
25 |
+
],
|
26 |
+
"param_name": "clip_limit",
|
27 |
+
"type": "int_interval"
|
28 |
+
},
|
29 |
+
{
|
30 |
+
"defaults_list": [
|
31 |
+
8,
|
32 |
+
8
|
33 |
],
|
34 |
"limits_list": [
|
35 |
[
|
36 |
1,
|
37 |
+
100
|
38 |
],
|
39 |
[
|
40 |
1,
|
41 |
+
100
|
42 |
]
|
43 |
],
|
44 |
+
"param_name": "tile_grid_size",
|
45 |
+
"subparam_names": [
|
46 |
+
"height",
|
47 |
+
"width"
|
48 |
+
],
|
49 |
+
"type": "several_ints"
|
50 |
}
|
51 |
],
|
52 |
+
"CenterCrop": [
|
53 |
{
|
54 |
+
"param_name": "height",
|
55 |
+
"placeholder": {
|
56 |
+
"defaults": "image_half_height",
|
57 |
+
"limits_list": [
|
58 |
+
1,
|
59 |
+
"image_height"
|
60 |
+
]
|
61 |
+
},
|
62 |
+
"type": "int_interval"
|
63 |
+
},
|
64 |
+
{
|
65 |
+
"param_name": "width",
|
66 |
+
"placeholder": {
|
67 |
+
"defaults": "image_half_width",
|
68 |
+
"limits_list": [
|
69 |
+
1,
|
70 |
+
"image_width"
|
71 |
+
]
|
72 |
+
},
|
73 |
+
"type": "int_interval"
|
74 |
+
}
|
75 |
+
],
|
76 |
+
"ChannelDropout": [
|
77 |
+
{
|
78 |
+
"defaults": [
|
79 |
+
1,
|
80 |
+
1
|
81 |
+
],
|
82 |
"limits_list": [
|
83 |
+
1,
|
84 |
+
3
|
85 |
],
|
86 |
+
"param_name": "channel_drop_range",
|
87 |
+
"type": "int_interval"
|
88 |
+
},
|
89 |
+
{
|
90 |
+
"defaults": 0,
|
91 |
+
"limits_list": [
|
92 |
+
0,
|
93 |
+
255
|
94 |
+
],
|
95 |
+
"param_name": "fill_value",
|
96 |
+
"type": "int_interval"
|
97 |
}
|
98 |
],
|
99 |
+
"ChannelShuffle": [],
|
100 |
+
"Crop": [
|
101 |
{
|
102 |
+
"min_diff": 1,
|
103 |
+
"param_name": [
|
104 |
+
"x_min",
|
105 |
+
"x_max"
|
|
|
106 |
],
|
107 |
+
"placeholder": {
|
108 |
+
"defaults_list": [
|
109 |
+
0,
|
110 |
+
"image_half_width"
|
111 |
+
],
|
112 |
+
"limits_list": [
|
113 |
+
0,
|
114 |
+
"image_width"
|
115 |
+
]
|
116 |
+
},
|
117 |
+
"type": "min_max"
|
118 |
+
},
|
119 |
+
{
|
120 |
+
"min_diff": 1,
|
121 |
+
"param_name": [
|
122 |
+
"y_min",
|
123 |
+
"y_max"
|
124 |
+
],
|
125 |
+
"placeholder": {
|
126 |
+
"defaults_list": [
|
127 |
+
0,
|
128 |
+
"image_half_height"
|
129 |
+
],
|
130 |
+
"limits_list": [
|
131 |
+
0,
|
132 |
+
"image_height"
|
133 |
+
]
|
134 |
+
},
|
135 |
+
"type": "min_max"
|
136 |
}
|
137 |
],
|
138 |
+
"Cutout": [
|
139 |
{
|
140 |
+
"defaults": 8,
|
|
|
141 |
"limits_list": [
|
142 |
+
1,
|
143 |
100
|
144 |
],
|
145 |
+
"param_name": "num_holes",
|
146 |
+
"type": "int_interval"
|
147 |
+
},
|
|
|
|
|
|
|
|
|
148 |
{
|
149 |
+
"defaults": 8,
|
|
|
150 |
"limits_list": [
|
151 |
+
1,
|
152 |
+
100
|
153 |
],
|
154 |
+
"param_name": "max_h_size",
|
155 |
+
"type": "int_interval"
|
|
|
|
|
156 |
},
|
157 |
{
|
158 |
+
"defaults": 8,
|
|
|
159 |
"limits_list": [
|
160 |
+
1,
|
161 |
+
100
|
162 |
],
|
163 |
+
"param_name": "max_w_size",
|
164 |
+
"type": "int_interval"
|
165 |
+
},
|
166 |
+
{
|
167 |
+
"param_name": "fill_value",
|
168 |
+
"type": "rgb"
|
169 |
}
|
170 |
],
|
171 |
+
"Equalize": [
|
172 |
{
|
173 |
+
"options_list": [
|
174 |
+
"cv",
|
175 |
+
"pil"
|
|
|
|
|
176 |
],
|
177 |
+
"param_name": "mode",
|
178 |
+
"type": "radio"
|
179 |
+
},
|
180 |
+
{
|
181 |
+
"defaults": 1,
|
182 |
+
"param_name": "by_channels",
|
183 |
+
"type": "checkbox"
|
184 |
}
|
185 |
],
|
186 |
+
"Flip": [],
|
187 |
+
"GaussNoise": [
|
188 |
{
|
189 |
+
"defaults": [
|
190 |
+
10.0,
|
191 |
+
50.0
|
192 |
+
],
|
193 |
"limits_list": [
|
194 |
+
0.0,
|
195 |
+
500.0
|
196 |
],
|
197 |
+
"param_name": "var_limit",
|
198 |
+
"type": "int_interval"
|
199 |
+
},
|
200 |
+
{
|
201 |
+
"defaults": 0.0,
|
202 |
+
"limits_list": [
|
203 |
+
-100.0,
|
204 |
+
100.0
|
205 |
+
],
|
206 |
+
"param_name": "mean",
|
207 |
+
"type": "int_interval"
|
208 |
}
|
209 |
],
|
210 |
+
"HorizontalFlip": [],
|
211 |
"HueSaturationValue": [
|
212 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
"defaults": [
|
214 |
-20,
|
215 |
20
|
216 |
+
],
|
|
|
|
|
|
|
|
|
217 |
"limits_list": [
|
218 |
-100,
|
219 |
100
|
220 |
],
|
221 |
+
"param_name": "hue_shift_limit",
|
222 |
+
"type": "int_interval"
|
223 |
+
},
|
224 |
+
{
|
225 |
"defaults": [
|
226 |
-30,
|
227 |
30
|
228 |
+
],
|
|
|
|
|
|
|
|
|
229 |
"limits_list": [
|
230 |
-100,
|
231 |
100
|
232 |
],
|
233 |
+
"param_name": "sat_shift_limit",
|
234 |
+
"type": "int_interval"
|
235 |
+
},
|
236 |
+
{
|
237 |
"defaults": [
|
238 |
-20,
|
239 |
20
|
240 |
+
],
|
241 |
+
"limits_list": [
|
242 |
+
-100,
|
243 |
+
100
|
244 |
+
],
|
245 |
+
"param_name": "val_shift_limit",
|
246 |
+
"type": "int_interval"
|
247 |
}
|
248 |
],
|
249 |
+
"ImageCompression": [
|
250 |
{
|
251 |
+
"options_list": [
|
252 |
+
0,
|
253 |
+
1
|
|
|
|
|
254 |
],
|
255 |
+
"param_name": "compression_type",
|
256 |
+
"type": "radio"
|
|
|
|
|
257 |
},
|
258 |
{
|
259 |
+
"defaults_list": [
|
260 |
+
80,
|
261 |
+
100
|
|
|
|
|
262 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
"limits_list": [
|
264 |
+
0,
|
265 |
+
100
|
266 |
],
|
267 |
+
"param_name": [
|
268 |
+
"quality_lower",
|
269 |
+
"quality_upper"
|
270 |
+
],
|
271 |
+
"type": "min_max"
|
272 |
}
|
273 |
],
|
274 |
+
"InvertImg": [],
|
275 |
"JpegCompression": [
|
276 |
{
|
277 |
+
"defaults_list": [
|
278 |
+
80,
|
279 |
+
100
|
280 |
],
|
|
|
281 |
"limits_list": [
|
282 |
0,
|
283 |
100
|
284 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
"param_name": [
|
286 |
"quality_lower",
|
287 |
"quality_upper"
|
288 |
],
|
289 |
+
"type": "min_max"
|
290 |
+
}
|
291 |
+
],
|
292 |
+
"MedianBlur": [
|
293 |
+
{
|
294 |
+
"defaults": [
|
295 |
+
3,
|
296 |
+
7
|
297 |
+
],
|
298 |
"limits_list": [
|
299 |
+
3,
|
300 |
100
|
301 |
],
|
302 |
+
"param_name": "blur_limit",
|
303 |
+
"type": "int_interval"
|
|
|
|
|
304 |
}
|
305 |
],
|
306 |
+
"MotionBlur": [
|
307 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
"defaults": [
|
309 |
+
3,
|
310 |
+
7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
],
|
312 |
"limits_list": [
|
313 |
+
3,
|
314 |
+
100
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
],
|
316 |
+
"param_name": "blur_limit",
|
317 |
+
"type": "int_interval"
|
|
|
|
|
318 |
}
|
319 |
],
|
320 |
+
"RGBShift": [
|
321 |
{
|
322 |
+
"defaults": [
|
323 |
+
-20,
|
324 |
+
20
|
325 |
+
],
|
326 |
"limits_list": [
|
327 |
+
-255,
|
328 |
+
255
|
329 |
],
|
330 |
+
"param_name": "r_shift_limit",
|
331 |
+
"type": "int_interval"
|
332 |
},
|
333 |
{
|
334 |
+
"defaults": [
|
335 |
+
-20,
|
336 |
+
20
|
337 |
+
],
|
338 |
"limits_list": [
|
339 |
+
-255,
|
340 |
+
255
|
341 |
],
|
342 |
+
"param_name": "g_shift_limit",
|
343 |
+
"type": "int_interval"
|
344 |
},
|
345 |
{
|
346 |
+
"defaults": [
|
347 |
+
-20,
|
348 |
+
20
|
349 |
+
],
|
350 |
"limits_list": [
|
351 |
+
-255,
|
352 |
+
255
|
353 |
],
|
354 |
+
"param_name": "b_shift_limit",
|
355 |
+
"type": "int_interval"
|
|
|
|
|
|
|
356 |
}
|
357 |
],
|
358 |
+
"RandomBrightness": [
|
359 |
{
|
360 |
+
"defaults": [
|
361 |
+
-0.2,
|
362 |
+
0.2
|
363 |
],
|
|
|
364 |
"limits_list": [
|
365 |
+
-1.0,
|
366 |
1.0
|
367 |
],
|
368 |
+
"param_name": "limit",
|
369 |
+
"type": "int_interval"
|
370 |
+
}
|
371 |
+
],
|
372 |
+
"RandomContrast": [
|
373 |
{
|
374 |
+
"defaults": [
|
375 |
+
-0.2,
|
376 |
+
0.2
|
377 |
+
],
|
378 |
"limits_list": [
|
379 |
+
-1.0,
|
380 |
+
1.0
|
381 |
],
|
382 |
+
"param_name": "limit",
|
383 |
+
"type": "int_interval"
|
384 |
}
|
|
|
385 |
],
|
386 |
"RandomFog": [
|
387 |
{
|
388 |
+
"defaults_list": [
|
389 |
+
0.1,
|
390 |
+
0.2
|
391 |
],
|
|
|
392 |
"limits_list": [
|
393 |
0.0,
|
394 |
1.0
|
395 |
],
|
396 |
+
"param_name": [
|
397 |
+
"fog_coef_lower",
|
398 |
+
"fog_coef_upper"
|
399 |
+
],
|
400 |
+
"type": "min_max"
|
401 |
},
|
402 |
{
|
403 |
+
"defaults": 0.08,
|
|
|
404 |
"limits_list": [
|
405 |
0.0,
|
406 |
1.0
|
407 |
],
|
408 |
+
"param_name": "alpha_coef",
|
409 |
+
"type": "int_interval"
|
410 |
}
|
411 |
],
|
412 |
+
"RandomGridShuffle": [
|
413 |
{
|
414 |
+
"defaults_list": [
|
415 |
+
3,
|
|
|
|
|
416 |
3
|
417 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
418 |
"limits_list": [
|
419 |
+
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
1,
|
421 |
+
10
|
422 |
],
|
423 |
+
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
424 |
1,
|
425 |
+
10
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
426 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
],
|
428 |
+
"param_name": "grid",
|
429 |
+
"subparam_names": [
|
430 |
+
"height",
|
431 |
+
"width"
|
432 |
+
],
|
433 |
+
"type": "several_ints"
|
|
|
|
|
|
|
|
|
|
|
|
|
434 |
}
|
435 |
],
|
436 |
"RandomScale": [
|
437 |
{
|
438 |
+
"defaults": [
|
439 |
+
-0.1,
|
440 |
+
0.1
|
441 |
+
],
|
442 |
"limits_list": [
|
443 |
-0.9,
|
444 |
2.0
|
445 |
],
|
446 |
+
"param_name": "scale_limit",
|
447 |
+
"type": "int_interval"
|
|
|
|
|
448 |
},
|
449 |
{
|
|
|
|
|
450 |
"options_list": [
|
451 |
0,
|
452 |
1,
|
453 |
2,
|
454 |
3,
|
455 |
4
|
456 |
+
],
|
457 |
+
"param_name": "interpolation",
|
458 |
+
"type": "radio"
|
459 |
+
}
|
460 |
+
],
|
461 |
+
"RandomSnow": [
|
462 |
+
{
|
463 |
+
"defaults_list": [
|
464 |
+
0.1,
|
465 |
+
0.2
|
466 |
+
],
|
467 |
+
"limits_list": [
|
468 |
+
0.0,
|
469 |
+
1.0
|
470 |
+
],
|
471 |
+
"param_name": [
|
472 |
+
"snow_point_lower",
|
473 |
+
"snow_point_upper"
|
474 |
+
],
|
475 |
+
"type": "min_max"
|
476 |
+
},
|
477 |
+
{
|
478 |
+
"defaults": 2.5,
|
479 |
+
"limits_list": [
|
480 |
+
0.0,
|
481 |
+
5.0
|
482 |
+
],
|
483 |
+
"param_name": "brightness_coeff",
|
484 |
+
"type": "int_interval"
|
485 |
+
}
|
486 |
+
],
|
487 |
+
"Solarize": [
|
488 |
+
{
|
489 |
+
"defaults": 128,
|
490 |
+
"limits_list": [
|
491 |
+
0,
|
492 |
+
255
|
493 |
+
],
|
494 |
+
"param_name": "threshold",
|
495 |
+
"type": "int_interval"
|
496 |
}
|
497 |
+
],
|
498 |
+
"ToGray": [],
|
499 |
+
"ToSepia": [],
|
500 |
+
"Transpose": [],
|
501 |
+
"VerticalFlip": []
|
502 |
+
}
|
run.sh
CHANGED
@@ -1 +1 @@
|
|
1 |
-
streamlit run src/app.py
|
|
|
1 |
+
streamlit run src/app.py
|
setup.sh
CHANGED
@@ -10,4 +10,4 @@ echo "\
|
|
10 |
headless = true\n\
|
11 |
enableCORS=false\n\
|
12 |
port = $PORT\n\
|
13 |
-
" > ~/.streamlit/config.toml
|
|
|
10 |
headless = true\n\
|
11 |
enableCORS=false\n\
|
12 |
port = $PORT\n\
|
13 |
+
" > ~/.streamlit/config.toml
|
src/app.py
CHANGED
@@ -48,12 +48,8 @@ augmented_image = transform(image=image)["image"]
|
|
48 |
width_original = 400
|
49 |
width_transformed = int(width_original / image.shape[1] * augmented_image.shape[1])
|
50 |
|
51 |
-
st.image(
|
52 |
-
|
53 |
-
)
|
54 |
-
st.image(
|
55 |
-
augmented_image, caption="Transformed image", width=width_transformed,
|
56 |
-
)
|
57 |
|
58 |
# print additional info
|
59 |
st.code(str(transform))
|
|
|
48 |
width_original = 400
|
49 |
width_transformed = int(width_original / image.shape[1] * augmented_image.shape[1])
|
50 |
|
51 |
+
st.image(image, caption="Original image", width=width_original)
|
52 |
+
st.image(augmented_image, caption="Transformed image", width=width_transformed)
|
|
|
|
|
|
|
|
|
53 |
|
54 |
# print additional info
|
55 |
st.code(str(transform))
|
src/utils.py
CHANGED
@@ -10,7 +10,7 @@ def load_image(
|
|
10 |
image_name: str, path_to_folder: str = "../images", bgr2rgb: bool = True
|
11 |
):
|
12 |
path_to_image = os.path.join(path_to_folder, image_name)
|
13 |
-
image = cv2.imread(path_to_image
|
14 |
if bgr2rgb:
|
15 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
16 |
return image
|
|
|
10 |
image_name: str, path_to_folder: str = "../images", bgr2rgb: bool = True
|
11 |
):
|
12 |
path_to_image = os.path.join(path_to_folder, image_name)
|
13 |
+
image = cv2.imread(path_to_image)
|
14 |
if bgr2rgb:
|
15 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
16 |
return image
|
src/visuals.py
CHANGED
@@ -35,13 +35,22 @@ def show_credentials():
|
|
35 |
st.markdown("* * *")
|
36 |
st.subheader("Credentials:")
|
37 |
st.markdown(
|
38 |
-
|
|
|
|
|
|
|
39 |
)
|
40 |
st.markdown(
|
41 |
-
|
|
|
|
|
|
|
42 |
)
|
43 |
st.markdown(
|
44 |
-
|
|
|
|
|
|
|
45 |
)
|
46 |
|
47 |
|
|
|
35 |
st.markdown("* * *")
|
36 |
st.subheader("Credentials:")
|
37 |
st.markdown(
|
38 |
+
(
|
39 |
+
"Source: [github.com/IliaLarchenko/albumentations-demo]"
|
40 |
+
"(https://github.com/IliaLarchenko/albumentations-demo)"
|
41 |
+
)
|
42 |
)
|
43 |
st.markdown(
|
44 |
+
(
|
45 |
+
"Albumentations library: [github.com/albumentations-team/albumentations]"
|
46 |
+
"(https://github.com/albumentations-team/albumentations)"
|
47 |
+
)
|
48 |
)
|
49 |
st.markdown(
|
50 |
+
(
|
51 |
+
"Image Source: [pexels.com/royalty-free-images]"
|
52 |
+
"(https://pexels.com/royalty-free-images/)"
|
53 |
+
)
|
54 |
)
|
55 |
|
56 |
|