nsfwalex commited on
Commit
1cba3b3
โ€ข
1 Parent(s): 509b60d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -51,26 +51,27 @@ css = """
51
  body {
52
  background-color: rgb(17, 24, 39);
53
  color: white;
 
54
  }
55
  .gradio-container {
56
  background-color: rgb(17, 24, 39) !important;
57
  border: none !important;
 
 
 
58
  }
59
- footer {display: none !important;}
60
  """
61
 
62
  with gr.Blocks(css=css) as demo:
63
  with gr.Column():
64
- image_input = gr.Image(type="numpy", label="Upload Image")
65
  process_button = gr.Button("Process Image")
66
  status = gr.Markdown(value="")
67
 
68
  def update_status(img):
69
- status.update(value="Processing... Please wait.")
70
- processed_img = inference(img)
71
- status.update(value="Processing complete!")
72
- return processed_img
73
 
74
- process_button.click(update_status, inputs=image_input, outputs=image_input)
75
 
76
  demo.launch()
 
51
  body {
52
  background-color: rgb(17, 24, 39);
53
  color: white;
54
+ overflow: hidden; /* Prevent scrolling */
55
  }
56
  .gradio-container {
57
  background-color: rgb(17, 24, 39) !important;
58
  border: none !important;
59
+ max-width: 100%; /* Ensure it does not exceed the container's width */
60
+ max-height: 100%; /* Ensure it does not exceed the container's height */
61
+ overflow: hidden; /* Prevent internal scrolling */
62
  }
63
+ footer {display: none !important;} /* Hide footer */
64
  """
65
 
66
  with gr.Blocks(css=css) as demo:
67
  with gr.Column():
68
+ image_input = gr.Image(type="numpy", label="Upload Image", height=512, width=512)
69
  process_button = gr.Button("Process Image")
70
  status = gr.Markdown(value="")
71
 
72
  def update_status(img):
73
+ return inference(img), gr.update(value="Processing complete!")
 
 
 
74
 
75
+ process_button.click(update_status, inputs=image_input, outputs=[image_input, status])
76
 
77
  demo.launch()