Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install torch lightning scikit-learn numpy tqdm faissknn | |
import lightning.pytorch as pl | |
import numpy as np | |
import torch | |
from faissknn import FaissKNNClassifier | |
from lightning.pytorch.utilities import rank_zero_only | |
from sklearn.metrics import accuracy_score, f1_score, precision_score, recall_score | |
from tqdm import tqdm | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download test set | |
mkdir -p fair1m/train/part1 | |
mkdir fair1m/train/part2 | |
mkdir fair1m/validation | |
mkdir fair1m/test | |
cd fair1m/train/part1 | |
gdown 1LWT_ybL-s88Lzg9A9wHpj0h2rJHrqrVf # train/part1/images.zip | |
gdown 1CnOuS8oX6T9JMqQnfFsbmf7U38G6Vc8u # train/part1/labelXml.zip | |
cd .. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
import torch.optim as optim | |
import segmentation_models_pytorch as smp | |
from torchmetrics import Accuracy | |
from tqdm import tqdm | |
from torchgeo.datasets import ETCI2021 | |
from torchgeo.datamodules import ETCI2021DataModule |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wsl --shutdown | |
diskpart | |
select vdisk file="C:\Users\<user>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\ext4.vhdx" | |
attach vdisk readonly | |
compact vdisk | |
detach vdisk | |
exit |