import gradio as gr from carbgremover.external_model import remove_background_external, plot_image def process(image): res = remove_background_external(image_path='car1.jpg', device="cpu") return res gr.Markdown("## Car Segmentation") gr.HTML('''

This is a demo for Car Segmentation that using .

''') title = "Background Removal" description = r"""The CarSegmentPro package is developed to facilitate the removal of both internal and external backgrounds from car images. Read more at model card .
""" examples = [['./input.jpg'],] # output = ImageSlider(position=0.5,label='Image without background', type="pil", show_download_button=True) # demo = gr.Interface(fn=process,inputs="image", outputs=output, examples=examples, title=title, description=description) demo = gr.Interface(fn=process,inputs="image", outputs="image", examples=examples, title=title, description=description) if __name__ == "__main__": demo.launch(share=False)