DHEIVER commited on
Commit
494dc44
1 Parent(s): 2c892a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -15,17 +15,17 @@ os.mkdir("outputs/images")
15
  config_file_url = hf_hub_url("AUBMC-AIM/MammoGANesis", filename="mammoGANesis.pkl")
16
  cached_file = cached_download(config_file_url)
17
 
18
- def inference(truncation,seeds):
19
- os.system("python generate.py --outdir=./outputs/images/ --trunc="+str(truncation)+" --seeds="+str(int(seeds))+" --network="+cached_file)
20
  seeds = int(seeds)
21
  image = Image.open(f"./outputs/images/seed{seeds:04d}.png")
22
  return image
23
 
24
  title = "MammoGANesis"
25
- description = "Gradio demo for MammoGANesis: Controlled Generation of High-Resolution Mammograms for Radiology Education. This paper demonstrates the model’s ability to generate anatomically and medically relevant mammograms by achieving an average AUC of 0.54 in a double-blind study on four expert mammography radiologists to distinguish between generated and real images, ascribing to the high visual quality of the synthesized and edited mammograms, and to their potential use in advancing and facilitating medical education. To use it, add seed and truncation, or click one of the examples to load them. Read more at the links below."
26
 
27
- article = "<p style='text-align: center'><a href='https://cyrilzakka.github.io/radiology/2020/10/13/mammogenesis.html' target='_blank'>MammoGANesis: Controlled Generation of High-Resolution Mammograms for Radiology Education</a><center></a></center></p><center><img src='https://visitor-badge.glitch.me/badge?page_id=akhaliq_mammogan' alt='visitor badge'></center>"
28
 
29
- gr.Interface(inference, [gr.inputs.Slider(label="truncation", minimum=0, maximum=5, step=0.1, default=0.8),
30
- gr.inputs.Slider(label="Seed", minimum=0, maximum=1000, step=1, default=0)],
31
  "pil", title=title, description=description, article=article, examples=[[0.8, 0]]).launch(enable_queue=True)
 
15
  config_file_url = hf_hub_url("AUBMC-AIM/MammoGANesis", filename="mammoGANesis.pkl")
16
  cached_file = cached_download(config_file_url)
17
 
18
+ def inference(truncation, seeds):
19
+ os.system("python generate.py --outdir=./outputs/images/ --trunc=" + str(truncation) + " --seeds=" + str(int(seeds)) + " --network=" + cached_file)
20
  seeds = int(seeds)
21
  image = Image.open(f"./outputs/images/seed{seeds:04d}.png")
22
  return image
23
 
24
  title = "MammoGANesis"
25
+ description = "Demonstração Gradio para o MammoGANesis: Geração Controlada de Mamogramas de Alta Resolução para Educação em Radiologia. Este artigo demonstra a capacidade do modelo de gerar mamogramas anatomicamente e medicamente relevantes, alcançando uma AUC média de 0,54 em um estudo duplo-cego com quatro radiologistas especializados em mamografia para distinguir entre imagens geradas e reais, atribuindo-se à alta qualidade visual dos mamogramas sintetizados e editados, e seu potencial uso no avanço e facilitação da educação médica. Para usá-lo, adicione a semente e a truncagem, ou clique em um dos exemplos para carregá-los. Leia mais nos links abaixo."
26
 
27
+ article = "<p style='text-align: center'><a href='https://cyrilzakka.github.io/radiology/2020/10/13/mammogenesis.html' target='_blank'>MammoGANesis: Geração Controlada de Mamogramas de Alta Resolução para Educação em Radiologia</a><center></a></center></p><center><img src='https://visitor-badge.glitch.me/badge?page_id=akhaliq_mammogan' alt='visitor badge'></center>"
28
 
29
+ gr.Interface(inference, [gr.inputs.Slider(label="Truncagem", minimum=0, maximum=5, step=0.1, default=0.8),
30
+ gr.inputs.Slider(label="Semente", minimum=0, maximum=1000, step=1, default=0)],
31
  "pil", title=title, description=description, article=article, examples=[[0.8, 0]]).launch(enable_queue=True)