POORNESH2004/Google-Clone-Using-Streamlit
0
1import streamlit as st2from PIL import Image3import numpy as np4 5# Dictionary of medicinal benefits6medicinal_benefits = {7 'Arive-Dantu': 'Arive-Dantu has various medicinal properties and is used to treat digestive issues, respiratory problems, and skin disorders. It also possesses antioxidant and anti-inflammatory properties.',8 'Basale': 'Basale, also known as Malabar spinach, is rich in vitamins and minerals. It is used to treat digestive disorders, promote heart health, and boost immunity.',9 'Betel': 'Betel leaves are known for their antiseptic and anti-inflammatory properties. They are used to treat oral health issues, cough, and sore throat. Betel leaves also aid in digestion.',10 'Crape_Jasmine': 'Crape Jasmine, also known as Parijata, has medicinal properties and is used in traditional medicine to treat skin diseases, fever, and inflammation. It also possesses antioxidant properties.',11 'Curry': 'Curry leaves are rich in antioxidants and are used in traditional medicine to treat digestive issues, promote hair growth, and manage diabetes. They also possess antibacterial properties.',12 'Drumstick': 'Drumstick leaves and pods are rich in vitamins and minerals. They are used to treat anemia, improve digestion, and boost immunity. Drumstick is also known for its anti-inflammatory properties.',13 'Fenugreek': 'Fenugreek seeds and leaves are used in traditional medicine to treat digestive issues, menstrual cramps, and diabetes. Fenugreek also helps in lactation and promotes heart health.',14 'Guava': 'Guava is rich in vitamin C and antioxidants. It is used to improve digestion, boost immunity, and promote heart health. Guava also helps in managing diabetes and aids in weight loss.',15 'Hibiscus': 'Hibiscus flowers are known for their medicinal properties and are used to treat high blood pressure, liver disorders, and menstrual cramps. Hibiscus tea is also beneficial for hair health.',16 'Indian_Beech': 'Indian Beech, also known as Pongamia, has medicinal properties and is used in traditional medicine to treat skin diseases, rheumatism, and respiratory disorders. It also possesses antibacterial and antifungal properties.',17 'Indian_Mustard': 'Indian Mustard seeds and leaves are used in traditional medicine to treat respiratory issues, arthritis, and digestive disorders. Mustard oil is also beneficial for skin and hair health.',18 'Jackfruit': 'Jackfruit is rich in vitamins, minerals, and antioxidants. It is used to improve digestion, boost immunity, and regulate blood sugar levels. Jackfruit seeds are also beneficial for skin health.',19 'Jamaica_Cherry-Gasagase': 'Jamaica Cherry, also known as Gasagase, has medicinal properties and is used to treat digestive issues, menstrual cramps, and respiratory disorders. Jamaica Cherry seeds are also beneficial for skin health.',20 'Jamun': 'Jamun, also known as Indian blackberry, is rich in antioxidants and is used to manage diabetes, improve digestion, and boost immunity. Jamun seeds and leaves are also beneficial for oral health.',21 'Jasmine': 'Jasmine flowers are known for their aromatic properties and are used in traditional medicine to relieve stress, anxiety, and depression. Jasmine tea is also beneficial for digestive health.',22 'Karanda': 'Karanda, also known as Carissa carandas, has medicinal properties and is used in traditional medicine to treat digestive issues, fever, and skin disorders. Karanda fruits are also used to prepare jams and preserves.',23 'Lemon': 'Lemon is rich in vitamin C and antioxidants. It is used to boost immunity, aid in digestion, and promote weight loss. Lemon juice is also beneficial for skin health.',24 'Mango': 'Mango is rich in vitamins, minerals, and antioxidants. It is used to improve digestion, boost immunity, and promote heart health. Mangoes also possess anti-inflammatory properties.',25 'Mexican_Mint': 'Mexican Mint, also known as Plectranthus amboinicus, has medicinal properties and is used to treat respiratory issues, digestive disorders, and skin infections. Mexican Mint leaves are also used as a culinary herb.',26 'Mint': 'Mint leaves are known for their medicinal properties and are used to treat digestive issues, respiratory disorders, and headaches. Mint tea is also beneficial for digestion and relaxation.',27 'Neem': 'Neem leaves, seeds, and oil have medicinal properties and are used in traditional medicine to treat skin disorders, dental issues, and digestive disorders. Neem is also known for its antibacterial and antifungal properties.',28 'Oleander': 'Oleander has medicinal properties and is used in traditional medicine to treat heart conditions, asthma, and skin disorders. However, it is toxic and should be used with caution under medical supervision.',29 'Parijata': 'Parijata, also known as Crape Jasmine, has medicinal properties and is used to treat fever, skin diseases, and digestive disorders. Parijata flowers are also used in religious ceremonies.',30 'Peepal': 'Peepal leaves have medicinal properties and are used in traditional medicine to treat respiratory issues, digestive disorders, and skin diseases. Peepal tree bark is also used for various health purposes.',31 'Pomegranate': 'Pomegranate is rich in antioxidants and is used to improve heart health, boost immunity, and manage diabetes. Pomegranate juice is also beneficial for skin health.',32 'Rasna': 'Rasna, also known as Pluchea lanceolata, has medicinal properties and is used in traditional medicine to treat joint pain, inflammation, and respiratory disorders. Rasna leaves are also used to prepare herbal tea.',33 'Rose_apple': 'Rose Apple, also known as Syzygium jambos, has medicinal properties and is used to treat digestive issues, fever, and respiratory disorders. Rose Apple fruits are also used to prepare jams and preserves.',34 'Roxburgh_fig': 'Roxburgh Fig, also known as Ficus auriculata, has medicinal properties and is used in traditional medicine to treat digestive issues, diabetes, and skin disorders. Roxburgh Fig leaves are also used as a natural remedy for various health conditions.',35 'Sandalwood': 'Sandalwood has medicinal properties and is used in traditional medicine to treat skin disorders, respiratory issues, and anxiety. Sandalwood oil is also used in aromatherapy and skincare products.',36 'Tulsi': 'Tulsi, also known as Holy Basil, has medicinal properties and is used in traditional medicine to treat respiratory issues, digestive disorders, and stress. Tulsi leaves are also used to prepare herbal tea.'37}38 39# Function to simulate image classification (placeholder)40def classify_image(image):41 # Simulate classification by randomly picking a category (replace this with your model)42 import random43 categories = list(medicinal_benefits.keys())44 return random.choice(categories)45 46# Function to preprocess the image (placeholder for real preprocessing)47def preprocess_image(image_array):48 # Here, you can add real image preprocessing (e.g., resizing, normalization)49 return image_array50 51def main():52 st.title("Medicinal Plant Identification")53 st.write("Upload an image of a medicinal plant to identify it and know its medicinal benefits.")54 55 uploaded_image = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])56 57 if uploaded_image is not None:58 # Display the uploaded image59 image = Image.open(uploaded_image)60 st.image(image, caption='Uploaded Image', use_column_width=True)61 st.write("Classifying...")62 63 # Preprocess the image64 input_img = preprocess_image(np.array(image))65 66 # Simulate classification (replace with your model's prediction)67 classified_plant = classify_image(input_img)68 69 # Display classification result and medicinal benefits70 st.write(f"Identified Plant: **{classified_plant}**")71 st.write(f"Medicinal Benefits: {medicinal_benefits[classified_plant]}")72 73 st.write("For more information, visit this [link](https://late-peas-kneel.loca.lt/)")74 75if __name__ == "__main__":76 main()77 