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

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. .ipynb_checkpoints/main-checkpoint.py +4 -2
  2. main.py +4 -2
.ipynb_checkpoints/main-checkpoint.py CHANGED
@@ -4,8 +4,10 @@ from transformers import pipeline
4
  pipeline = pipeline("image-classification", model="jhoppanne/SkinCancerClassifier_Plain-V0")
5
 
6
  def predict(input_img):
7
- predictions = pipeline(input_img)
8
- return predictions
 
 
9
 
10
  gradio_app = gr.Interface(
11
  predict,
 
4
  pipeline = pipeline("image-classification", model="jhoppanne/SkinCancerClassifier_Plain-V0")
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(
13
  predict,
main.py CHANGED
@@ -4,8 +4,10 @@ from transformers import pipeline
4
  pipeline = pipeline("image-classification", model="jhoppanne/SkinCancerClassifier_Plain-V0")
5
 
6
  def predict(input_img):
7
- predictions = pipeline(input_img)
8
- return predictions
 
 
9
 
10
  gradio_app = gr.Interface(
11
  predict,
 
4
  pipeline = pipeline("image-classification", model="jhoppanne/SkinCancerClassifier_Plain-V0")
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(
13
  predict,