sarwansingh commited on
Commit
32780dd
1 Parent(s): 4cb6fe1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -8
app.py CHANGED
@@ -1,23 +1,35 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
  from PIL import Image
 
 
4
 
5
- pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
6
 
7
- st.title("AIMLJan24 First App on Hugging face - Hot Dog? Or Not?")
8
-
9
- file_name = st.file_uploader("Upload the test image to find is this hot dog ! ")
10
 
11
  if file_name is not None:
12
  col1, col2 = st.columns(2)
13
 
14
  image = Image.open(file_name)
15
  col1.image(image, use_column_width=True)
16
- predictions = pipeline(image)
17
 
18
- col2.header("Probabilities")
19
- for p in predictions:
20
- col2.subheader(f"{ p['label'] }: { round(p['score'] * 100, 1)}%")
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
 
23
  # # my first app
 
1
  import streamlit as st
2
  from transformers import pipeline
3
  from PIL import Image
4
+ import face_recognition
5
+ import cv2
6
 
7
+ st.title("AIMLJan24 - Face Recognition")
8
 
9
+ file_name = st.camera_input("Take a picture") #st.file_uploader("Upload image ")
 
 
10
 
11
  if file_name is not None:
12
  col1, col2 = st.columns(2)
13
 
14
  image = Image.open(file_name)
15
  col1.image(image, use_column_width=True)
 
16
 
17
+ # pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
18
+
19
+ # st.title("AIMLJan24 First App on Hugging face - Hot Dog? Or Not?")
20
+
21
+ # file_name = st.file_uploader("Upload the test image to find is this hot dog ! ")
22
+
23
+ # if file_name is not None:
24
+ # col1, col2 = st.columns(2)
25
+
26
+ # image = Image.open(file_name)
27
+ # col1.image(image, use_column_width=True)
28
+ # predictions = pipeline(image)
29
+
30
+ # col2.header("Probabilities")
31
+ # for p in predictions:
32
+ # col2.subheader(f"{ p['label'] }: { round(p['score'] * 100, 1)}%")
33
 
34
 
35
  # # my first app