Conversation
gradio/demo.py
Outdated
|
|
||
| url2 = 'https://cdn.pixabay.com/photo/2014/05/20/21/20/bird-349026_1280.jpg' | ||
| r = requests.get(url2, allow_redirects=True) | ||
| open("bird.jpg", 'wb').write(r.content) |
There was a problem hiding this comment.
for some reason this image fails at inference (it shows "error") on the top right corner of output.
There was a problem hiding this comment.
btw any chance we can inspect the error message? that would help debugging
There was a problem hiding this comment.
errors are shown in logs here https://gradio.app/glogs/AK391/deeplab2 as for the error it could be related to oom?
There was a problem hiding this comment.
cool! maybe add this pointer somewhere so anyone who encountered issues might be able to check this?
gradio/demo.py
Outdated
|
|
||
| url1 = 'https://cdn.pixabay.com/photo/2021/01/28/18/21/beach-5958718_1280.jpg' | ||
| r = requests.get(url1, allow_redirects=True) | ||
| open("town.jpg", 'wb').write(r.content) |
There was a problem hiding this comment.
Our models are trained on cityscapes, it might not generalize well on other images tho. Could we use similar images?
There was a problem hiding this comment.
sure ill change this to something similar
There was a problem hiding this comment.
For those demo images, is there any licence issue?
Are they free to use?
gradio/demo.py
Outdated
| plt.xticks([], []) | ||
| ax.tick_params(width=0.0, grid_linewidth=0.0) | ||
| plt.grid('off') | ||
| # plt.show() |
There was a problem hiding this comment.
remove instead of comment out?
gradio/demo.py
Outdated
| except KeyboardInterrupt: | ||
| print("Process interrupted") | ||
| sys.exit(1) | ||
| MODEL_NAME = 'max_deeplab_l_backbone_os16_axial_deeplab_cityscapes_trainfine_saved_model' |
There was a problem hiding this comment.
would it be possible for users to select which model to use?
btw the default model here (maxdeeplab l) is fairly heavy. Would a lighterweight model be better as default? (e.g resnet50_os32_panoptic_deeplab_cityscapes_crowd_trainfine_saved_model)
There was a problem hiding this comment.
Hi sure i can try that currently using cpu on gradio hub so that is why inference is slow, I will update with this one to see if that helps
There was a problem hiding this comment.
in terms of the user choosing the model, I think lightweight models would be better for user experience, so I can create a dropdown that only include the lightweight ones
There was a problem hiding this comment.
yes a dropdown would be great. optionally we can also include larger ones and note users that could take a long time.
| gr.Interface( | ||
| inference, | ||
| [gr.inputs.Image(type="pil", label="Input")], | ||
| gr.outputs.Image(type="plot", label="Output"), |
There was a problem hiding this comment.
haven't used gradio yet, would it be possible to output multiple plots instead one? for now the output plots (input / segmentation / overlay / legend) are very small to inspect
There was a problem hiding this comment.
yes multiple plots are possible, I tried to folllow the colab notebook as how the plots were presented there
There was a problem hiding this comment.
also the image is downloadable and can be opened then to read easier
There was a problem hiding this comment.
y download images would be good. just thinking having separate plots would look better on the webui (and we dont need to show the original image again). Colab shows everything in one window just due to we dont want to execute extra code blocks to show them :)
There was a problem hiding this comment.
ok sounds good, also could the colab be updated to not show the input image as well I think the layout would show the legend on the side the two plots side by side
|
|
||
| url2 = 'https://cdn.pixabay.com/photo/2016/02/19/11/36/canal-1209808_1280.jpg' | ||
| r = requests.get(url2, allow_redirects=True) | ||
| open("city2.jpg", 'wb').write(r.content) |
There was a problem hiding this comment.
sorry for a late comment on style here: would it be possible to move these variables into main() and add a section
if name == 'main':
app.run(main)
This would be more consistent with other python scripts in this repo.
There was a problem hiding this comment.
is this the right section of code for this comment?
There was a problem hiding this comment.
I was referring to line 19-25 here. variables url1 / r / url2 are global variables and might hurt readability.
deeplab2 codebase encourage removing global variables if possible, with the exception of global constants (where the variable naming would be all caps)
gradio/demo.py
Outdated
|
|
||
| url1 = 'https://cdn.pixabay.com/photo/2021/01/28/18/21/beach-5958718_1280.jpg' | ||
| r = requests.get(url1, allow_redirects=True) | ||
| open("town.jpg", 'wb').write(r.content) |
There was a problem hiding this comment.
For those demo images, is there any licence issue?
Are they free to use?
| @@ -0,0 +1,5 @@ | |||
| matplotlib | |||
There was a problem hiding this comment.
Could you please not include requirements.txt for the PR?
We deleted them on purpose so that users will not just install sth wrong via pip install -r requirements.txt
|
|
||
| ## Gradio Demo | ||
|
|
||
| * <a href='https://gradio.app/hub/AK391/deeplab2'>Gradio Web Demo</a><br> |
There was a problem hiding this comment.
I am getting error 502 Bad Gateway with this URL.

easy to use web demo on gradio hub