First of all install update and upgrade your system:
$ sudo apt update
$ sudo apt upgradeThen, install required libraries:
| int main() { | |
| char *path = "/path/to/my/directory"; | |
| print("watching %s for changes...\n", path); | |
| HANDLE file = CreateFile(path, | |
| FILE_LIST_DIRECTORY, | |
| FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, | |
| NULL, | |
| OPEN_EXISTING, | |
| FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, |
| #!/bin/bash | |
| # Copied and modified from https://github.com/Technica-Corporation/Tegra-Docker | |
| # Copyright (c) 2017, Technica Corporation. All rights reserved. | |
| NV_LIBS="/usr/lib/aarch64-linux-gnu \ | |
| /usr/local/cuda/lib64 \ | |
| /usr/local/cuda \ | |
| /usr/src/tensorrt \ | |
| /usr/local/cuda-10.0 \ | |
| /usr/include \ |
| from __future__ import print_function, division | |
| import torch | |
| from torch.autograd import Variable | |
| from sklearn.metrics import accuracy_score | |
| from sklearn.metrics import confusion_matrix | |
| import torch | |
| import torch.nn as nn | |
| import torch.optim as optim | |
| from torch.optim import lr_scheduler |
Install OpenCV 4.1.2 on Raspbian Buster
$ chmod +x *.sh
$ ./download-opencv.sh
$ ./install-deps.sh
$ ./build-opencv.sh
$ cd ~/opencv/opencv-4.1.2/build
$ sudo make install| import torch | |
| from torchvision import datasets | |
| class ImageFolderWithPaths(datasets.ImageFolder): | |
| """Custom dataset that includes image file paths. Extends | |
| torchvision.datasets.ImageFolder | |
| """ | |
| # override the __getitem__ method. this is the method that dataloader calls | |
| def __getitem__(self, index): |