-
-
Save amankharwal/50c7fa4d81d436eece4ab5ae62026972 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
learn =cnn_learner(dls, | |
resnet34, | |
metrics = error_rate) | |
learn.fine_tune(1) | |
import ipywidgets as widgets | |
uploader = widgets.FileUpload() | |
uploader | |
def pred(): | |
img = PILImage.create(uploader.data[0]) | |
img.show() | |
#Make Prediction | |
is_cat,_,probs = learn.predict(img) | |
print(f"Image is of a Cat: {is_cat}.") | |
print(f"Probability image is a cat: {probs[1].item():.6f}") | |
pred() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment