| import gradio as gr | |
| from ultralytics import YOLO | |
| from PIL import Image | |
| model = YOLO("my_model.pt") | |
| def detect(image): | |
| results = model(image) | |
| plotted = results[0].plot() | |
| return plotted | |
| interface = gr.Interface( | |
| fn=detect, | |
| inputs=gr.Image(type="pil"), | |
| outputs=gr.Image(type="numpy"), | |
| title="FaceFixer Skin Detection", | |
| description="Upload a face image to detect skin conditions like acne, pimples, and dark spots." | |
| ) | |
| interface.launch() |