|
import numpy as np |
|
import gradio as gr |
|
|
|
def flip_image(x): |
|
return (1000, np.zeros((100, 100))) |
|
|
|
with gr.Blocks() as demo: |
|
gr.Markdown(""" |
|
# Crowd Counting based on SASNet |
|
|
|
We implemented a image crowd counting model with VGG16 following the paper of Song et. al (2021). |
|
|
|
## References |
|
Song, Q., Wang, C., Wang, Y., Tai, Y., Wang, C., Li, J., … Ma, J. (2021). To Choose or to Fuse? Scale Selection for Crowd Counting. The Thirty-Fifth AAAI Conference on Artificial Intelligence (AAAI-21). |
|
""") |
|
image_button = gr.Button("Count the Crowd!") |
|
with gr.Row(): |
|
with gr.Column(): |
|
image_input = gr.Image(type="pil") |
|
gr.Examples(["IMG_1.jpg", "IMG_2.jpg", "IMG_3.jpg"], image_input) |
|
with gr.Column(): |
|
image_output = gr.Image() |
|
text_output = gr.Label() |
|
|
|
image_button.click(flip_image, inputs=image_input, outputs=[text_output, image_output]) |
|
|
|
demo.launch() |
|
|