safetychecker / app.py
aka7774's picture
Update app.py
37a17ac verified
raw
history blame
445 Bytes
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()