add helpers

This commit is contained in:
matixezor 2021-05-31 23:16:29 +02:00
parent c06f92f86d
commit dc63ed15bf

View File

@ -0,0 +1,24 @@
import os
from torchvision.transforms import transforms
main_path = os.path.dirname(os.path.abspath(__file__))
img_main_path = os.path.dirname(main_path)
for i in range(2):
img_main_path = os.path.dirname(img_main_path)
img_main_path = os.path.join(img_main_path, 'images/learning')
train_path = os.path.join(img_main_path, 'training')
test_path = os.path.join(img_main_path, 'test')
prediction_path = os.path.join(img_main_path, 'prediction')
transformer = transforms.Compose([
transforms.Resize((150, 150)),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize([0.5, 0.5, 0.5],
[0.5, 0.5, 0.5])
])