Spaces:
Running
Running
import fn | |
import gradio as gr | |
fn.load_model() | |
with gr.Blocks() as demo: | |
title = gr.Markdown('# Safety Checker') | |
with gr.Row(): | |
src_image = gr.Image(label="Source", sources="upload", interactive=True, type="pil") | |
result = gr.Textbox(label="Has NSFW", interactive=False) | |
src_image.change( | |
fn=fn.check, | |
inputs=[src_image], | |
outputs=[result], | |
) | |
if __name__ == '__main__': | |
demo.launch() | |