-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd.py
More file actions
27 lines (24 loc) · 779 Bytes
/
Copy pathd.py
File metadata and controls
27 lines (24 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from utils import load_checkpoint, save_checkpoint, get_loaders
from dataset import create_io_pairs, Brain_Segmentation_Dataset
import torchvision.transforms as Transforms
if __name__ == '__main__':
import requests
path = "D:/U-Net/unet/data/kaggle_3m"
pairs = create_io_pairs(path)
transforms = Transforms.Compose(
[
Transforms.Normalize(
mean=[0.0, 0.0, 0.0],
std=[1.0, 1.0, 1.0]
)
],
)
dataset = Brain_Segmentation_Dataset(pairs, transforms)
item = dataset.__getitem__(2)
data = {
'data': item[0].numpy().tolist()
}
url = 'https://brain-segmap-app.herokuapp.com/predict'
r = requests.post(url, json=data)
r.text.strip()
print(r.text.strip())