Musharraf11 commited on
Commit
635bc3d
โ€ข
1 Parent(s): c35e4cf

Upload 13 files

Browse files
Files changed (12) hide show
  1. .env +1 -0
  2. .gitignore +1 -0
  3. app.py +33 -25
  4. chatbot.py +111 -0
  5. feedback.csv +3 -0
  6. feedback.py +40 -0
  7. logo-hd.png +0 -0
  8. model.py +96 -0
  9. mysrap.py +83 -0
  10. prescription.py +106 -0
  11. requirements.txt +16 -2
  12. welcome.py +61 -43
.env ADDED
@@ -0,0 +1 @@
 
 
1
+ GOOGLE_API_KEY="AIzaSyCH8lnRWjJe5vABq_uI0yIsXJz9dUhRK2A"
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .env
app.py CHANGED
@@ -1,35 +1,43 @@
1
  import streamlit as st
2
  from streamlit_option_menu import option_menu
3
 
4
- st.set_page_config(page_title="PawSome-AI", page_icon="๐Ÿพ", layout="centered", initial_sidebar_state="auto", menu_items=None)
 
 
 
 
 
 
 
 
 
 
 
5
  with st.sidebar:
6
- selected = option_menu('PawSome AI',
7
-
8
- ['Welcome',
9
- 'Petcare',
10
- 'ChatBot',
11
- # 'Dibetic Prediction',
12
- 'About',
13
- 'Feedback'
14
- ],
15
- icons=['house-door-fill','robot','chat-right-fill' , 'info', 'star'],menu_icon="๐Ÿถ",
16
- default_index=0)
17
-
18
- if (selected == 'Welcome'):
19
  import welcome
20
  welcome.welcome()
21
 
 
 
 
22
 
23
- if (selected == 'Petcare'):
24
- # # info.about_page()
25
- st.write("Stay Tunned (:")
26
 
27
- if (selected == 'ChatBot'):
28
- st.write("Stay Tunned (:")
29
-
30
- if (selected=='Feedback'):
31
- # # feedback.run_feedback_app()
32
- st.write("Stay Tunned (:")
33
 
34
- # if (selected=='Dibetic Prediction'):
35
-
 
 
1
  import streamlit as st
2
  from streamlit_option_menu import option_menu
3
 
4
+ st.set_page_config(
5
+ page_title="PawSome-AI",
6
+ page_icon="๐Ÿพ",
7
+ layout="centered",
8
+ initial_sidebar_state="auto"
9
+ )
10
+
11
+ # Display your logo at the top of the main page
12
+ # Adjust the path to your logo image
13
+
14
+ # st.header("Welcome to PawSome AI")
15
+
16
  with st.sidebar:
17
+ selected = option_menu(
18
+ 'PawSome AI',
19
+ ['Welcome', 'Disease & Breed Detection', 'Petcare ChatBot', 'Prescription-Analyzer', 'About', 'Feedback'],
20
+ icons=['house-door-fill', 'search', 'chat-right-fill', 'file-earmark-break-fill', 'info', 'star'],
21
+ menu_icon="๐Ÿถ",
22
+ default_index=0
23
+ )
24
+
25
+ if selected == 'Welcome':
 
 
 
 
26
  import welcome
27
  welcome.welcome()
28
 
29
+ if selected == 'Disease & Breed Detection':
30
+ import model
31
+ model.model()
32
 
33
+ if selected == 'Petcare ChatBot':
34
+ import chatbot
35
+ chatbot.chatbot()
36
 
37
+ if selected == 'Prescription-Analyzer':
38
+ import prescription
39
+ prescription.presc_analyze()
 
 
 
40
 
