Pavani2704 commited on
Commit
dfb1734
1 Parent(s): 9b49413

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -6,7 +6,7 @@ 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",
@@ -27,7 +27,17 @@ elif option == "Age Detection":
27
 
28
  if uploaded_files is not None:
29
  Image=Image.open(uploaded_files)
 
30
  st.write(agepipe(Image)[0]["label"])
 
 
 
 
 
 
 
 
 
31
 
32
  else:
33
  st.title("None")
 
6
 
7
  pipe = pipeline("summarization", model="google/pegasus-xsum")
8
  agepipe = pipeline("image-classification", model="dima806/facial_age_image_detection")
9
+ objpipe = pipeline("zero-shot-object-detection", model="google/owlvit-base-patch32")
10
  st.title("NLP APP")
11
  option = st.sidebar.selectbox(
12
  "Choose a task",
 
27
 
28
  if uploaded_files is not None:
29
  Image=Image.open(uploaded_files)
30
+
31
  st.write(agepipe(Image)[0]["label"])
32
+ elif option == "Object Detection":
33
+ st.title("Welcome to object detection")
34
+
35
+ uploaded_files = st.file_uploader("Choose a image file",type="jpg")
36
+
37
+ if uploaded_files is not None:
38
+ Image=Image.open(uploaded_files)
39
+ st.write(objpipe(Image)[0]["label"])
40
+
41
 
42
  else:
43
  st.title("None")