Update app.py
Browse files
app.py
CHANGED
@@ -51,36 +51,26 @@ def generate_gemini_response(prompt, image_path):
|
|
51 |
|
52 |
# Initial input prompt for the plant pathologist
|
53 |
input_prompt = """
|
54 |
-
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
2. **Detailed Findings:** Provide in-depth findings on the nature and extent of the identified plant diseases, including affected plant parts, symptoms, and potential causes.
|
61 |
-
|
62 |
-
3. **Next Steps:** Outline the recommended course of action for managing and controlling the identified plant diseases. This may involve treatment options, preventive measures, or further investigations.
|
63 |
-
|
64 |
-
4. **Recommendations:** Offer informed recommendations for maintaining plant health, preventing disease spread, and optimizing overall plant well-being.
|
65 |
-
|
66 |
-
5. **Important Note:** As a plant pathologist, your insights are vital for informed decision-making in agriculture and plant management. Your response should be thorough, concise, and focused on plant health.
|
67 |
|
|
|
68 |
**Disclaimer:**
|
69 |
-
*"Please note that the information provided is based on
|
70 |
-
|
71 |
-
Your role is pivotal in ensuring the health and productivity of plants. Proceed to analyze the provided information or samples, adhering to the structured
|
72 |
"""
|
73 |
|
74 |
# Function to process uploaded files and generate a response
|
75 |
|
76 |
-
|
77 |
def process_uploaded_files(files):
|
78 |
file_path = files[0].name if files else None
|
79 |
response = generate_gemini_response(
|
80 |
input_prompt, file_path) if file_path else None
|
81 |
return file_path, response
|
82 |
|
83 |
-
|
84 |
# Gradio interface setup
|
85 |
with gr.Blocks() as demo:
|
86 |
file_output = gr.Textbox()
|
|
|
51 |
|
52 |
# Initial input prompt for the plant pathologist
|
53 |
input_prompt = """
|
54 |
+
You are an expertised doctor. The user will upload an image of the injury. Analyse the image and provide a complete analysis to assess for insurance claim estimation.
|
55 |
|
56 |
+
Additionally, provide any relevant details such as:
|
57 |
+
1. Type and severity of the injury (e.g., broken bone, laceration, burn).
|
58 |
+
2. Location of the injury on the body.
|
59 |
+
3. Total cost that the user can claim from the insurance company.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
+
Based on the provided image and information, the model will analyze the injury and estimate the amount that can be claimed from the insurance."
|
62 |
**Disclaimer:**
|
63 |
+
*"Please note that the information provided is based on the image analysis and should not replace professionals."*
|
|
|
|
|
64 |
"""
|
65 |
|
66 |
# Function to process uploaded files and generate a response
|
67 |
|
|
|
68 |
def process_uploaded_files(files):
|
69 |
file_path = files[0].name if files else None
|
70 |
response = generate_gemini_response(
|
71 |
input_prompt, file_path) if file_path else None
|
72 |
return file_path, response
|
73 |
|
|
|
74 |
# Gradio interface setup
|
75 |
with gr.Blocks() as demo:
|
76 |
file_output = gr.Textbox()
|