File size: 1,034 Bytes
e8f8ba2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cd5d4ba
e8f8ba2
 
cd5d4ba
e8f8ba2
cd5d4ba
e8f8ba2
 
2c582f7
e8f8ba2
 
 
2c582f7
e8f8ba2
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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()