| import gradio as gr | |
| from predict_genre import image_analyzer | |
| def picture_analysis(input_image) -> str: | |
| return image_analyzer.predict_genre(input_image) | |
| demo = gr.Interface( | |
| fn=picture_analysis, | |
| inputs=gr.Image(type="filepath"), | |
| outputs="textbox", | |
| title="Painting Genre Analysis", | |
| description="Upload an image to get the genre prediction" | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch() |