Ethium commited on
Commit
0cc5da8
1 Parent(s): e0498ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -1,11 +1,13 @@
1
  from fastai.vision.all import *
2
  import gradio as gr
3
 
4
- # Load your models here. Example:
5
- # models = {'Ultrasound': load_learner('path_to_ultrasound_model.pkl'),
6
- # 'OCT': load_learner('path_to_oct_model.pkl'),
7
- # 'Fundus': load_learner('path_to_fundus_model.pkl'),
8
- # 'Fluorescence': load_learner('path_to_fluorescence_model.pkl')}
 
 
9
 
10
  modality_keys = ['Ultrasound', 'OCT', 'Fundus', 'Fluorescence']
11
 
@@ -13,7 +15,7 @@ def classify_images(img_ultrasound, img_oct, img_fundus, img_fluorescence):
13
  imgs = [img_ultrasound, img_oct, img_fundus, img_fluorescence]
14
  predictions = []
15
 
16
- # Convert images to PILImage and Predict with each model
17
  for img, key in zip(imgs, modality_keys):
18
  pil_img = PILImage.create(img)
19
  pred, _, _ = models[key].predict(pil_img)
 
1
  from fastai.vision.all import *
2
  import gradio as gr
3
 
4
+ # Load the models into a dictionary
5
+ models = {
6
+ 'Ultrasound': load_learner('ODDUltrasound.pkl'),
7
+ 'OCT': load_learner('ODDOCT.pkl'),
8
+ 'Fundus': load_learner('ODDfundus.pkl'),
9
+ 'Fluorescence': load_learner('ODDfluorescence.pkl')
10
+ }
11
 
12
  modality_keys = ['Ultrasound', 'OCT', 'Fundus', 'Fluorescence']
13
 
 
15
  imgs = [img_ultrasound, img_oct, img_fundus, img_fluorescence]
16
  predictions = []
17
 
18
+ # Convert images to PILImage and predict with each model
19
  for img, key in zip(imgs, modality_keys):
20
  pil_img = PILImage.create(img)
21
  pred, _, _ = models[key].predict(pil_img)