bravewiki commited on
Commit
7aa5308
·
verified ·
1 Parent(s): 34d51d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -18,7 +18,7 @@ model = AutoModelForPreTraining.from_pretrained("google/paligemma-3b-mix-224")
18
  # Function to transcribe handwritten notes using Hugging Face model
19
  def transcribe_handwriting(image):
20
  # Convert image to array and preprocess
21
- image = image.convert("RGB")
22
  image = np.array(image)
23
 
24
  # Prepare input for the model
@@ -45,6 +45,9 @@ st.title("Doctor's Prescription Reader 💊")
45
  uploaded_file = st.file_uploader("Upload Prescription Image", type=["jpg", "jpeg", "png"])
46
 
47
  if uploaded_file is not None:
 
 
 
48
  # Display uploaded image
49
  st.image(uploaded_file, caption="Uploaded Prescription", use_column_width=True)
50
 
 
18
  # Function to transcribe handwritten notes using Hugging Face model
19
  def transcribe_handwriting(image):
20
  # Convert image to array and preprocess
21
+ image = Image.convert("RGB")
22
  image = np.array(image)
23
 
24
  # Prepare input for the model
 
45
  uploaded_file = st.file_uploader("Upload Prescription Image", type=["jpg", "jpeg", "png"])
46
 
47
  if uploaded_file is not None:
48
+ # Open the image using PIL
49
+ image = Image.open(uploaded_file)
50
+
51
  # Display uploaded image
52
  st.image(uploaded_file, caption="Uploaded Prescription", use_column_width=True)
53