Spaces:
Sleeping
Sleeping
akriel
commited on
Commit
·
59692c9
1
Parent(s):
28dcb99
created space
Browse files- app.py +23 -0
- requirements.txt +1 -0
app.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from PIL import Image
|
| 3 |
+
from vision_models_playground.utility.hub import load_vmp_pipeline_from_hub
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
pipeline = load_vmp_pipeline_from_hub("Akriel/ResNetYoloV1")
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def interface():
|
| 10 |
+
st.title("Image Classification with Streamlit")
|
| 11 |
+
|
| 12 |
+
uploaded_image = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png"])
|
| 13 |
+
if uploaded_image is not None:
|
| 14 |
+
image = Image.open(uploaded_image)
|
| 15 |
+
results = pipeline(image)[0]
|
| 16 |
+
image_with_bboxes = results['image']
|
| 17 |
+
st.image(image_with_bboxes, caption="Uploaded Image", use_column_width=True)
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
if __name__ == "__main__":
|
| 21 |
+
interface()
|
| 22 |
+
|
| 23 |
+
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
vision-models-playground>=0.2.3
|