muchlisinadi
commited on
Commit
•
50321bc
1
Parent(s):
816df96
fix unused import
Browse files
app.py
CHANGED
@@ -2,10 +2,7 @@ from pathlib import Path
|
|
2 |
import torch
|
3 |
from monai.bundle import ConfigParser
|
4 |
import gradio as gr
|
5 |
-
import pickle
|
6 |
-
import torchvision.transforms as T
|
7 |
import numpy as np
|
8 |
-
import random
|
9 |
|
10 |
parser = ConfigParser()
|
11 |
parser.read_config(f="configs/inference.json")
|
@@ -42,10 +39,6 @@ def query_image(img, progress=gr.Progress(track_tqdm=True)):
|
|
42 |
data = {"image": img}
|
43 |
batch = preprocess(data)
|
44 |
|
45 |
-
# with open('filename.pickle', 'rb') as handle:
|
46 |
-
# pred = pickle.load(handle)
|
47 |
-
# batch["pred"] = pred
|
48 |
-
|
49 |
network.eval()
|
50 |
with torch.no_grad():
|
51 |
pred = inference(batch['image'].unsqueeze(dim=0), network)
|
@@ -76,4 +69,4 @@ demo = gr.Interface(
|
|
76 |
examples=example_files
|
77 |
)
|
78 |
|
79 |
-
demo.queue(concurrency_count=20).launch()
|
|
|
2 |
import torch
|
3 |
from monai.bundle import ConfigParser
|
4 |
import gradio as gr
|
|
|
|
|
5 |
import numpy as np
|
|
|
6 |
|
7 |
parser = ConfigParser()
|
8 |
parser.read_config(f="configs/inference.json")
|
|
|
39 |
data = {"image": img}
|
40 |
batch = preprocess(data)
|
41 |
|
|
|
|
|
|
|
|
|
42 |
network.eval()
|
43 |
with torch.no_grad():
|
44 |
pred = inference(batch['image'].unsqueeze(dim=0), network)
|
|
|
69 |
examples=example_files
|
70 |
)
|
71 |
|
72 |
+
demo.queue(concurrency_count=20).launch()
|