import gradio as gr from transformers import pipeline # 이미지 인식 파이프라인 로드 model = pipeline("image-classification") def classify_image(image): predictions = model(image) return predictions # Gradio 인터페이스 생성 iface = gr.Interface(fn=classify_image, inputs=gr.inputs.Image(shape=(224, 224)), outputs=gr.outputs.Label(num_top_classes=3), title="이미지 분류기", description="이미지를 업로드하면, 사물을 인식하고 설명을 출력합니다.") # 인터페이스 실행 iface.launch()