chayanee commited on
Commit
4350241
·
1 Parent(s): 91bafed

Upload 2 files

Browse files
Files changed (2) hide show
  1. app (3).py +31 -0
  2. requirements (1).txt +3 -0
app (3).py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from io import StringIO
3
+ import pandas as pd
4
+ from transformers import pipeline
5
+
6
+ classifier = pipeline("object-detection", model="chayanee/Detected_img")
7
+ def main():
8
+ st.title("Detection Img")
9
+
10
+ uploaded_file = st.file_uploader("Choose a file")
11
+ if uploaded_file is not None:
12
+ # To read file as bytes:
13
+ bytes_data = uploaded_file.getvalue()
14
+ st.write(bytes_data)
15
+
16
+ # To convert to a string based IO:
17
+ stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))
18
+ st.write(stringio)
19
+
20
+ # To read file as string:
21
+ string_data = stringio.read()
22
+ st.write(string_data)
23
+
24
+ # Can be used wherever a "file-like" object is accepted:
25
+ dataframe = pd.read_csv(uploaded_file)
26
+ st.write(dataframe)
27
+
28
+ st.button("click", type="primary")
29
+
30
+ if __name__ == "__main__":
31
+ main()
requirements (1).txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ torch
2
+ transformers
3
+ altair<5