Spaces:
Runtime error
Runtime error
Create new file
Browse files
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
classifier = pipeline("image-classification",
|
| 5 |
+
model="microsoft/cvt-13")
|
| 6 |
+
|
| 7 |
+
def main():
|
| 8 |
+
st.title("image-classification")
|
| 9 |
+
|
| 10 |
+
with st.form("image-classification"):
|
| 11 |
+
text = st.text_area('enter link image:')
|
| 12 |
+
# clicked==True only when the button is clicked
|
| 13 |
+
clicked = st.form_submit_button("Submit")
|
| 14 |
+
if clicked:
|
| 15 |
+
results = classifier([text])
|
| 16 |
+
st.(results)
|