ttcielott commited on
Commit
c2204f7
1 Parent(s): c31ab31

initial upload

Browse files
Files changed (3) hide show
  1. app.py +16 -0
  2. export.pkl +3 -0
  3. requirements.txt +1 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ import streamlit as st
3
+
4
+ def predict(img):
5
+ img = PILImage.create(img)
6
+ pred, pred_idx, probs = learn.predict(img)
7
+ highest_prob = probs.argmax()
8
+ return f'Is this {labels[highest_prob]}?', f'{labels[highest_prob]}_second_color.png'
9
+
10
+ picture = st.camera_input("Take a picture")
11
+
12
+ if picture:
13
+ st.image(picture)
14
+ result, sugg = predict(picture)
15
+ st.write(result)
16
+ st.image(sugg)
export.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03825676ac9575cda43bbda3dd7a045b91d2ae1619aac79bf595b9f51120320c
3
+ size 87507435
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ fastai