DHEIVER commited on
Commit
7d6d161
1 Parent(s): 5bfcea9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -54
app.py CHANGED
@@ -1,57 +1,4 @@
1
  import gradio as gr
2
 
3
  # Carregar o modelo
4
- model = gr.Interface.load("models/Devarshi/Brain_Tumor_Detector_swin")
5
-
6
- # Definir metadados
7
- metadata = {
8
- "name": "Detector de Tumor Cerebral Devarshi-swin",
9
- "description": "Este modelo é uma versão refinada do microsoft/swin-base-patch4-window7-224-in22k treinado para detecção de tumores cerebrais.",
10
- "license": "Informativo",
11
- "version": "1.0",
12
- "author": "Devarshi",
13
- "performance_metrics": {
14
- "accuracy": "Precisão: 99.81%",
15
- "f1_score": "F1 Score: 99.85%",
16
- "recall": "Recall: 99.90%",
17
- "precision": "Precisão: 99.80%",
18
- },
19
- "training_info": {
20
- "hyperparameters": {
21
- "learning_rate": "5e-05",
22
- "batch_size": "32",
23
- "evaluation_batch_size": "32",
24
- "seed": "42",
25
- "gradient_accumulation_steps": "4",
26
- "total_train_batch_size": "128",
27
- "optimizer": "Adam (betas=(0.9, 0.999), epsilon=1e-08)",
28
- "learning_rate_scheduler_type": "linear",
29
- "warmup_ratio": "0.1",
30
- "num_epochs": "3",
31
- }
32
- }
33
- }
34
-
35
- # Definir a função que exibirá as informações
36
- def display_info():
37
- return gr.Column([
38
- gr.Text(metadata["name"]),
39
- gr.Text(metadata["description"]),
40
- gr.Text(metadata["license"]),
41
- gr.Text(metadata["version"]),
42
- gr.Text(metadata["author"]),
43
- gr.Text(metadata["performance_metrics"]["accuracy"]),
44
- gr.Text(metadata["performance_metrics"]["f1_score"]),
45
- gr.Text(metadata["performance_metrics"]["recall"]),
46
- gr.Text(metadata["performance_metrics"]["precision"]),
47
- gr.Text("Informações de Treinamento:"),
48
- gr.Text(f"Taxa de Aprendizado: {metadata['training_info']['hyperparameters']['learning_rate']}"),
49
- gr.Text(f"Tamanho do Lote de Treinamento: {metadata['training_info']['hyperparameters']['batch_size']}"),
50
- # Adicione mais informações de treinamento aqui conforme necessário
51
- ])
52
-
53
- # Adicione a função à interface
54
- model.interface.layout("vertical").extra(display_info)
55
-
56
- # Lançar a interface Gradio
57
- model.launch()
 
1
  import gradio as gr
2
 
3
  # Carregar o modelo
4
+ model = gr.Interface.load("models/Devarshi/Brain_Tumor_Detector_swin")