Spaces:
Running
Running
bigmed@bigmed commited on
Commit ·
33ad8cf
1
Parent(s): 4f80204
:/
Browse files- app.py +1 -2
- pipline.py +1 -1
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import torch
|
| 2 |
import torchvision.transforms as transforms
|
| 3 |
from torch.nn import functional as F
|
|
@@ -5,7 +6,6 @@ import cv2
|
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
| 7 |
from PIL import Image
|
| 8 |
-
from pipline import Transformer_Regression, extract_regions_Last , compute_ratios
|
| 9 |
|
| 10 |
|
| 11 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
@@ -122,7 +122,6 @@ def infer(img):
|
|
| 122 |
# img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
| 123 |
|
| 124 |
sample_batch = dict()
|
| 125 |
-
|
| 126 |
sample_batch['image_original'] = img
|
| 127 |
|
| 128 |
im_retina_pil = Image.fromarray(img)
|
|
|
|
| 1 |
+
from pipline import Transformer_Regression, extract_regions_Last , compute_ratios
|
| 2 |
import torch
|
| 3 |
import torchvision.transforms as transforms
|
| 4 |
from torch.nn import functional as F
|
|
|
|
| 6 |
import gradio as gr
|
| 7 |
import numpy as np
|
| 8 |
from PIL import Image
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
|
|
| 122 |
# img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
| 123 |
|
| 124 |
sample_batch = dict()
|
|
|
|
| 125 |
sample_batch['image_original'] = img
|
| 126 |
|
| 127 |
im_retina_pil = Image.fromarray(img)
|
pipline.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
#### This is an implmentation of deeplabv3 plus for retina detection
|
|
|
|
| 2 |
import torch
|
| 3 |
import torchvision
|
| 4 |
from torch.nn import functional as F
|
| 5 |
import torch.nn as nn
|
| 6 |
import numpy as np
|
| 7 |
import cv2
|
| 8 |
-
from skimage.measure import label, regionprops
|
| 9 |
import torch
|
| 10 |
from collections import namedtuple
|
| 11 |
|
|
|
|
| 1 |
#### This is an implmentation of deeplabv3 plus for retina detection
|
| 2 |
+
from skimage.measure import label, regionprops
|
| 3 |
import torch
|
| 4 |
import torchvision
|
| 5 |
from torch.nn import functional as F
|
| 6 |
import torch.nn as nn
|
| 7 |
import numpy as np
|
| 8 |
import cv2
|
|
|
|
| 9 |
import torch
|
| 10 |
from collections import namedtuple
|
| 11 |
|