Spaces:
Runtime error
Runtime error
shivambhosale
commited on
Commit
·
56b0939
1
Parent(s):
e913bcc
Update UNet.py
Browse files
UNet.py
CHANGED
@@ -1,3 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
height, width = 256, 256
|
2 |
class Block(Module):
|
3 |
def __init__(self, inChannels, outChannels):
|
|
|
1 |
+
import torch # ; print('Using torch version -', torch.__version__)
|
2 |
+
if torch.cuda.is_available():
|
3 |
+
device = 'cuda'
|
4 |
+
else:
|
5 |
+
device = 'cpu'
|
6 |
+
from torch.nn import Module, Conv2d, ReLU, ModuleList, MaxPool2d, ConvTranspose2d, BCELoss, BCEWithLogitsLoss, functional as F
|
7 |
+
from torch.optim import Adam
|
8 |
+
from torchvision import transforms
|
9 |
+
from torchvision.transforms import CenterCrop
|
10 |
+
from torch.utils.data import Dataset, DataLoader
|
11 |
+
import cv2
|
12 |
+
|
13 |
height, width = 256, 256
|
14 |
class Block(Module):
|
15 |
def __init__(self, inChannels, outChannels):
|