AhmadHakami commited on
Commit
b940604
1 Parent(s): 9f90b60

Add application file

Browse files
app.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+ import os
4
+
5
+ model = pipeline(model = "AhmadHakami/alzheimer-image-classification-google-vit-base-patch16",
6
+ task = "image-classification")
7
+
8
+ model.model.config.id2label = {
9
+ 0: 'خفيف الخرف (Mild Demented)',
10
+ 1: 'متوسط الخرف (Moderate Demented)',
11
+ 2: 'غير مصاب بالخرف (Non Demented)',
12
+ 3: 'خفيف جداً الخرف (Very Mild Demented)'
13
+ }
14
+
15
+ examples = []
16
+ for image in os.listdir("examples"):
17
+ examples.append(f'examples//{image}')
18
+
19
+
20
+ gr.Interface.from_pipeline(model,
21
+ title="Tbyan - تِــبْيان Alzheimer MRI Classification",
22
+ description="This model fine-tuned using [Google Base ViT 16×16 Pitch](google/vit-base-patch16-224-in21k), and trained on credible MRI data from Open Access Series of Imaging Studies (OASIS) and the data annotated by experts, it aims to expedite patient results, developed by Tbyan تبيان Team at AI course by `Misk Foundation & Samsung Innovation Campus`, \n **Try it now:**",
23
+ examples = examples, th).launch()
24
+
25
+
examples/augmented_123_verymild_2182.jpg ADDED
examples/augmented_12_mild_108.jpg ADDED
examples/augmented_130_verymild_320.jpg ADDED
examples/augmented_14_mild_104.jpg ADDED
examples/augmented_4_moderate_27.jpg ADDED
examples/augmented_7_moderate_4.jpg ADDED
examples/non_3146.jpg ADDED
examples/non_3147.jpg ADDED