41
+ if selected == 'Feedback':
42
+ import feedback
43
+ feedback.feedback()
chatbot.py ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def chatbot():
2
+ # Importing all the modules
3
+ import streamlit as st
4
+ from PyPDF2 import PdfReader
5
+ from langchain.text_splitter import RecursiveCharacterTextSplitter
6
+ import os
7
+ from langchain_google_genai import GoogleGenerativeAIEmbeddings
8
+ import google.generativeai as genai
9
+ from langchain.vectorstores import FAISS
10
+ from langchain_google_genai import ChatGoogleGenerativeAI
11
+ from langchain.chains.question_answering import load_qa_chain
12
+ from langchain.prompts import PromptTemplate
13
+ from dotenv import load_dotenv
14
+ import pyttsx3
15
+
16
+ def speak_response(response_content):
17
+ engine = pyttsx3.init()
18
+ engine.say(response_content)
19
+ engine.runAndWait()
20
+
21
+ # Load environment variables
22
+ load_dotenv()
23
+ api_key = os.getenv("GOOGLE_API_KEY")
24
+ genai.configure(api_key=api_key)
25
+
26
+ def get_pdf_text(pdf_docs):
27
+ text = ""
28
+ for pdf in pdf_docs:
29
+ pdf_reader = PdfReader(pdf)
30
+ for page in pdf_reader.pages:
31
+ text += page.extract_text()
32
+ return text
33
+
34
+ def get_text_chunks(text):
35
+ text_splitter = RecursiveCharacterTextSplitter(chunk_size=10000, chunk_overlap=1000)
36
+ chunks = text_splitter.split_text(text)
37
+ return chunks
38
+
39
+ def get_vector_store(text_chunks):
40
+ embedding_function = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
41
+ vector_store = FAISS.from_texts(text_chunks, embedding=embedding_function)
42
+ vector_store.save_local("faiss_index")
43
+
44
+ def get_conversational_chain():
45
+ prompt_template = """
46
+ Answer the question as detailed as possible from the provided context, make sure to provide all the details, if the answer is not in
47
+ provided context then go and find and provide the answer don't provide the wrong answer and your a expert in pet-care so make sure all your responses are within that.\n\n
48
+ Context:\n {context}?\n
49
+ Question: \n{question}\n
50
+
51
+ Answer:
52
+ """
53
+ model = ChatGoogleGenerativeAI(model="gemini-1.5-pro-latest", temperature=0.3)
54
+ prompt = PromptTemplate(template=prompt_template, input_variables=["context", "question"])
55
+ chain = load_qa_chain(model, chain_type="stuff", prompt=prompt)
56
+ return chain
57
+
58
+ def user_input(user_question):
59
+ embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
60
+ new_db = FAISS.load_local("faiss_index", embeddings, allow_dangerous_deserialization=True)
61
+ docs = new_db.similarity_search(user_question)
62
+ chain = get_conversational_chain()
63
+ response = chain({"input_documents": docs, "question": user_question}, return_only_outputs=True)
64
+ return response["output_text"]
65
+
66
+ # Main function for the chatbot
67
+ st.title("Pet Care ChatBot ๐Ÿพ")
68
+ st.subheader("Your AI-Powered Pet Care Assistant")
69
+ st.markdown("""
70
+ Welcome to the Pet Care ChatBot! Ask any question related to pet care, and our AI-powered assistant will provide you with detailed and accurate answers.
71
+ """)
72
+ voice_response = st.checkbox("Click for Voice Response")
73
+
74
+ if "messages" not in st.session_state:
75
+ st.session_state.messages = []
76
+
77
+ # Uncomment if you want to add your own-custom pdf:
78
+ # with st.form(key="uploader_form"):
79
+ # pdf_docs = st.file_uploader("Upload your PDF Files", accept_multiple_files=True)
80
+ # submit_button = st.form_submit_button(label="Submit & Process")
81
+ # if submit_button:
82
+ # if pdf_docs:
83
+ # with st.spinner("Processing..."):
84
+ # raw_text = get_pdf_text(pdf_docs)
85
+ # text_chunks = get_text_chunks(raw_text)
86
+ # get_vector_store(text_chunks)
87
+ # st.success("Processing completed successfully.")
88
+ # else:
89
+ # st.warning("Please upload at least one PDF file.")
90
+
91
+ # Display chat messages from history on app rerun
92
+ for message in st.session_state.messages:
93
+ with st.chat_message(message["role"]):
94
+ st.markdown(message["content"])
95
+
96
+ # React to user input
97
+ if prompt := st.chat_input("Ask a question from the PDF files"):
98
+ # Display user message in chat message container
99
+ st.chat_message("user").markdown(prompt)
100
+ # Add user message to chat history
101
+ st.session_state.messages.append({"role": "user", "content": prompt})
102
+
103
+ response = user_input(prompt)
104
+ # Display assistant response in chat message container
105
+ with st.chat_message("assistant"):
106
+ st.markdown(response)
107
+ if voice_response:
108
+ speak_response(response)
109
+
110
+ # Add assistant response to chat history
111
+ st.session_state.messages.append({"role": "assistant", "content": response})
feedback.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ name,email,feedback_type,message,timestamp
2
+ Boss,habii,Suggestion,great job guys,2024-06-20 22:26:46.126194
3
+ Boss,habii,Issue,great job guys cool,2024-06-20 22:27:24.377924
feedback.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ from datetime import datetime
4
+
5
+ def feedback():
6
+ st.title("Feedback")
7
+ st.write("We value your feedback to help us improve PawSome-AI!")
8
+
9
+ # Feedback form
10
+ with st.form(key='feedback_form'):
11
+ name = st.text_input("Your Name")
12
+ email = st.text_input("Your Email")
13
+ feedback_type = st.selectbox("Type of Feedback", ["Suggestion", "Issue", "Other"])
14
+ message = st.text_area("Your Feedback")
15
+ submit_button = st.form_submit_button(label="Submit")
16
+
17
+ # After the user clicks the submit button
18
+ if submit_button:
19
+ feedback_data = {
20
+ "name": [name],
21
+ "email": [email],
22
+ "feedback_type": [feedback_type],
23
+ "message": [message],
24
+ "timestamp": [datetime.now()]
25
+ }
26
+ feedback_df = pd.DataFrame(feedback_data)
27
+
28
+ # Save the feedback to a CSV file
29
+ try:
30
+ existing_feedback_df = pd.read_csv("feedback.csv")
31
+ feedback_df = pd.concat([existing_feedback_df, feedback_df], ignore_index=True)
32
+ except FileNotFoundError:
33
+ pass
34
+
35
+ feedback_df.to_csv("feedback.csv", index=False)
36
+
37
+ st.success("Thank you for your feedback! We'll get back to you shortly.")
38
+
39
+ st.write("If you need immediate assistance, please contact us at: ")
40
+ st.markdown("[support@pawsome-ai.com](mailto:support@pawsome-ai.com)")
logo-hd.png ADDED
model.py ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def model():
2
+ # Importing All the modules
3
+ import streamlit as st
4
+ import os
5
+ from PIL import Image
6
+ import google.generativeai as genai
7
+ from dotenv import load_dotenv
8
+
9
+ # Load all environment Variables
10
+ load_dotenv()
11
+
12
+ # Configuring the api key
13
+ genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
14
+
15
+ # Function to load Gemini Vison Pro Vision Model and Get response
16
+ def get_gemini_response(image, prompt):
17
+ # Loading the desired Model
18
+ model = genai.GenerativeModel("gemini-pro-vision")
19
+ response = model.generate_content([image[0], prompt])
20
+ return response.text
21
+
22
+ # Function to extract data from Image Uploaded
23
+ def input_image_setup(uploaded_file):
24
+ # Check if a file has been uploaded
25
+ if uploaded_file is not None:
26
+ # Read the file into bytes
27
+ bytes_data = uploaded_file.getvalue()
28
+ image_parts = [
29
+ {
30
+ "mime_type": uploaded_file.type, # Get the mime type of the uploaded file
31
+ "data": bytes_data
32
+ }
33
+ ]
34
+ return image_parts
35
+ else:
36
+ raise FileNotFoundError("No file uploaded")
37
+
38
+ # Initializing our Streamlit Prompt
39
+ st.title("Pet Image Analyzer")
40
+ st.write(
41
+ """
42
+ Welcome to the Pet Image Analyzer! This tool uses advanced AI technology to analyze images of your pets
43
+ and provide insights into their breed, potential health issues, and more. Please upload an image of your pet
44
+ to get started.
45
+ """
46
+ )
47
+
48
+ # File uploader for image input
49
+ uploaded_file = st.file_uploader("Choose a pet image...", type=["jpg", "jpeg", "png", "webp"])
50
+ image = None
51
+
52
+ if uploaded_file is not None:
53
+ image = Image.open(uploaded_file)
54
+ st.image(image, caption="Uploaded Image.", use_column_width=True)
55
+
56
+ # Defining a System Prompt (pre-defined)
57
+ input_prompt = f"""Image: (content of the uploaded image)
58
+
59
+ Text: Analyze the image and provide the following information:
60
+
61
+ * Breed: Identify the breed of the animal in the image (if possible).
62
+ * Disease Detection: If the image shows a diseased area, identify the specific disease (if possible).
63
+ * Severity: If a disease is detected, assess the severity of the disease.
64
+ * Symptoms: Describe the common symptoms associated with the detected disease.
65
+ * Precautions: Recommend preventative measures to avoid the disease.
66
+
67
+ Give response with headings,
68
+ Inform the user if the image is not related to pet care.
69
+ """
70
+
71
+ submit = st.button("Analyze Image")
72
+ Disclaimer = (
73
+ "**Disclaimer:** This application uses image analysis to provide potential information about your pet's health. "
74
+ "The results are for informational purposes only and should not be considered a replacement for professional veterinary diagnosis. "
75
+ "For any concerns about your pet's health, please consult a licensed veterinarian. They can conduct a thorough examination and provide personalized recommendations for your pet's well-being."
76
+ )
77
+
78
+ if submit:
79
+ if image:
80
+ with st.spinner("Analyzing Image..."):
81
+ image_data = input_image_setup(uploaded_file)
82
+ response = get_gemini_response(image_data, input_prompt)
83
+ st.subheader("Analysis Result:")
84
+ st.write(response)
85
+ st.warning(Disclaimer)
86
+ st.balloons()
87
+ else:
88
+ st.error("Please upload an image to proceed.")
89
+ else:
90
+ st.info("Upload an image of your pet to get started!")
91
+ st.write(
92
+ """
93
+ To analyze your pet's image, click on the 'Choose a pet image...' button above and select an image file from your device.
94
+ Once the image is uploaded, click on 'Analyze Image' to receive detailed information about your pet.
95
+ """
96
+ )
mysrap.py ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ from bs4 import BeautifulSoup
4
+ from selenium import webdriver
5
+ from selenium.webdriver.chrome.service import Service
6
+ from selenium.webdriver.chrome.options import Options
7
+ from webdriver_manager.chrome import ChromeDriverManager
8
+ import time
9
+
10
+ def search_medicine_supertails(medicine_name):
11
+ url = f'https://supertails.com/search?q={medicine_name}&page=1'
12
+
13
+ options = Options()
14
+ options.headless = True
15
+ driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
16
+
17
+ try:
18
+ driver.get(url)
19
+ time.sleep(5) # Wait for the page to load completely
20
+
21
+ # Get the page source and parse it with BeautifulSoup
22
+ page_source = driver.page_source
23
+ soup_obj = BeautifulSoup(page_source, 'html.parser')
24
+
25
+ # Find all product elements
26
+ products = soup_obj.find_all('li', class_='findify-components-common--grid__column findify-components-common--grid__column-3 product-item')
27
+
28
+ product_name = []
29
+ product_price = []
30
+ product_link = []
31
+
32
+ for product in products:
33
+ # Find the first <a> tag directly after the <li> tag
34
+ link_tag = product.find_next('a', href=True)
35
+ if link_tag:
36
+ product_link.append('https://supertails.com' + link_tag['href'])
37
+ else:
38
+ product_link.append('N/A') # Append placeholder if link is missing
39
+
40
+ name_tag = product.find('h2', class_='findify-components--cards--product__title')
41
+ if name_tag:
42
+ product_name.append(name_tag.text.strip())
43
+ else:
44
+ product_name.append('N/A') # Append placeholder if name is missing
45
+
46
+ price_tag = product.find('div', class_='findify-components--cards--product--price__price findify-components--cards--product--price__sale-price')
47
+ if price_tag:
48
+ product_price.append(price_tag.text.strip())
49
+ else:
50
+ product_price.append('N/A') # Append placeholder if price is missing
51
+
52
+ df = pd.DataFrame({
53
+ 'Product Name': product_name,
54
+ 'Price': product_price,
55
+ 'Link': product_link
56
+ })
57
+
58
+ return df
59
+
60
+ except Exception as e:
61
+ st.error(f'Error occurred: {e}')
62
+ return None
63
+ finally:
64
+ driver.quit()
65
+
66
+ def main():
67
+ st.title('Medicine Finder')
68
+
69
+ # Input field for medicine name
70
+ medicine_name = st.text_input('Enter the name of the medicine:')
71
+
72
+ if st.button('Search'):
73
+ # Call the scraper function
74
+ results_df = search_medicine_supertails(medicine_name)
75
+
76
+ # Display results
77
+ if results_df is not None and not results_df.empty:
78
+ st.dataframe(results_df)
79
+ elif results_df is not None:
80
+ st.write("No results found")
81
+
82
+ if __name__ == '__main__':
83
+ main()
prescription.py ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import os
3
+ from PIL import Image
4
+ import google.generativeai as genai
5
+ from dotenv import load_dotenv
6
+ from mysrap import search_medicine_supertails
7
+ from google.generativeai.types import HarmCategory, HarmBlockThreshold
8
+
9
+ def presc_analyze():
10
+ # Load environment variables
11
+ load_dotenv()
12
+
13
+ # Configure the API key
14
+ genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
15
+
16
+ # Function to load Gemini Vision Pro model and get response
17
+ def get_gemini_response(input_prompt, image_data, user_prompt):
18
+ # model = genai.GenerativeModel("gemini-pro-vision")
19
+ safety_settings={
20
+ HarmCategory.HARM_CATEGORY_HATE_SPEECH: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
21
+ HarmCategory.HARM_CATEGORY_HARASSMENT: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
22
+ # HarmCategory.HARM_CATEGORY_DANGEROUS: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
23
+ HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: HarmBlockThreshold.BLOCK_NONE,
24
+ }
25
+ model = genai.GenerativeModel("gemini-pro-vision",safety_settings=safety_settings)
26
+ response = model.generate_content([input_prompt, image_data[0], user_prompt])
27
+ return response.text
28
+
29
+ # Function to extract data from uploaded image
30
+ def input_image_setup(uploaded_file):
31
+ if uploaded_file is not None:
32
+ bytes_data = uploaded_file.getvalue()
33
+ image_parts = [
34
+ {
35
+ "mime_type": uploaded_file.type,
36
+ "data": bytes_data,
37
+ }
38
+ ]
39
+ return image_parts
40
+ else:
41
+ raise FileNotFoundError("No file uploaded")
42
+
43
+ def extract_medicine_names_heuristic(text):
44
+ import re
45
+ # Split based on common delimiters, numbers, or new lines
46
+ potential_medicines = re.split(r'\d+\.\s*|\n|\r|,', text)
47
+ # Clean up and filter out non-medicines
48
+ potential_medicines = [med.strip() for med in potential_medicines if med.strip() and med.lower() not in ["the", "to", "of", "and", "is"]]
49
+ return potential_medicines
50
+
51
+ # Streamlit app configuration
52
+ # st.set_page_config(page_title="Prescription & Medicine Information Extractor")
53
+ st.header("Prescription & Medicine Information Extractor")
54
+
55
+ user_prompt = "Give me the details about the Prescription and along with basic personal details and tell about medications and frequency in a proper tabular form"
56
+ uploaded_file = st.file_uploader("Choose a Prescription Image...", type=["jpg", "jpeg", "png"])
57
+ image = ""
58
+ if uploaded_file is not None:
59
+ image = Image.open(uploaded_file)
60
+ st.image(image, caption="Uploaded Image", use_column_width=True)
61
+
62
+ submit = st.button("Extract Information")
63
+
64
+ # System prompt for understanding prescriptions
65
+ info_prompt = """You are an expert in understanding prescriptions.
66
+ You will receive prescription images and answer questions based on them.
67
+ Please consider the following information: {user_prompt}"""
68
+
69
+ # System prompt for extracting medicine names (heuristic)
70
+ medicine_prompt = "Please list all the medications mentioned in the prescription.Make sure that you just give medicine name with strength."
71
+
72
+ if submit:
73
+ image_data = input_image_setup(uploaded_file)
74
+
75
+ # Extract information based on user prompt
76
+ info_response = get_gemini_response(info_prompt.format(user_prompt=user_prompt), image_data, "")
77
+ st.subheader("Extracted Information:")
78
+ st.write(info_response)
79
+
80
+ # Extract medicine names using a separate query
81
+ medicine_response = get_gemini_response(medicine_prompt, image_data, "")
82
+ medicine_names = extract_medicine_names_heuristic(medicine_response)
83
+
84
+ if medicine_names:
85
+ st.subheader("Medicine Names:")
86
+ # Store medicine names in a list
87
+ medicine_list = ", ".join(medicine_names)
88
+ st.write(medicine_list)
89
+
90
+ # Display at least 6-7 medicines with clickable links for each extracted medicine name
91
+ st.subheader("Medicines with Links:")
92
+ for medicine in medicine_names:
93
+ st.markdown(f"### {medicine}")
94
+ results_df = search_medicine_supertails(medicine)
95
+ if results_df is not None and not results_df.empty:
96
+ for index, row in results_df.head(7).iterrows():
97
+ st.markdown(f"[{row['Product Name']}]({row['Link']}) - {row['Price']} โ‚น")
98
+ else:
99
+ st.write(f"No results found for {medicine}")
100
+ else:
101
+ st.write("No medicine names found using the heuristic approach.")
102
+
103
+ st.balloons()
104
+
105
+ if __name__ == '__main__':
106
+ presc_analyze()
requirements.txt CHANGED
@@ -1,2 +1,16 @@
1
- streamlit
2
- streamlit-option-menu
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ streamlit
2
+ streamlit-option-menu
3
+ google-generativeai
4
+ python-dotenv
5
+ langchain
6
+ PyPDF2
7
+ chromadb
8
+ faiss-cpu
9
+ langchain_google_genai
10
+ streamlit
11
+ pandas
12
+ beautifulsoup4
13
+ selenium
14
+ webdriver-manager
15
+ pyttsx3
16
+ langchain-community
welcome.py CHANGED
@@ -1,43 +1,61 @@
1
- import streamlit as st
2
-
3
- def welcome():
4
-
5
-
6
- # Home page content
7
- st.title("Welcome to PawSome-AI ๐Ÿพ")
8
- st.subheader("Your AI-Powered Pet Care Assistant")
9
-
10
- st.markdown("""
11
- ### About PawSome-AI
12
- PawSome-AI is a comprehensive web application designed to assist pet owners with various aspects of pet care using advanced AI technologies. Our app offers a range of features to help you better understand and take care of your pets.
13
-
14
- ### Key Features
15
-
16
- 1. **Dog Breed Identification and Disease Detection**
17
- - Upload images of your dog or any infected area.
18
- - Our AI model identifies the breed of the dog.
19
- - Detects potential diseases from the images.
20
- - Provides symptoms, precautions, and possible medications for detected diseases.
21
-
22
- 2. **Pet Care Chatbot**
23
- - Interactive chatbot for pet-care-related queries.
24
- - Utilizes the LLMA index to provide information from a pet-care encyclopedia.
25
- - Speaks responses to enhance user experience.
26
-
27
- 3. **Future Feature: Prescription Analyzer**
28
- - Upload images of veterinary prescriptions.
29
- - Our planned feature will interpret and provide details on the medication and dosage.
30
-
31
- 4. **Contact and Feedback**
32
- - Contact form for user inquiries.
33
- - Feedback form to collect user suggestions and improvements.
34
-
35
- ### How to Use
36
- - Navigate through the app using the sidebar.
37
- - Start with uploading an image on the 'Dog Breed and Disease Detection' page.
38
- - Interact with our pet care chatbot for any questions.
39
- - Stay tuned for the upcoming 'Prescription Analyzer' feature.
40
- - Use the 'Contact' page to reach out to us and the 'Feedback' page to provide your valuable suggestions.
41
-
42
- We hope PawSome-AI makes pet care easier and more effective for you. Thank you for using our app!
43
- """)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ def welcome():
4
+ # Logo and main heading
5
+ st.image("logo-hd.png", width=200)
6
+ st.title("Welcome to PawSome-AI ๐Ÿพ")
7
+ st.write("Your AI-Powered Pet Care Assistant")
8
+ st.markdown("---") # Horizontal line
9
+
10
+ # Main layout with two columns
11
+ col1, col2 = st.columns(2)
12
+
13
+ # Key Features section centered (Column 1)
14
+ with col1:
15
+ st.markdown("""
16
+ <div style="background-color:#e5f7fa; padding:20px; border-radius:10px; text-align:center;">
17
+ <h3 style="color:#007a87;">Key Features</h3>
18
+ <p style="color:#333333;">Explore the capabilities that PawSome-AI offers to enhance your pet care experience:</p>
19
+ <ul style="text-align:left;">
20
+ <li><strong>Dog Breed Identification and Disease Detection</strong><br>
21
+ Upload images to identify your dog's breed and detect diseases. Get detailed information on symptoms, precautions, and treatments.</li><br>
22
+
23
+ <li><strong>Pet Care Chatbot</strong><br>
24
+ Interactive chatbot for pet-care-related queries and advice. Receive personalized recommendations on nutrition, grooming, behavior, and more.</li><br>
25
+ </ul>
26
+ </div>
27
+ """, unsafe_allow_html=True)
28
+
29
+ # Additional Key Features (Column 2)
30
+ with col2:
31
+ st.markdown("""
32
+ <div style="background-color:#e5f7fa; padding:20px; border-radius:10px;">
33
+ <h3 style="color:#007a87;">Additional Key Features</h3>
34
+ <ul style="text-align:left;">
35
+ <li><strong>Prescription Analyzer</strong><br>
36
+ Upload veterinary prescriptions to manage your pet's medications effectively
37
+ Get detailed information about medications listed in the prescription.
38
+ <br>
39
+
40
+
41
+ <li><strong>Contact and Feedback</strong><br>
42
+ Contact form for inquiries and feedback collection. Reach out to us for any questions or suggestions.</li><br>
43
+
44
+ <li><strong>Future Features</strong><br>
45
+ Planned enhancements to further assist pet owners. Suggestions are welcomed. </li><br>
46
+ </ul>
47
+ </div>
48
+ """, unsafe_allow_html=True)
49
+
50
+ # How to Use section centered (Spanning both columns)
51
+ st.markdown("""
52
+ <div style="background-color:#f9f9f9; padding:20px; border-radius:10px; text-align:center;">
53
+ <h3 style="color:#4d4d4d;">How to Use</h3>
54
+ <ul style="text-align:left;">
55
+ <li>Navigate through the app using the sidebar menu on the left.</li>
56
+ <li>Upload an image to detect dog breeds and diseases.</li>
57
+ <li>Interact with the chatbot for personalized pet care advice.</li>
58
+ <li>Use the Prescription Analyzer to manage your pet's medications.</li>
59
+ </ul>
60
+ </div>
61
+ """, unsafe_allow_html=True)