itacaiunas commited on
Commit
ffbaa16
1 Parent(s): f2c74a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -44,17 +44,17 @@ if 'reuse_image' not in st.session_state:
44
  def set_image(img):
45
  st.session_state.reuse_image = img
46
 
47
- st.title("AI Remover Objetos")
48
 
49
  st.image(open("assets/demo.png", "rb").read())
50
 
51
  st.markdown(
52
  """
53
- So you want to remove an object in your photo? You don't need to learn photo editing skills.
54
- **Just draw over the parts of the image you want to remove, then our AI will remove them.**
55
  """
56
  )
57
- uploaded_file = st.file_uploader("Choose image", accept_multiple_files=False, type=["png", "jpg", "jpeg"])
58
 
59
  if uploaded_file is not None:
60
 
@@ -64,9 +64,9 @@ if uploaded_file is not None:
64
  bytes_data = uploaded_file.getvalue()
65
  img_input = Image.open(BytesIO(bytes_data)).convert("RGBA")
66
 
67
- stroke_width = st.slider("Brush size", 1, 100, 50)
68
 
69
- st.write("**Now draw (brush) the part of image that you want to remove.**")
70
 
71
  # Canvas size logic
72
  canvas_bg = deepcopy(img_input)
@@ -104,13 +104,13 @@ if uploaded_file is not None:
104
 
105
  reuse = False
106
 
107
- if st.button('Submit'):
108
 
109
- with st.spinner("AI is doing the magic!"):
110
  output = process_inpaint(np.array(img_input), np.array(im)) #TODO Put button here
111
  img_output = Image.fromarray(output).convert("RGB")
112
 
113
- st.write("AI has finished the job!")
114
  st.image(img_output)
115
  # reuse = st.button('Edit again (Re-use this image)', on_click=set_image, args=(inpainted_img, ))
116
 
@@ -119,8 +119,8 @@ if uploaded_file is not None:
119
  pil_image=img_output,
120
  filename=uploaded_name,
121
  fmt="jpg",
122
- label="Download Image"
123
  )
124
 
125
- st.info("**TIP**: If the result is not perfect, you can download it then "
126
- "upload then remove the artifacts.")
 
44
  def set_image(img):
45
  st.session_state.reuse_image = img
46
 
47
+ st.title("IA Removedora de Objetos")
48
 
49
  st.image(open("assets/demo.png", "rb").read())
50
 
51
  st.markdown(
52
  """
53
+ Então você quer remover um objeto em sua foto? Você não precisa aprender habilidades de edição de fotos.
54
+ **Apenas desenhe as partes da imagem que deseja remover, então nossa IA irá removê-las.**
55
  """
56
  )
57
+ uploaded_file = st.file_uploader("Escolha imagem", accept_multiple_files=False, type=["png", "jpg", "jpeg"])
58
 
59
  if uploaded_file is not None:
60
 
 
64
  bytes_data = uploaded_file.getvalue()
65
  img_input = Image.open(BytesIO(bytes_data)).convert("RGBA")
66
 
67
+ stroke_width = st.slider("Tamanho da ponta", 1, 100, 50)
68
 
69
+ st.write("**Agora desenhe (pinte) a parte da imagem que você deseja remover.**")
70
 
71
  # Canvas size logic
72
  canvas_bg = deepcopy(img_input)
 
104
 
105
  reuse = False
106
 
107
+ if st.button('REMOVER'):
108
 
109
+ with st.spinner("A IA está fazendo a mágica!"):
110
  output = process_inpaint(np.array(img_input), np.array(im)) #TODO Put button here
111
  img_output = Image.fromarray(output).convert("RGB")
112
 
113
+ st.write("AI terminou o trabalho!")
114
  st.image(img_output)
115
  # reuse = st.button('Edit again (Re-use this image)', on_click=set_image, args=(inpainted_img, ))
116
 
 
119
  pil_image=img_output,
120
  filename=uploaded_name,
121
  fmt="jpg",
122
+ label="Download Imagem"
123
  )
124
 
125
+ st.info("**DICA**: Se o resultado não for perfeito, você pode baixá-lo então"
126
+ "carregue e remova as imperfeições.")