arslannbilal commited on
Commit
42a147e
1 Parent(s): 15f48f5

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +17 -0
  2. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import google.generativeai as genai
3
+ genai.configure(api_key='AIzaSyDnBVZRrktkc-gOzW-5gQqNGxDIrBUD5bI')
4
+ st.title('Analyze Image with Google Gemini')
5
+ model=genai.GenerativeModel('gemini-pro-vision')
6
+ from PIL import Image
7
+ resim=st.file_uploader("Bir resim sec", type=(['jpg','jpeg','png']))
8
+ if resim is not None:
9
+ img=Image.open(resim)
10
+ st.image(img)
11
+ #response=model.generate_content(img)
12
+ #st.write(response.text)
13
+ soru=st.text_input('Soru')
14
+ if st.button('soru sor'):
15
+ response=model.generate_content([soru,img], stream=True)
16
+ response.resolve()
17
+ st.write(response.text)
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ streamlit
2
+ google-generativeai