Spaces:
Runtime error
Runtime error
Update app.py
Browse files258 unmodified lines2592602612622632642658 unmodified lines274275276277278279280281282283284285286287288289290258 unmodified linesreturn compositewith gr.Blocks(css=".output-class { display: none; }") as demo:gr.Markdown("""## Joint Tagger Project: JTP-PILOT² Demo **BETA**This tagger is designed for use on furry images (though may very well work on out-of-distribution images, potentially with funny results). A threshold of 0.2 is recommended. Lower thresholds often turn up more valid tags, but can also result in some amount of hallucinated tags.8 unmodified linessorted_tag_score_state = gr.State(value={}) # stash a copy of the input imagecam_state = gr.State()with gr.Row():custom_css = """.inferno-slider input[type=range] {background: linear-gradient(to right,#000004, #1b0c41, #4a0c6b, #781c6d,#a52c60, #cf4446, #ed6925, #fb9b06,#f7d13d, #fcffa4) !important;background-size: 100% 100% !important;}"""with gr.Column(css=custom_css):image_input = gr.Image(label="Source", sources=['upload'], type='pil', height=512, show_label=False)threshold_slider = gr.Slider(minimum=0.00, maximum=1.00, step=0.01, value=0.20, label="Tag Threshold")cam_slider = gr.Slider(minimum=0.00, maximum=1.00, step=0.01, value=0.40, label="CAM Threshold", elem_classes="inferno-slider")258 unmodified lines2592602612622632642652662672682692702712722732742752762778 unmodified lines286287288289290291292258 unmodified linesreturn compositecustom_css = """.output-class { display: none; }.inferno-slider input[type=range] {background: linear-gradient(to right,#000004, #1b0c41, #4a0c6b, #781c6d,#a52c60, #cf4446, #ed6925, #fb9b06,#f7d13d, #fcffa4) !important;background-size: 100% 100% !important;}"""with gr.Blocks(css=custom_css) as demo:gr.Markdown("""## Joint Tagger Project: JTP-PILOT² Demo **BETA**This tagger is designed for use on furry images (though may very well work on out-of-distribution images, potentially with funny results). A threshold of 0.2 is recommended. Lower thresholds often turn up more valid tags, but can also result in some amount of hallucinated tags.8 unmodified linessorted_tag_score_state = gr.State(value={}) # stash a copy of the input imagecam_state = gr.State()with gr.Row():with gr.Column():image_input = gr.Image(label="Source", sources=['upload'], type='pil', height=512, show_label=False)threshold_slider = gr.Slider(minimum=0.00, maximum=1.00, step=0.01, value=0.20, label="Tag Threshold")cam_slider = gr.Slider(minimum=0.00, maximum=1.00, step=0.01, value=0.40, label="CAM Threshold", elem_classes="inferno-slider")
app.py+14-12