File size: 1,133 Bytes
b940604
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b38b039
b940604
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from transformers import pipeline
import gradio as gr
import os 

model = pipeline(model = "AhmadHakami/alzheimer-image-classification-google-vit-base-patch16",
                 task  = "image-classification")

model.model.config.id2label = {
0: 'خفيف الخرف (Mild Demented)',
1: 'متوسط الخرف (Moderate Demented)',
2: 'غير مصاب بالخرف (Non Demented)',
3: 'خفيف جداً الخرف (Very Mild Demented)'
}

examples = []
for image in os.listdir("examples"):
    examples.append(f'examples//{image}')


gr.Interface.from_pipeline(model, 
                           title="Tbyan - تِــبْيان Alzheimer MRI Classification",
                           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:**", 
                           examples = examples).launch()