forked from ClarityCoders/Fall-Guys-AI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
training.py
36 lines (27 loc) · 754 Bytes
/
training.py
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
import random
import numpy as np
import cv2
import matplotlib.pyplot as plt
import albumentations as A
import pprint
def main():
image = cv2.imread("cuiyan.png")
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
def visualize(image):
plt.figure(figsize=(6, 6))
plt.axis("off")
plt.imshow(image)
# plt.show()
transform = A.Compose(
[
A.RandomCrop(111, 222),
A.OneOf([A.RGBShift(), A.HueSaturationValue()]),
]
)
random.seed(42)
transformed = transform(image=image)
visualize(transformed["image"])
A.save(transform, "./transform.json")
A.save(transform, "./transform.yml", data_format="yaml")
pprint.pprint(A.to_dict(transform))
main()