Download app.py from crossdevlogix/Chicken_liver_classification: direct link, hf CLI and curl.
- Browser
- Download file 656 Bytes
-
https://huggingface.co/spaces/crossdevlogix/Chicken_liver_classification/resolve/main/app.py
- Command line
-
hf download hf://spaces/crossdevlogix/Chicken_liver_classification/app.py
-
curl -L -o app.py https://huggingface.co/spaces/crossdevlogix/Chicken_liver_classification/resolve/main/app.py
656 Bytes
| import gradio as gr | |
| import cv2 | |
| from keras.models import load_model | |
| my_model=load_model('Liver_model.h5',compile=True) | |
| class_num={0:'Healthy',1:'Un-Healthy'} | |
| def Predict(Image): | |
| Image=cv2.resize(Image,(224,224)) | |
| class_no=my_model.predict(Image.reshape(1,224,224,3)).argmax() | |
| class_name=class_num.get(class_no) | |
| return class_name | |
| interface=gr.Interface(fn=Predict,inputs='image',outputs=[gr.components.Textbox(label="Class Name")], | |
| title="This Space predict the liver of Chicken is healthy or un-healthy", | |
| examples=[['Test1.jpg'],['Test2.jpeg'],['Test3.jpeg']]) | |
| interface.launch(debug=True) | |