Pavani2704 commited on
Commit
6110da3
·
verified ·
1 Parent(s): 400ddf8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -3,6 +3,7 @@ import transformers
3
  from transformers import pipeline
4
  import PIL
5
  from PIL import Image
 
6
 
7
  pipe = pipeline("summarization", model="google/pegasus-xsum")
8
  agepipe = pipeline("image-classification", model="dima806/facial_age_image_detection")
@@ -12,7 +13,7 @@ imgpipe = pipeline("zero-shot-image-classification", model="google/siglip-so400m
12
  st.title("NLP APP")
13
  option = st.sidebar.selectbox(
14
  "Choose a task",
15
- ("Summarization", "Age Detection", "Emotion Detection", "Object Detection")
16
  )
17
  if option == "Summarization":
18
  st.title("Text Summarization")
@@ -31,7 +32,7 @@ elif option == "Age Detection":
31
  Image=Image.open(uploaded_files)
32
 
33
  st.write(agepipe(Image)[0]["label"])
34
- elif option == "Object Detection":
35
  st.title("Welcome to object detection")
36
 
37
  uploaded_files = st.file_uploader("Choose a image file",type=["jpg","jpeg"])
 
3
  from transformers import pipeline
4
  import PIL
5
  from PIL import Image
6
+ import requests
7
 
8
  pipe = pipeline("summarization", model="google/pegasus-xsum")
9
  agepipe = pipeline("image-classification", model="dima806/facial_age_image_detection")
 
13
  st.title("NLP APP")
14
  option = st.sidebar.selectbox(
15
  "Choose a task",
16
+ ("Summarization", "Age Detection", "Emotion Detection", "Image Classification")
17
  )
18
  if option == "Summarization":
19
  st.title("Text Summarization")
 
32
  Image=Image.open(uploaded_files)
33
 
34
  st.write(agepipe(Image)[0]["label"])
35
+ elif option == "Image Classification":
36
  st.title("Welcome to object detection")
37
 
38
  uploaded_files = st.file_uploader("Choose a image file",type=["jpg","jpeg"])