Abduhoshim commited on
Commit
59df1d0
1 Parent(s): 6936c6c
Files changed (1) hide show
  1. app.pynb +13 -0
app.pynb ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ learn = load_learner('https://drive.google.com/file/d/1mYN7tOaKpv6sgPt6ekSIoceRQijVGviV/view?usp=share_link')
3
+ labels = learn.dls.vocab
4
+ def predict(img):
5
+ img = PILImage.create(img)
6
+ pred,pred_idx,probs = learn.predict(img)
7
+ return {labels[i]: float(probs[i]) for i in range(len(labels))}
8
+
9
+ title = "Damaged Car Classifier"
10
+ description = "This model can identify damaged cars"
11
+
12
+ intf = gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,interpretation='default',enable_queue=True).launch(share=True)
13
+ intf.launch(inline=False)