ProfessorLeVesseur commited on
Commit
8e253a5
·
verified ·
1 Parent(s): 4996d49

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -33,9 +33,14 @@ if show_details:
33
  # Button to trigger the analysis
34
  analyze_button = st.button("Analyse the MTSS Image")
35
 
36
- if analyze_button:
37
- with st.spinner("Analyzing the image..."):
 
 
 
38
  base64_image = encode_image(uploaded_file)
 
 
39
  prompt_text = (
40
  "You are a highly knowledgeable accessibility expert. "
41
  "Your task is to examine the following image in detail. "
 
33
  # Button to trigger the analysis
34
  analyze_button = st.button("Analyse the MTSS Image")
35
 
36
+ # Check if an image has been uploaded, if the API key is available, and if the button has been pressed
37
+ if uploaded_file is not None and api_key and analyze_button:
38
+
39
+ with st.spinner("Analysing the image ..."):
40
+ # Encode the image
41
  base64_image = encode_image(uploaded_file)
42
+
43
+ # Optimized prompt for additional clarity and detail
44
  prompt_text = (
45
  "You are a highly knowledgeable accessibility expert. "
46
  "Your task is to examine the following image in detail. "