File size: 1,374 Bytes
bc393f7
c223130
bc393f7
0533194
17bc879
bc393f7
6ed8f4b
 
a207465
 
6d9c3db
c5be9b5
a207465
 
 
6ed8f4b
 
 
 
4debbb6
6d9c3db
 
bc393f7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from Blur import background_motion_blur

def blur(img, distance_blur, amount_blur, amount_subject):
    return background_motion_blur(img, distance_blur, amount_blur, amount_subject)

iface = gr.Interface(fn=blur,
                     title="Motion Blur",
                     description="""
                     by [Tony Assi](https://www.tonyassi.com/)
                     
                     A special motion blur where only the background is blurred and the subject is unaffected. [Github Repo](https://github.com/TonyAssi/Motion-Blur). Please ❀️ this Space.
        
                    I build custom AI apps for companies. <a href="mailto: tony.assi.media@gmail.com">Email me</a> for business inquiries.
                     """,
                     inputs=[gr.Image(type='pil', label='Image'), 
                             gr.Slider(label='Blur Distance', minimum=0, maximum=500, value=100), 
                             gr.Slider(label='Blur Amount', minimum=0.0, maximum=1.0, value=0.75), 
                             gr.Slider(label='Subject Amount', minimum=0.0, maximum=1.0, value=1.0)], 
                     outputs=gr.Image(label='Output'),
                     theme = gr.themes.Base(primary_hue="teal",secondary_hue="teal",neutral_hue="slate"),
                     examples=[['./image.png', 100, 0.75, 1.0]])
iface.launch()