Ethium commited on
Commit
ab0e1ba
1 Parent(s): 4ec77fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -1,6 +1,17 @@
1
  from fastai.vision.all import *
2
  import gradio as gr
3
 
 
 
 
 
 
 
 
 
 
 
 
4
  learn = load_learner('your_model.pkl')
5
 
6
  categories = ('Glaucoma Present','Glaucoma Absent')
 
1
  from fastai.vision.all import *
2
  import gradio as gr
3
 
4
+ def get_x(row, is_test=False):
5
+ image_path = path_image_combined / (row['id_code'])
6
+ transformed_image = custom_transform(image_path)
7
+
8
+ # Check the label of the current image and apply augmentations if it belongs to the minority class
9
+ if not is_test and row['label'] == 1:
10
+ transformed_image = additional_augmentations(transformed_image)
11
+
12
+ return Image.fromarray(transformed_image)
13
+ pass
14
+
15
  learn = load_learner('your_model.pkl')
16
 
17
  categories = ('Glaucoma Present','Glaucoma Absent')