jhoppanne commited on
Commit
437d7d5
·
verified ·
1 Parent(s): 011ac7a

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. .ipynb_checkpoints/main-checkpoint.py +5 -2
  2. main.py +5 -2
.ipynb_checkpoints/main-checkpoint.py CHANGED
@@ -5,8 +5,11 @@ pipeline = pipeline("image-classification", model="jhoppanne/SkinCancerClassifie
5
 
6
  def predict(input_img):
7
  pred = pipeline(input_img)
8
- label = ['Benign','Indeterminate','Malignant']
9
- answer = f'We predict that you have {label[pred['label']]} type of skin cancer,\n with confidence score of: {pred['score']*100:.2f}%'
 
 
 
10
  return answer
11
 
12
  gradio_app = gr.Interface(
 
5
 
6
  def predict(input_img):
7
  pred = pipeline(input_img)
8
+ labels = ['Benign','Indeterminate','Malignant']
9
+ label_id = int(pred[0]['label'])
10
+ label = labels[label_id]
11
+ score = pred[0]['score']
12
+ answer = f'We predict that you have {label} type of skin cancer,\nwith confidence score of : {score*100:.2f}%'
13
  return answer
14
 
15
  gradio_app = gr.Interface(
main.py CHANGED
@@ -5,8 +5,11 @@ pipeline = pipeline("image-classification", model="jhoppanne/SkinCancerClassifie
5
 
6
  def predict(input_img):
7
  pred = pipeline(input_img)
8
- label = ['Benign','Indeterminate','Malignant']
9
- answer = f'We predict that you have {label[pred['label']]} type of skin cancer,\n with confidence score of: {pred['score']*100:.2f}%'
 
 
 
10
  return answer
11
 
12
  gradio_app = gr.Interface(
 
5
 
6
  def predict(input_img):
7
  pred = pipeline(input_img)
8
+ labels = ['Benign','Indeterminate','Malignant']
9
+ label_id = int(pred[0]['label'])
10
+ label = labels[label_id]
11
+ score = pred[0]['score']
12
+ answer = f'We predict that you have {label} type of skin cancer,\nwith confidence score of : {score*100:.2f}%'
13
  return answer
14
 
15
  gradio_app = gr.Interface(