Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -121,14 +121,14 @@ def get_y_fn (x):
|
|
121 |
return Path(str(x).replace("Images","Labels").replace("color","gt").replace(".jpg",".png"))
|
122 |
|
123 |
learn = from_pretrained_fastai("islasher/segm-grapes")
|
124 |
-
|
125 |
def transform_image(image):
|
126 |
my_transforms = transforms.Compose([transforms.ToTensor(),
|
127 |
transforms.Normalize(
|
128 |
[0.485, 0.456, 0.406],
|
129 |
[0.229, 0.224, 0.225])])
|
130 |
image_aux = image
|
131 |
-
return my_transforms(image_aux).unsqueeze(0)
|
132 |
|
133 |
|
134 |
|
|
|
121 |
return Path(str(x).replace("Images","Labels").replace("color","gt").replace(".jpg",".png"))
|
122 |
|
123 |
learn = from_pretrained_fastai("islasher/segm-grapes")
|
124 |
+
#device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
125 |
def transform_image(image):
|
126 |
my_transforms = transforms.Compose([transforms.ToTensor(),
|
127 |
transforms.Normalize(
|
128 |
[0.485, 0.456, 0.406],
|
129 |
[0.229, 0.224, 0.225])])
|
130 |
image_aux = image
|
131 |
+
return my_transforms(image_aux).unsqueeze(0)#.to(device)
|
132 |
|
133 |
|
134 |
|