import streamlit as st from PIL import Image, ImageDraw from helper import summarize_predictions_natural_language, render_results_in_image from transformers import pipeline from tokenizers import Tokenizer, Encoding from tokenizers import decoders from tokenizers import models from tokenizers import normalizers from tokenizers import pre_tokenizers from tokenizers import processors import io import matplotlib.pyplot as plt import requests import inflect from predictions import get_predictions # Replace 'your_module' with the name of the module where your function is defined def main(): st.title("Object Detection App") uploaded_image = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png"]) if uploaded_image is not None: processed_image, text, audio = get_predictions(uploaded_image) st.image(processed_image, caption='Processed Image', use_column_width=True) st.write(f"Predictions: {text}") st.audio(audio, format='audio/wav') if __name__ == '__main__': main()