Pavani2704 commited on
Commit
6e98be9
1 Parent(s): c7eaac7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -1,15 +1,16 @@
1
  import streamlit as st
2
-
3
  import transformers
4
- # Use a pipeline as a high-level helper
5
  from transformers import pipeline
 
 
6
 
7
  pipe = pipeline("summarization", model="google/pegasus-xsum")
 
8
 
9
  st.title("NLP APP")
10
  option = st.sidebar.selectbox(
11
  "Choose a task",
12
- ("Summarization", "Translation", "Emotion Detection", "Image Generation")
13
  )
14
  if option == "Summarization":
15
  st.title("Text Summarization")
@@ -19,6 +20,14 @@ if option == "Summarization":
19
  st.write("Summary:", pipe(text)[0]["summary_text"])
20
  else:
21
  st.write("Please enter text to summarize.")
 
 
 
 
 
 
 
 
22
 
23
  else:
24
  st.title("None")
 
1
  import streamlit as st
 
2
  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")
9
 
10
  st.title("NLP APP")
11
  option = st.sidebar.selectbox(
12
  "Choose a task",
13
+ ("Summarization", "Age Detection", "Emotion Detection", "Image Generation")
14
  )
15
  if option == "Summarization":
16
  st.title("Text Summarization")
 
20
  st.write("Summary:", pipe(text)[0]["summary_text"])
21
  else:
22
  st.write("Please enter text to summarize.")
23
+ elif option == "Age Detection"
24
+ st.title("welcome to age detection app")
25
+
26
+ uploaded_files = st.file_uploader("Choose a image file",type="jpg")
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")