import subprocess from ultralytics import YOLO import streamlit as st from PIL import Image # Command to install ultalytics using pip install_command = "pip install ultalytics" # Use subprocess to execute the command subprocess.run(install_command, shell=True) if __name__ == '__main__': st.set_page_config(layout="wide") myhtml = '''

Speech Bubble Detector

Revolutionize Manga and Comic Reading Experience with YOLOv8
The Cutting-Edge Model That Detects Speech Bubbles with Unmatched Precision

''' style = ''' ''' st.markdown(style, unsafe_allow_html=True) st.markdown(myhtml, unsafe_allow_html=True) col1, col2, col3 = st.columns((2, 1, 1)) with col1: st.title('Speech bubble detection ') uploaded_file = st.file_uploader("Load image", type=["jpg", "jpeg", "png"]) if uploaded_file is not None: is_valid = True with st.spinner(text='Uploading image...'): with col2: st.image(uploaded_file, caption="Input Page", use_column_width=True) picture = Image.open(uploaded_file) else: is_valid = False if is_valid: with col3: with st.spinner(text='Processing image...'): model = YOLO('best.pt') results = model.predict(task="detect", source=picture, conf=0.85) img = results[0].plot() st.image(img, caption="Detected Objects", use_column_width=True) my2ndHtml = '''

About

Our model detects speech bubbles from manga and comics using YOLOv8 by ultralytics. With a custom dataset of 2000 images, our model is able to accurately detect and classify speech bubbles in a wide range of styles and formats.

Speech bubbles are an essential part of comic books and manga, allowing characters to speak and express emotions. Our model makes it easy to extract speech bubbles from images, making it a valuable tool for researchers, artists, and publishers alike.

This model is for academic use ONLY. Do not use it for any commercial purpose.

Examples

''' st.markdown(my2ndHtml, unsafe_allow_html=True) my3rdHtml = '''''' st.markdown(my3rdHtml, unsafe_allow_html=True)