diff --git a/.gitattributes b/.gitattributes index 2803c07..6582d0b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,5 @@ *.webm filter=lfs diff=lfs merge=lfs -text *.jpg filter=lfs diff=lfs merge=lfs -text *.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text diff --git a/docs/mid-project.odp b/docs/mid-project.odp new file mode 100644 index 0000000..c2e4eab Binary files /dev/null and b/docs/mid-project.odp differ diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/autophotographer/dataset.py b/src/autophotographer/dataset.py index 5114978..f26e52c 100644 --- a/src/autophotographer/dataset.py +++ b/src/autophotographer/dataset.py @@ -8,7 +8,7 @@ import numpy as np from sklearn.model_selection import train_test_split import cv2 from pathlib import Path -import config +from . import config from torchvision import transforms import torch from torch.utils.data import DataLoader diff --git a/src/autophotographer/model.py b/src/autophotographer/model.py index 1824fc4..53794e5 100644 --- a/src/autophotographer/model.py +++ b/src/autophotographer/model.py @@ -71,7 +71,7 @@ model.fc = nn.Linear(modelOutputFeatures, 1) model = model.to(config.DEVICE) # initialize loss function and optimizer -lossFunction = nn.L1Loss() +lossFunction = nn.L1Loss() # mean absolute error optimizer = torch.optim.Adam(model.fc.parameters(), lr=config.LR) diff --git a/src/output/21-03-2022/model.pth b/src/output/21-03-2022/model.pth new file mode 100644 index 0000000..8ddc489 --- /dev/null +++ b/src/output/21-03-2022/model.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87b34729f1394caaf71f3264087063180b639b8c4177df440447557762a6ace3 +size 94375425 diff --git a/src/output/21-03-2022/plot.png b/src/output/21-03-2022/plot.png new file mode 100644 index 0000000..fdbfa39 --- /dev/null +++ b/src/output/21-03-2022/plot.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72405c4fbd139e5018cdacdcd5edf614d2d418ef3313d6e5c1e9fb659be8a5b4 +size 37653 diff --git a/src/output/22-03-2022/model.pth b/src/output/22-03-2022/model.pth new file mode 100644 index 0000000..97cfe87 --- /dev/null +++ b/src/output/22-03-2022/model.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be062cf212cfbbb20386e705b48340885b468872bd8b81c3ce11c7eb3a3efe62 +size 94375425 diff --git a/src/output/22-03-2022/plot.png b/src/output/22-03-2022/plot.png new file mode 100644 index 0000000..1002b80 --- /dev/null +++ b/src/output/22-03-2022/plot.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91959decf7d6a2a7dec7c4f6b99eea7a4d8ef8dd504b290e516024b48d171e64 +size 33199 diff --git a/src/output/22-03-2022/slurm-3608.out b/src/output/22-03-2022/slurm-3608.out new file mode 100644 index 0000000..29e16b7 --- /dev/null +++ b/src/output/22-03-2022/slurm-3608.out @@ -0,0 +1,4007 @@ +/home/osp1/mmp-osp1 +Project root: /home/osp1/mmp-osp1 +Using cuda... +Getting dataloaders... +Starting training... + 0%| | 0/2000 [00:00 gtRating: + percentage = round(((pred/gtRating) - 1) * 100, 5) + diff = "+" + str(percentage) + else: + percentage = round(((gtRating/pred) - 1) * 100, 5) + diff = "-" + str(percentage) + # add the results and image to the plot + info = "Ground Truth: {}, Predicted: {}, Diff: {}%".format(gtRating, + pred, diff) + plt.imshow(image) + plt.title(info) + plt.axis("off") + # show the plot + plt.tight_layout() + date = datetime.datetime.now() + dateString = str(date.year) + "-" + str(date.month) + "-" + str(date.day) + "_" + str(date.hour) + "-" + str(date.minute) + "-" + str(date.second) + PLOT_PATH = os.path.join(PLOT_PATH, "predict-plot-" + dateString + ".png") + plt.savefig(PLOT_PATH) + plt.show()