(contents)
| 46 | |
| 47 | @app.callback(Output('output', 'children'), [Input('upload', 'contents')]) |
| 48 | def update_output(contents): |
| 49 | if contents is not None: |
| 50 | content_type, content_string = contents.split(',') |
| 51 | if 'image' in content_type: |
| 52 | predictions = predict(contents) |
| 53 | return html.Div([ |
| 54 | html.Div('Predictions'), |
| 55 | html.Pre(predictions, style=pre_style), |
| 56 | html.Hr(), |
| 57 | html.Img(src=contents) |
| 58 | ]) |
| 59 | |
| 60 | |
| 61 | if __name__ == '__main__': |