mr_shitposter / app.py
nihonium286's picture
Create app.py
e1396a6
raw
history blame
549 Bytes
import streamlit as st
from transformers import ImageClassificationPipeline, PerceiverForImageClassificationConvProcessing, PerceiverFeatureExtractor
import torch
feature_extractor = PerceiverFeatureExtractor.from_pretrained("deepmind/vision-perceiver-conv")
model = PerceiverForImageClassificationConvProcessing.from_pretrained("deepmind/vision-perceiver-conv")
image_pipe = ImageClassificationPipeline(model=model, feature_extractor=feature_extractor)
image = st.file_uploader(type=['jpg','png'])
results = image_pipe(image)
st.write(results)