Spaces:
Sleeping
Sleeping
Pavani2704
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,9 @@ from PIL import Image
|
|
6 |
|
7 |
pipe = pipeline("summarization", model="google/pegasus-xsum")
|
8 |
agepipe = pipeline("image-classification", model="dima806/facial_age_image_detection")
|
9 |
-
|
|
|
|
|
10 |
st.title("NLP APP")
|
11 |
option = st.sidebar.selectbox(
|
12 |
"Choose a task",
|
@@ -33,10 +35,14 @@ elif option == "Object Detection":
|
|
33 |
st.title("Welcome to object detection")
|
34 |
|
35 |
uploaded_files = st.file_uploader("Choose a image file",type=["jpg","jpeg"])
|
36 |
-
|
|
|
37 |
if uploaded_files is not None:
|
38 |
Image=Image.open(uploaded_files)
|
39 |
-
|
|
|
|
|
|
|
40 |
|
41 |
|
42 |
else:
|
|
|
6 |
|
7 |
pipe = pipeline("summarization", model="google/pegasus-xsum")
|
8 |
agepipe = pipeline("image-classification", model="dima806/facial_age_image_detection")
|
9 |
+
imgpipe = pipeline("zero-shot-image-classification", model="google/siglip-so400m-patch14-384")
|
10 |
+
|
11 |
+
|
12 |
st.title("NLP APP")
|
13 |
option = st.sidebar.selectbox(
|
14 |
"Choose a task",
|
|
|
35 |
st.title("Welcome to object detection")
|
36 |
|
37 |
uploaded_files = st.file_uploader("Choose a image file",type=["jpg","jpeg"])
|
38 |
+
text=st.text_area("Enter possible class names(comma separated")
|
39 |
+
candidate_lables=[t.strip() for t in text.split(',')]
|
40 |
if uploaded_files is not None:
|
41 |
Image=Image.open(uploaded_files)
|
42 |
+
|
43 |
+
outputs = imgpipe(uploaded_files,candidate_lables)
|
44 |
+
|
45 |
+
st.write(output["label"])
|
46 |
|
47 |
|
48 |
else:
|