ethanmb commited on
Commit
611d359
1 Parent(s): 0299e88

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -4,11 +4,14 @@ import gradio as gr
4
  learn = load_learner('model.pkl')
5
  categories = ('chickenpox', 'cowpox', 'healthy', 'measles', 'monkeypox', 'smallpox')
6
  examples = ['ch_0001.jpg', 'co_0001.jpg', 'he_0001.jpg', 'mo_0001.jpg', 'sm_0001.jpg']
 
 
 
7
  labels = learn.dls.vocab
8
  def predict(img):
9
  img = PILImage.create(img)
10
  pred,pred_idx,probs = learn.predict(img)
11
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
12
 
13
- gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=3), examples=examples).launch(share=True)
14
 
 
4
  learn = load_learner('model.pkl')
5
  categories = ('chickenpox', 'cowpox', 'healthy', 'measles', 'monkeypox', 'smallpox')
6
  examples = ['ch_0001.jpg', 'co_0001.jpg', 'he_0001.jpg', 'mo_0001.jpg', 'sm_0001.jpg']
7
+ title = "Monkeypox Classifier (NOT MEDICAL ADVICE)"
8
+ description = "A transfer learning model using resnet 50 to classify Monkeypox/Smallpox/Cowpox/Chickenpox/Measles detection model (NOT MEDICAL ADVICE) using https://www.kaggle.com/datasets/arafathussain/monkeypox-skin-image-dataset-2022 dataset, @article{islam2022aweb, title={A Web-scraped Skin Image Database of Monkeypox, Chickenpox, Smallpox, Cowpox, and Measles}, author={Islam, Towhidul and Hussain, Mohammad Arafat and Chowdhury, Forhad Uddin Hasan and Islam, B M Riazul}, journal={bioRxiv 2022.08.01.502199}, doi {https://doi.org/10.1101/2022.08.01.502199}, year={2022} }"
9
+
10
  labels = learn.dls.vocab
11
  def predict(img):
12
  img = PILImage.create(img)
13
  pred,pred_idx,probs = learn.predict(img)
14
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
15
 
16
+ gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=3), examples=examples, title=title, description=description).launch(share=True)
17