File size: 480 Bytes
fd2c31d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import streamlit as st
import cv2
from llm import llm
import numpy as np
image = st.file_uploader("Choose a clear image of the Neutrition Facts", type=["jpg", "jpeg", "png"])

# Display the uploaded image
if image is not None:
    image = np.asarray(bytearray(image.read()), dtype=np.uint8)
        
        # Read the image using OpenCV
    img = cv2.imdecode(image, cv2.IMREAD_COLOR)
    st.image(img, caption="Uploaded Image.", use_column_width=True)

    st.markdown(llm(img))