Hrishikesh332 commited on
Commit
42a1798
·
1 Parent(s): d1795ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import streamlit as st
2
  from PIL import Image
 
3
 
4
  def load_image(img):
5
  im=Image.open(img)
@@ -16,4 +17,10 @@ with st.sidebar:
16
 
17
  img = st.file_uploader("Choose a Image:")
18
  if img is not None:
19
- st.write(img)
 
 
 
 
 
 
 
1
  import streamlit as st
2
  from PIL import Image
3
+ from transformers import AutoFeatureExtractor, AutoModelForImageClassification
4
 
5
  def load_image(img):
6
  im=Image.open(img)
 
17
 
18
  img = st.file_uploader("Choose a Image:")
19
  if img is not None:
20
+ st.write(img)
21
+ extractor = AutoFeatureExtractor.from_pretrained("Hrishikesh332/autotrain-meme-classification-42897109437")
22
+ model = AutoModelForImageClassification.from_pretrained("Hrishikesh332/autotrain-meme-classification-42897109437")
23
+ pred=model.predict(img)
24
+ st.code(pred)
25
+
26
+